@brightspace-ui/core 1.223.0 → 1.224.3
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Colors
|
|
2
2
|
|
|
3
|
-
Importing `colors` will add the color palette [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) to the document
|
|
3
|
+
Importing `colors` will add the color palette [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) to the document.
|
|
4
4
|
|
|
5
5
|
Run the demo page to see the full palette. See [colors.js](colors.js) for the variable names (i.e. `--d2l-color-*`).
|
|
6
6
|
|
|
@@ -26,4 +26,4 @@ Run the demo page to see the full palette. See [colors.js](colors.js) for the va
|
|
|
26
26
|
|
|
27
27
|
## Future Enhancements
|
|
28
28
|
|
|
29
|
-
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
29
|
+
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
@@ -605,12 +605,14 @@ class InputText extends LabelledMixin(FormElementMixin(SkeletonMixin(RtlMixin(Li
|
|
|
605
605
|
|| (this.unit && this.dir !== 'rtl');
|
|
606
606
|
|
|
607
607
|
if (firstSlotHasNodes) {
|
|
608
|
-
|
|
608
|
+
// Firefox can have trouble rendering the cursor if the padding is a decimal
|
|
609
|
+
requestAnimationFrame(() => this._firstSlotWidth = Math.ceil(firstContainer.getBoundingClientRect().width));
|
|
609
610
|
} else {
|
|
610
611
|
this._firstSlotWidth = 0;
|
|
611
612
|
}
|
|
612
613
|
if (lastSlotHasNodes) {
|
|
613
|
-
|
|
614
|
+
// Firefox can have trouble rendering the cursor if the padding is a decimal
|
|
615
|
+
requestAnimationFrame(() => this._lastSlotWidth = Math.ceil(lastContainer.getBoundingClientRect().width));
|
|
614
616
|
} else {
|
|
615
617
|
this._lastSlotWidth = 0;
|
|
616
618
|
}
|
|
@@ -184,7 +184,7 @@ class ScrollWrapper extends FocusVisiblePolyfillMixin(RtlMixin(LitElement)) {
|
|
|
184
184
|
|
|
185
185
|
scrollDistance(distance, smooth) {
|
|
186
186
|
if (!this._container) return;
|
|
187
|
-
if (this.
|
|
187
|
+
if (this.dir === 'rtl') distance = distance * RTL_MULTIPLIER;
|
|
188
188
|
if (this._container.scrollBy) {
|
|
189
189
|
this._container.scrollBy({ left: distance, behavior: smooth ? 'smooth' : 'auto' });
|
|
190
190
|
} else {
|
|
@@ -138,13 +138,13 @@ export const SelectionMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
138
138
|
if (currentIndex === -1) currentIndex = 0;
|
|
139
139
|
let newIndex;
|
|
140
140
|
|
|
141
|
-
if ((this.
|
|
142
|
-
|| (this.
|
|
141
|
+
if ((this.dir !== 'rtl' && e.keyCode === keyCodes.RIGHT)
|
|
142
|
+
|| (this.dir === 'rtl' && e.keyCode === keyCodes.LEFT)
|
|
143
143
|
|| e.keyCode === keyCodes.DOWN) {
|
|
144
144
|
if (currentIndex === selectables.length - 1) newIndex = 0;
|
|
145
145
|
else newIndex = currentIndex + 1;
|
|
146
|
-
} else if ((this.
|
|
147
|
-
|| (this.
|
|
146
|
+
} else if ((this.dir !== 'rtl' && e.keyCode === keyCodes.LEFT)
|
|
147
|
+
|| (this.dir === 'rtl' && e.keyCode === keyCodes.RIGHT)
|
|
148
148
|
|| e.keyCode === keyCodes.UP) {
|
|
149
149
|
if (currentIndex === 0) newIndex = selectables.length - 1;
|
|
150
150
|
else newIndex = currentIndex - 1;
|
package/mixins/rtl-mixin.js
CHANGED
|
@@ -4,7 +4,10 @@ export const RtlMixin = dedupeMixin(superclass => class extends superclass {
|
|
|
4
4
|
|
|
5
5
|
static get properties() {
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
10
|
+
dir: { type: String, reflect: true }
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
|
|
@@ -13,7 +16,7 @@ export const RtlMixin = dedupeMixin(superclass => class extends superclass {
|
|
|
13
16
|
const dir = document.documentElement.getAttribute('dir');
|
|
14
17
|
// avoid reflecting "ltr" for better performance
|
|
15
18
|
if (dir && dir !== 'ltr') {
|
|
16
|
-
this.
|
|
19
|
+
this.dir = dir;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.224.3",
|
|
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",
|