@brightspace-ui/core 3.85.0 → 3.85.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.
@@ -30,6 +30,7 @@ import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
30
30
  import { ifDefined } from 'lit/directives/if-defined.js';
31
31
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
32
32
  import { offscreenStyles } from '../offscreen/offscreen.js';
33
+ import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
33
34
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
34
35
  import { SubscriberRegistryController } from '../../controllers/subscriber/subscriberControllers.js';
35
36
 
@@ -256,6 +257,11 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
256
257
  addSpaceListener();
257
258
  }
258
259
 
260
+ disconnectedCallback() {
261
+ super.disconnectedCallback();
262
+ if (this.#resizeObserver) this.#resizeObserver.disconnect();
263
+ }
264
+
259
265
  firstUpdated(changedProperties) {
260
266
  super.firstUpdated(changedProperties);
261
267
  this.addEventListener('d2l-filter-dimension-data-change', this._handleDimensionDataChange);
@@ -349,6 +355,16 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
349
355
  super.update(changedProperties);
350
356
  }
351
357
 
358
+ updated(changedProperties) {
359
+ super.updated(changedProperties);
360
+ const search = this.shadowRoot.querySelector('d2l-input-search');
361
+ if (search) {
362
+ if (this.#resizeObserver) this.#resizeObserver.disconnect();
363
+ this.#resizeObserver = new ResizeObserver(() => requestAnimationFrame(() => this.#handleSearchResize()));
364
+ this.#resizeObserver.observe(search);
365
+ }
366
+ }
367
+
352
368
  requestFilterClearAll() {
353
369
  this._handleClearAll();
354
370
  }
@@ -363,6 +379,8 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
363
379
  }
364
380
  }
365
381
 
382
+ #resizeObserver;
383
+
366
384
  _buildDimension(dimension, singleDimension) {
367
385
  let dimensionHTML;
368
386
  switch (dimension.type) {
@@ -1143,6 +1161,10 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
1143
1161
  }
1144
1162
  }
1145
1163
 
1164
+ #handleSearchResize() {
1165
+ const content = this.shadowRoot.querySelector(`.${FILTER_CONTENT_CLASS}`);
1166
+ content.resize();
1167
+ }
1146
1168
  }
1147
1169
 
1148
1170
  customElements.define('d2l-filter', Filter);
@@ -105,5 +105,5 @@ If an activity is set to `Visible` but also has other conditions affecting its v
105
105
 
106
106
  ## Accessbility
107
107
 
108
- - When `text-position` is set to `hidden`, the required `text` will be used for the switch's hidden label so that it is [accessible](https://www.w3.org/WAI/WCAG22/quickref/#name-role-value) to non-sighted users.
109
- - `d2l-switch-visibility` is a notable exception to the best practice of having a static term as the label; this was done to provide more clarity in situations where there are external conditions that could influence whether or not the content in question is visible.
108
+ - When `text-position` is set to `hidden`, the required `text` will be used for the switch's hidden label so that it is [accessible](https://www.w3.org/WAI/WCAG22/quickref/#name-role-value) to non-sighted users
109
+ - `d2l-switch-visibility` is a notable exception to the best practice of having a static term as the label; this was done to provide more clarity in situations where there are external conditions that could influence whether or not the content in question is visible
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.85.0",
3
+ "version": "3.85.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",