@brightspace-ui/core 2.80.6 → 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.
@@ -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
  };
@@ -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.6",
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",