@brightspace-ui/core 2.80.5 → 2.80.7
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.
|
@@ -3,7 +3,6 @@ import { css, html, LitElement } from 'lit';
|
|
|
3
3
|
import { cssEscape, getComposedChildren, getComposedParent, isVisible } from '../../helpers/dom.js';
|
|
4
4
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
5
5
|
|
|
6
|
-
export const BACKDROP_ROLE = 'data-d2l-backdrop-role';
|
|
7
6
|
const BACKDROP_HIDDEN = 'data-d2l-backdrop-hidden';
|
|
8
7
|
const BACKDROP_ARIA_HIDDEN = 'data-d2l-backdrop-aria-hidden';
|
|
9
8
|
|
|
@@ -68,7 +67,8 @@ class Backdrop extends LitElement {
|
|
|
68
67
|
transition: none;
|
|
69
68
|
}
|
|
70
69
|
@media (prefers-reduced-motion: reduce) {
|
|
71
|
-
:host
|
|
70
|
+
:host,
|
|
71
|
+
:host([slow-transition]) {
|
|
72
72
|
transition: none;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -162,20 +162,13 @@ function hideAccessible(target) {
|
|
|
162
162
|
if (path.indexOf(child) !== -1) continue;
|
|
163
163
|
if (child.hasAttribute(BACKDROP_HIDDEN)) continue;
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
child.setAttribute('role', 'presentation');
|
|
168
|
-
|
|
169
|
-
if (child.nodeName === 'FORM' || child.nodeName === 'A') {
|
|
170
|
-
const ariaHidden = child.getAttribute('aria-hidden');
|
|
171
|
-
if (ariaHidden) child.setAttribute(BACKDROP_ARIA_HIDDEN, ariaHidden);
|
|
172
|
-
child.setAttribute('aria-hidden', 'true');
|
|
165
|
+
if (child.hasAttribute('aria-hidden')) {
|
|
166
|
+
child.setAttribute(BACKDROP_ARIA_HIDDEN, child.getAttribute('aria-hidden'));
|
|
173
167
|
}
|
|
168
|
+
child.setAttribute('aria-hidden', 'true');
|
|
174
169
|
|
|
175
170
|
child.setAttribute(BACKDROP_HIDDEN, BACKDROP_HIDDEN);
|
|
176
171
|
hiddenElements.push(child);
|
|
177
|
-
|
|
178
|
-
hideAccessibleChildren(child);
|
|
179
172
|
}
|
|
180
173
|
};
|
|
181
174
|
|
|
@@ -204,21 +197,11 @@ export function preventBodyScroll() {
|
|
|
204
197
|
function showAccessible(elems) {
|
|
205
198
|
for (let i = 0; i < elems.length; i++) {
|
|
206
199
|
const elem = elems[i];
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
elem.
|
|
210
|
-
elem.removeAttribute(BACKDROP_ROLE);
|
|
200
|
+
if (elem.hasAttribute(BACKDROP_ARIA_HIDDEN)) {
|
|
201
|
+
elem.setAttribute('aria-hidden', elem.getAttribute(BACKDROP_ARIA_HIDDEN));
|
|
202
|
+
elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
|
|
211
203
|
} else {
|
|
212
|
-
elem.removeAttribute('
|
|
213
|
-
}
|
|
214
|
-
if (elem.nodeName === 'FORM' || elem.nodeName === 'A') {
|
|
215
|
-
const ariaHidden = elem.getAttribute(BACKDROP_ARIA_HIDDEN);
|
|
216
|
-
if (ariaHidden) {
|
|
217
|
-
elem.setAttribute('aria-hidden', ariaHidden);
|
|
218
|
-
elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
|
|
219
|
-
} else {
|
|
220
|
-
elem.removeAttribute('aria-hidden');
|
|
221
|
-
}
|
|
204
|
+
elem.removeAttribute('aria-hidden');
|
|
222
205
|
}
|
|
223
206
|
elem.removeAttribute(BACKDROP_HIDDEN);
|
|
224
207
|
}
|
|
@@ -476,6 +476,7 @@ The `d2l-list-item-button` provides the same functionality as `d2l-list-item` ex
|
|
|
476
476
|
| Property | Type | Description |
|
|
477
477
|
|---|---|---|
|
|
478
478
|
| `breakpoints` | Array | Breakpoints for responsiveness in pixels. There are four different breakpoints and only the four largest breakpoints will be used. |
|
|
479
|
+
| `button-disabled` | Boolean | Disables the primary action button |
|
|
479
480
|
| `disabled` | Boolean | Disables the input |
|
|
480
481
|
| `draggable` | Boolean | Whether the item is draggable |
|
|
481
482
|
| `drag-handle-text` | String | The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode. |
|
|
@@ -4,13 +4,30 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
|
4
4
|
import { ListItemMixin } from './list-item-mixin.js';
|
|
5
5
|
|
|
6
6
|
export const ListItemButtonMixin = superclass => class extends ListItemMixin(superclass) {
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Disables the primary action button
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
*/
|
|
13
|
+
buttonDisabled : { type: Boolean, attribute: 'button-disabled' }
|
|
14
|
+
};
|
|
15
|
+
}
|
|
7
16
|
|
|
8
17
|
static get styles() {
|
|
9
18
|
|
|
10
19
|
const styles = [ css`
|
|
11
|
-
:host {
|
|
20
|
+
:host(:not([button-disabled])) {
|
|
12
21
|
--d2l-list-item-content-text-color: var(--d2l-color-celestine);
|
|
13
22
|
}
|
|
23
|
+
:host([button-disabled][_hovering-primary-action]) .d2l-list-item-content,
|
|
24
|
+
:host([button-disabled][_focusing-primary-action]) .d2l-list-item-content {
|
|
25
|
+
--d2l-list-item-content-text-color: unset;
|
|
26
|
+
--d2l-list-item-content-text-decoration: none;
|
|
27
|
+
}
|
|
28
|
+
:host([button-disabled]) button {
|
|
29
|
+
cursor: default;
|
|
30
|
+
}
|
|
14
31
|
[slot="outside-control-container"] {
|
|
15
32
|
margin: 0 -12px;
|
|
16
33
|
}
|
|
@@ -51,6 +68,7 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
|
51
68
|
constructor() {
|
|
52
69
|
super();
|
|
53
70
|
this._primaryActionId = getUniqueId();
|
|
71
|
+
this.buttonDisabled = false;
|
|
54
72
|
}
|
|
55
73
|
|
|
56
74
|
_onButtonClick() {
|
|
@@ -59,7 +77,7 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
|
59
77
|
}
|
|
60
78
|
|
|
61
79
|
_renderPrimaryAction(labelledBy) {
|
|
62
|
-
return html`<button id="${this._primaryActionId}" aria-labelledby="${labelledBy}" @click="${this._onButtonClick}"></button>`;
|
|
80
|
+
return html`<button id="${this._primaryActionId}" aria-labelledby="${labelledBy}" @click="${this._onButtonClick}" ?disabled="${this.buttonDisabled}"></button>`;
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
};
|
package/custom-elements.json
CHANGED
|
@@ -7742,6 +7742,12 @@
|
|
|
7742
7742
|
"path": "./components/list/list-item-button.js",
|
|
7743
7743
|
"description": "A component for a \"listitem\" child within a list. It provides semantics, basic layout, breakpoints for responsiveness, a link for navigation, and selection.",
|
|
7744
7744
|
"attributes": [
|
|
7745
|
+
{
|
|
7746
|
+
"name": "button-disabled",
|
|
7747
|
+
"description": "Disables the primary action button",
|
|
7748
|
+
"type": "boolean",
|
|
7749
|
+
"default": "false"
|
|
7750
|
+
},
|
|
7745
7751
|
{
|
|
7746
7752
|
"name": "drag-target-handle-only",
|
|
7747
7753
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
|
@@ -7838,6 +7844,13 @@
|
|
|
7838
7844
|
}
|
|
7839
7845
|
],
|
|
7840
7846
|
"properties": [
|
|
7847
|
+
{
|
|
7848
|
+
"name": "buttonDisabled",
|
|
7849
|
+
"attribute": "button-disabled",
|
|
7850
|
+
"description": "Disables the primary action button",
|
|
7851
|
+
"type": "boolean",
|
|
7852
|
+
"default": "false"
|
|
7853
|
+
},
|
|
7841
7854
|
{
|
|
7842
7855
|
"name": "dragTargetHandleOnly",
|
|
7843
7856
|
"attribute": "drag-target-handle-only",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.80.
|
|
3
|
+
"version": "2.80.7",
|
|
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",
|