@brightspace-ui/core 3.124.0 → 3.124.1
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.
@@ -7,6 +7,14 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
7
7
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
8
8
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
9
9
|
|
10
|
+
function debounce(func, delay) {
|
11
|
+
let timer = 0;
|
12
|
+
return function() {
|
13
|
+
clearTimeout(timer);
|
14
|
+
timer = setTimeout(func, delay);
|
15
|
+
};
|
16
|
+
}
|
17
|
+
|
10
18
|
class InputDateTimeRangeTo extends SkeletonMixin(LocalizeCoreElement(LitElement)) {
|
11
19
|
|
12
20
|
static get properties() {
|
@@ -169,13 +177,13 @@ class InputDateTimeRangeTo extends SkeletonMixin(LocalizeCoreElement(LitElement)
|
|
169
177
|
this._leftElemResizeObserver.disconnect();
|
170
178
|
this._leftElemResizeObserver.observe(leftElem);
|
171
179
|
|
172
|
-
this._parentElemResizeObserver = this._parentElemResizeObserver || new ResizeObserver(async() => {
|
180
|
+
this._parentElemResizeObserver = this._parentElemResizeObserver || new ResizeObserver(debounce(async() => {
|
173
181
|
this._blockDisplay = false;
|
174
182
|
await this.updateComplete;
|
175
183
|
const height = Math.ceil(parseFloat(getComputedStyle(container).getPropertyValue('height')));
|
176
184
|
if (height >= (leftElemHeight * 2)) this._blockDisplay = true; // switch to _blockDisplay styles if content has wrapped (needed for "to" to occupy its own line)
|
177
185
|
else this._blockDisplay = false;
|
178
|
-
});
|
186
|
+
}, 5).bind(this));
|
179
187
|
this._parentElemResizeObserver.disconnect();
|
180
188
|
this._parentElemResizeObserver.observe(this._parentNode);
|
181
189
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.124.
|
3
|
+
"version": "3.124.1",
|
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",
|