@brightspace-ui/core 1.230.4 → 1.232.0

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.
@@ -273,6 +273,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
273
273
  this.__onAutoCloseClick = this.__onAutoCloseClick.bind(this);
274
274
  this.__toggleScrollStyles = this.__toggleScrollStyles.bind(this);
275
275
  this._handleMobileResize = this._handleMobileResize.bind(this);
276
+ this.__disconnectResizeObserver = this.__disconnectResizeObserver.bind(this);
276
277
  }
277
278
 
278
279
  get opened() {
@@ -312,6 +313,8 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
312
313
  }
313
314
  clearDismissible(this.__dismissibleId);
314
315
  this.__dismissibleId = null;
316
+
317
+ if (this.__resizeObserver) this.__resizeObserver.disconnect();
315
318
  }
316
319
 
317
320
  firstUpdated(changedProperties) {
@@ -374,6 +377,17 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
374
377
  this._showBackdrop = this._useMobileStyling && this.mobileTray;
375
378
  }
376
379
 
380
+ /**
381
+ * Waits for the next resize when elem has a height > 0px,
382
+ * then calls the __position function.
383
+ */
384
+ requestRepositionNextResize(elem) {
385
+ if (!elem) return;
386
+ if (this.__resizeObserver) this.__resizeObserver.disconnect();
387
+ this.__resizeObserver = new ResizeObserver(this.__disconnectResizeObserver);
388
+ this.__resizeObserver.observe(elem);
389
+ }
390
+
377
391
  async resize() {
378
392
  if (!this.opened) {
379
393
  return;
@@ -403,6 +417,20 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
403
417
  }
404
418
  }
405
419
 
420
+ __disconnectResizeObserver(entries) {
421
+ for (let i = 0; i < entries.length; i++) {
422
+ const entry = entries[i];
423
+ if (this.__resizeObserver && entry.contentRect.height !== 0) {
424
+ this.__resizeObserver.disconnect();
425
+ // wrap in rAF for Firefox
426
+ requestAnimationFrame(() => {
427
+ if (this.opened) this.__position();
428
+ });
429
+ break;
430
+ }
431
+ }
432
+ }
433
+
406
434
  __getContentBottom() {
407
435
  return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-bottom');
408
436
  }
@@ -90,7 +90,20 @@
90
90
  <d2l-demo-snippet>
91
91
  <template>
92
92
  <d2l-filter>
93
- <d2l-filter-dimension-set key="course" text="Course" loading select-all></d2l-filter-dimension-set>
93
+ <d2l-filter-dimension-set key="course" text="Course" loading select-all>
94
+ <d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
95
+ <d2l-filter-dimension-set-value key="astronomy" text="Astronomy" selected></d2l-filter-dimension-set-value>
96
+ <d2l-filter-dimension-set-value key="biology" text="Biology"></d2l-filter-dimension-set-value>
97
+ <d2l-filter-dimension-set-value key="chemistry" text="Chemistry"></d2l-filter-dimension-set-value>
98
+ <d2l-filter-dimension-set-value key="drama" text="Drama"></d2l-filter-dimension-set-value>
99
+ <d2l-filter-dimension-set-value key="english" text="English"></d2l-filter-dimension-set-value>
100
+ <d2l-filter-dimension-set-value key="how-to" text="How To Write a How To Article With a Flashy Title"></d2l-filter-dimension-set-value>
101
+ <d2l-filter-dimension-set-value key="math" text="Math"></d2l-filter-dimension-set-value>
102
+ <d2l-filter-dimension-set-value key="physics" text="Physics"></d2l-filter-dimension-set-value>
103
+ <d2l-filter-dimension-set-value key="stats" text="Statistics"></d2l-filter-dimension-set-value>
104
+ <d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft"></d2l-filter-dimension-set-value>
105
+ </d2l-filter-dimension-set>
106
+
94
107
  </d2l-filter>
95
108
  <d2l-filter>
96
109
  <d2l-filter-dimension-set key="course" text="Course" loading select-all></d2l-filter-dimension-set>
@@ -256,7 +256,10 @@ class Filter extends LocalizeCoreElement(RtlMixin(LitElement)) {
256
256
  let dimensionHTML;
257
257
  switch (dimension.type) {
258
258
  case 'd2l-filter-dimension-set':
259
- dimensionHTML = html`<div aria-live="polite">${this._createSetDimension(dimension)}</div>`;
259
+ dimensionHTML = html`
260
+ <div aria-live="polite" class="d2l-filter-container">
261
+ ${this._createSetDimension(dimension)}
262
+ </div>`;
260
263
  break;
261
264
  }
262
265
 
@@ -519,7 +522,8 @@ class Filter extends LocalizeCoreElement(RtlMixin(LitElement)) {
519
522
 
520
523
  let shouldUpdate = false,
521
524
  shouldSearch = false,
522
- shouldRecount = false;
525
+ shouldRecount = false,
526
+ shouldResizeDropdown = false;
523
527
  changes.forEach((newValue, prop) => {
524
528
  if (toUpdate[prop] === newValue) return;
525
529
 
@@ -538,13 +542,23 @@ class Filter extends LocalizeCoreElement(RtlMixin(LitElement)) {
538
542
  } else if (prop === 'values') {
539
543
  if (dimension.searchValue) shouldSearch = true;
540
544
  shouldRecount = true;
545
+ shouldResizeDropdown = true;
541
546
  this._activeFiltersSubscribers.updateSubscribers();
547
+ } else if (prop === 'loading') {
548
+ shouldResizeDropdown = true;
542
549
  }
543
550
  });
544
551
 
545
552
  if (shouldSearch) this._performDimensionSearch(dimension);
546
553
  if (shouldRecount) this._setFilterCounts(dimension);
547
- if (shouldUpdate) this.requestUpdate();
554
+ if (shouldUpdate) this.requestUpdate();
555
+ if (shouldResizeDropdown) {
556
+ const singleDimension = this._dimensions.length === 1;
557
+ if (singleDimension && this.opened) {
558
+ const dropdown = this.shadowRoot.querySelector('d2l-dropdown-content');
559
+ dropdown.requestRepositionNextResize(this.shadowRoot.querySelector('.d2l-filter-container'));
560
+ }
561
+ }
548
562
  }
549
563
 
550
564
  _handleDimensionHide() {
@@ -80,7 +80,7 @@ search.addEventListener('d2l-input-search-searched', (e) => {
80
80
  When the input is cleared, the same event will be fired with an empty value.
81
81
  <!-- docs: end hidden content -->
82
82
 
83
- ### Accessibility
83
+ ### Accessibility Properties
84
84
 
85
85
  To make your usage of `d2l-input-search` accessible, use the following property when applicable:
86
86
 
@@ -311,6 +311,7 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
311
311
 
312
312
  | Property | Type | Description |
313
313
  |---|---|---|
314
+ | `no-selection` | Boolean | Whether to render select-all and selection summary |
314
315
  | `padding-type` | String | Header whitespace (`normal` (default), `slim`) |
315
316
  | `select-all-pages-allowed` | Boolean | Whether all pages can be selected |
316
317
  <!-- docs: end hidden content -->
@@ -13,10 +13,10 @@
13
13
  import '../../menu/menu.js';
14
14
  import '../../menu/menu-item.js';
15
15
  import '../../selection/selection-action.js';
16
+ import '../../selection/selection-action-dropdown.js';
16
17
  import '../../selection/selection-action-menu-item.js';
17
18
  import '../../tooltip/tooltip.js';
18
19
  import '../list-header.js';
19
- import '../list-item-button.js';
20
20
  import '../list-item-content.js';
21
21
  import '../list-item.js';
22
22
  import '../list.js';
@@ -69,7 +69,20 @@
69
69
  <d2l-list id="allFeatures" item-count="50">
70
70
  <d2l-list-header slot="header" select-all-pages-allowed>
71
71
  <d2l-selection-action icon="tier1:plus-default" text="Add"></d2l-selection-action>
72
- <d2l-selection-action icon="tier1:delete" text="Delete" requires-selection></d2l-selection-action>
72
+ <d2l-selection-action-dropdown text="Move To" requires-selection>
73
+ <d2l-dropdown-menu>
74
+ <d2l-menu label="Move To Options">
75
+ <d2l-menu-item text="Top of Quiz"></d2l-menu-item>
76
+ <d2l-menu-item text="Bottom of Quiz"></d2l-menu-item>
77
+ <d2l-menu-item text="Section">
78
+ <d2l-menu>
79
+ <d2l-menu-item text="Option 1"></d2l-menu-item>
80
+ <d2l-menu-item text="Option 2"></d2l-menu-item>
81
+ </d2l-menu-item>
82
+ </d2l-menu-item>
83
+ </d2l-menu>
84
+ </d2l-dropdown-menu>
85
+ </d2l-selection-action-dropdown>
73
86
  <d2l-dropdown-button-subtle text="Actions">
74
87
  <d2l-dropdown-menu>
75
88
  <d2l-menu label="Actions">
@@ -78,7 +91,7 @@
78
91
  </d2l-menu>
79
92
  </d2l-dropdown-menu>
80
93
  </d2l-dropdown-button-subtle>
81
- <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
94
+ <d2l-selection-action icon="tier1:gear" text="Settings" requires-selection></d2l-selection-action>
82
95
  </d2l-list-header>
83
96
  <d2l-list-item href="http://www.d2l.com" selectable key="1" label="Introductory Earth Sciences">
84
97
  <img slot="illustration" src="https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg"></img>
@@ -226,11 +239,5 @@
226
239
 
227
240
  </d2l-demo-page>
228
241
 
229
- <script>
230
- document.body.addEventListener('d2l-list-item-button-click', (e) => {
231
- console.log('d2l-list-item-button clicked!', e);
232
- });
233
- </script>
234
-
235
242
  </body>
236
243
  </html>
@@ -15,12 +15,10 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
15
15
  static get properties() {
16
16
  return {
17
17
  /**
18
- * @ignore
19
- * Whether to render a header with reduced whitespace
20
- * TODO: Remove
18
+ * Whether to render select-all and selection summary
21
19
  * @type {boolean}
22
20
  */
23
- slim: { reflect: true, type: Boolean },
21
+ noSelection: { type: Boolean, attribute: 'no-selection' },
24
22
  /**
25
23
  * How much padding to render list items with
26
24
  * @type {'normal'|'slim'}
@@ -31,6 +29,13 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
31
29
  * @type {boolean}
32
30
  */
33
31
  selectAllPagesAllowed: { type: Boolean, attribute: 'select-all-pages-allowed' },
32
+ /**
33
+ * @ignore
34
+ * Whether to render a header with reduced whitespace
35
+ * TODO: Remove
36
+ * @type {boolean}
37
+ */
38
+ slim: { reflect: true, type: Boolean }
34
39
  };
35
40
  }
36
41
 
@@ -87,21 +92,24 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
87
92
 
88
93
  constructor() {
89
94
  super();
90
- this.slim = false;
95
+ this.noSelection = false;
91
96
  this.paddingType = 'normal';
92
97
  this.selectAllPagesAllowed = false;
98
+ this.slim = false;
93
99
  }
94
100
 
95
101
  render() {
96
102
  return html`
97
103
  <div class="d2l-list-header-container">
98
- <d2l-selection-select-all></d2l-selection-select-all>
99
- <d2l-selection-summary
100
- aria-hidden="true"
101
- class="d2l-list-header-summary"
102
- no-selection-text="${this.localize('components.selection.select-all')}">
103
- </d2l-selection-summary>
104
- ${this.selectAllPagesAllowed ? html`<d2l-selection-select-all-pages></d2l-selection-select-all-pages>` : null}
104
+ ${this.noSelection ? null : html`
105
+ <d2l-selection-select-all></d2l-selection-select-all>
106
+ <d2l-selection-summary
107
+ aria-hidden="true"
108
+ class="d2l-list-header-summary"
109
+ no-selection-text="${this.localize('components.selection.select-all')}">
110
+ </d2l-selection-summary>
111
+ ${this.selectAllPagesAllowed ? html`<d2l-selection-select-all-pages></d2l-selection-select-all-pages>` : null}
112
+ `}
105
113
  <div class="d2l-list-header-actions">
106
114
  <d2l-overflow-group opener-type="icon"><slot></slot></d2l-overflow-group>
107
115
  </div>
@@ -32,7 +32,7 @@ const OPENER_STYLE = {
32
32
 
33
33
  function createMenuItem(node) {
34
34
  const childText = node.text || node.firstChild && (node.firstChild.label || node.firstChild.text || node.firstChild.textContent.trim());
35
- const disabled = node.disabled;
35
+ const disabled = !!node.disabled;
36
36
  const handleItemSelect = () => {
37
37
  node.dispatchEvent(new CustomEvent('d2l-button-ghost-click'));
38
38
  node.click();
@@ -67,11 +67,14 @@ function createMenuItemMenu(node) {
67
67
  || node.querySelector('d2l-dropdown-button-subtle');
68
68
 
69
69
  const openerText = node.text || menuOpener.text;
70
+ const disabled = !!node.disabled;
70
71
  const subMenu = node.querySelector('d2l-menu');
71
72
 
72
73
  const subItems = Array.from(subMenu.children).map((node) => convertToDropdownItem(node));
73
74
 
74
- return html`<d2l-menu-item text="${openerText}">
75
+ return html`<d2l-menu-item
76
+ ?disabled=${disabled}
77
+ text="${openerText}">
75
78
  <d2l-menu>
76
79
  ${subItems}
77
80
  </d2l-menu>
@@ -96,6 +99,7 @@ function convertToDropdownItem(node) {
96
99
  case 'd2l-dropdown-button-subtle':
97
100
  case 'd2l-dropdown-context-menu':
98
101
  case 'd2l-dropdown-more':
102
+ case 'd2l-selection-action-dropdown':
99
103
  return createMenuItemMenu(node);
100
104
  case 'd2l-menu-item':
101
105
  case 'd2l-selection-action-menu-item':
@@ -199,7 +203,9 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
199
203
  .d2l-overflow-group-container ::slotted(d2l-dropdown-button),
200
204
  .d2l-overflow-group-container ::slotted(d2l-dropdown-button-subtle),
201
205
  .d2l-overflow-group-container ::slotted(d2l-dropdown-more),
202
- .d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu) {
206
+ .d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu),
207
+ .d2l-overflow-group-container ::slotted(d2l-selection-action),
208
+ .d2l-overflow-group-container ::slotted(d2l-selection-action-dropdown) {
203
209
  margin-right: 0.6rem;
204
210
  }
205
211
  :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-button),
@@ -210,7 +216,9 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
210
216
  :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-button),
211
217
  :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-button-subtle),
212
218
  :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-more),
213
- :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu) {
219
+ :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu),
220
+ :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-selection-action),
221
+ :host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-selection-action-dropdown) {
214
222
  margin-left: 0.6rem;
215
223
  margin-right: 0;
216
224
  }
@@ -148,9 +148,41 @@ The `d2l-selection-action` is an optional component that provides a button for a
148
148
  | `d2l-selection-action-click` | Dispatched when the user clicks the action button. The `SelectionInfo` is provided as the event `detail`. If `requires-selection` was specified then the event will only be dispatched if items are selected. |
149
149
  <!-- docs: end hidden content -->
150
150
 
151
+ ## Selection Action Dropdown [d2l-selection-action-dropdown]
152
+
153
+ The `d2l-selection-action-dropdown` is an optional component that provides a button opener for dropdown content associated with the selection component (ex. bulk actions). The `requires-selection` attribute may be specified to indicate that the opener should be non-interactive if nothing is selected.
154
+
155
+ <!-- docs: demo live name:d2l-selection-action-dropdown -->
156
+ ```html
157
+ <script type="module">
158
+ import '@brightspace-ui/core/components/dropdown/dropdown-menu.js';
159
+ import '@brightspace-ui/core/components/menu/menu.js';
160
+ import '@brightspace-ui/core/components/menu/menu-item.js';
161
+ import '@brightspace-ui/core/components/selection/selection-action-dropdown.js';
162
+ </script>
163
+ <d2l-selection-action-dropdown text="Actions" requires-selection>
164
+ <d2l-dropdown-menu>
165
+ <d2l-menu label="Actions">
166
+ <d2l-menu-item text="Action 1"></d2l-menu-item>
167
+ <d2l-menu-item text="Action 2"></d2l-menu-item>
168
+ </d2l-menu>
169
+ </d2l-dropdown-menu>
170
+ </d2l-selection-action-dropdown>
171
+ ```
172
+
173
+ <!-- docs: start hidden content -->
174
+ ### Properties
175
+
176
+ | Property | Type | Description |
177
+ |---|---|---|
178
+ | `requires-selection` | Boolean | Whether the action dropdown opener requires one or more selected items. If no items are selected, the opener will be focusable and a hint displayed in a tooltip. |
179
+ | `selection-for` | String | Id of the corresponding `SelectionMixin` component, if not placed within it. |
180
+ | `text` | String, required | Text for the dropdown opener button. |
181
+ <!-- docs: end hidden content -->
182
+
151
183
  ## Selection Action Menu Item [d2l-selection-action-menu-item]
152
184
 
153
- The `d2l-selection-action-menu-item` is an optional component that is a menu item for actions associated with the selection component (ex. bulk actions). The `requires-selection` attribute may be specified to indicate that the button should be non-interactive if nothing is selected.
185
+ The `d2l-selection-action-menu-item` is an optional component that is a menu item for actions associated with the selection component (ex. bulk actions). The `requires-selection` attribute may be specified to indicate that the menu item should be non-interactive if nothing is selected. This component enables the app to define an opener that is enabled regardless of the selection state, while having a menu containing one or more menu items that `requires-selection`.
154
186
 
155
187
  <!-- docs: demo live name:d2l-selection-action-menu-item -->
156
188
  ```html
@@ -6,10 +6,10 @@
6
6
  <link rel="stylesheet" href="../../demo/styles.css" type="text/css">
7
7
  <script type="module">
8
8
  import '../../demo/demo-page.js';
9
- import '../../dropdown/dropdown-button-subtle.js';
10
9
  import '../../dropdown/dropdown-menu.js';
11
10
  import '../../menu/menu.js';
12
11
  import '../selection-action.js';
12
+ import '../selection-action-dropdown.js';
13
13
  import '../selection-action-menu-item.js';
14
14
  import '../selection-input.js';
15
15
  import '../selection-select-all.js';
@@ -61,14 +61,14 @@
61
61
  <d2l-selection-select-all></d2l-selection-select-all>
62
62
  <d2l-selection-action text="Bookmark" icon="tier1:bookmark-hollow" requires-selection></d2l-selection-action>
63
63
  <d2l-selection-action text="Settings" icon="tier1:gear"></d2l-selection-action>
64
- <d2l-dropdown-button-subtle text="Actions">
64
+ <d2l-selection-action-dropdown text="Actions 1" requires-selection>
65
65
  <d2l-dropdown-menu>
66
66
  <d2l-menu label="Actions">
67
- <d2l-selection-action-menu-item text="Action 1 (requires selection)" requires-selection></d2l-selection-action-menu-item>
67
+ <d2l-selection-action-menu-item text="Action 1"></d2l-selection-action-menu-item>
68
68
  <d2l-selection-action-menu-item text="Action 2"></d2l-selection-action-menu-item>
69
69
  </d2l-menu>
70
70
  </d2l-dropdown-menu>
71
- </d2l-dropdown-button-subtle>
71
+ </d2l-selection-action-dropdown>
72
72
  </div>
73
73
  <d2l-selection-summary style="flex: none;"></d2l-selection-summary>
74
74
  </div>
@@ -0,0 +1,56 @@
1
+ import '../button/button-subtle.js';
2
+ import { html, LitElement } from 'lit-element/lit-element.js';
3
+ import { DropdownOpenerMixin } from '../dropdown/dropdown-opener-mixin.js';
4
+ import { dropdownOpenerStyles } from '../dropdown/dropdown-opener-styles.js';
5
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
6
+ import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
7
+ import { SelectionActionMixin } from './selection-action-mixin.js';
8
+
9
+ /**
10
+ * A dropdown opener associated with a selection component.
11
+ * @slot - Dropdown content (e.g., "d2l-dropdown-content", "d2l-dropdown-menu" or "d2l-dropdown-tabs")
12
+ * @fires d2l-selection-observer-subscribe - Internal event
13
+ */
14
+ class ActionDropdown extends LocalizeCoreElement(SelectionActionMixin(DropdownOpenerMixin(LitElement))) {
15
+
16
+ static get properties() {
17
+ return {
18
+ /**
19
+ * REQUIRED: Text for the dropdown opener button
20
+ * @type {string}
21
+ */
22
+ text: { type: String }
23
+ };
24
+ }
25
+
26
+ static get styles() {
27
+ return dropdownOpenerStyles;
28
+ }
29
+
30
+ render() {
31
+ return html`
32
+ <d2l-button-subtle
33
+ ?disabled=${this.disabled}
34
+ disabled-tooltip="${ifDefined(this.disabled ? this.localize('components.selection.action-hint') : undefined)}"
35
+ icon="tier1:chevron-down"
36
+ icon-right
37
+ text=${this.text}></d2l-button-subtle>
38
+ <slot></slot>
39
+ `;
40
+ }
41
+
42
+ focus() {
43
+ const elem = this.shadowRoot && this.shadowRoot.querySelector('d2l-button-subtle');
44
+ if (elem) elem.focus();
45
+ }
46
+
47
+ /**
48
+ * Gets the opener element with class "d2l-dropdown-opener" (required by dropdown-opener-mixin).
49
+ * @return {HTMLElement}
50
+ */
51
+ getOpenerElement() {
52
+ return this.shadowRoot && this.shadowRoot.querySelector('d2l-button-subtle');
53
+ }
54
+
55
+ }
56
+ customElements.define('d2l-selection-action-dropdown', ActionDropdown);
@@ -1,3 +1,4 @@
1
+ import '../icons/icon.js';
1
2
  import { css, html, LitElement } from 'lit-element/lit-element.js';
2
3
  import { MenuItemMixin } from '../menu/menu-item-mixin.js';
3
4
  import { menuItemStyles } from '../menu/menu-item-styles.js';
@@ -10,7 +11,7 @@ import { SelectionInfo } from './selection-mixin.js';
10
11
  * @fires d2l-selection-action-click - Dispatched when the user clicks the action button. The `SelectionInfo` is provided as the event `detail`. If `requires-selection` was specified then the event will only be dispatched if items are selected.
11
12
  * @fires d2l-selection-observer-subscribe - Internal event
12
13
  */
13
- class MenuItem extends SelectionActionMixin(MenuItemMixin(LitElement)) {
14
+ class ActionMenuItem extends SelectionActionMixin(MenuItemMixin(LitElement)) {
14
15
 
15
16
  static get styles() {
16
17
  return [ menuItemStyles,
@@ -20,6 +21,10 @@ class MenuItem extends SelectionActionMixin(MenuItemMixin(LitElement)) {
20
21
  display: flex;
21
22
  padding: 0.75rem 1rem;
22
23
  }
24
+ d2l-icon {
25
+ flex: none;
26
+ margin-left: 6px;
27
+ }
23
28
  :host([dir="rtl"]) d2l-icon {
24
29
  margin-left: 0;
25
30
  margin-right: 6px;
@@ -39,9 +44,14 @@ class MenuItem extends SelectionActionMixin(MenuItemMixin(LitElement)) {
39
44
  }
40
45
 
41
46
  render() {
47
+ const icon = this.hasChildView ?
48
+ html`<d2l-icon icon="tier1:chevron-right"></d2l-icon>` : null;
49
+
42
50
  return html`
43
51
  <div class="d2l-menu-item-text">${this.text}</div>
44
52
  <div class="d2l-menu-item-supporting"><slot name="supporting"></slot></div>
53
+ ${icon}
54
+ <slot></slot>
45
55
  `;
46
56
  }
47
57
 
@@ -58,4 +68,4 @@ class MenuItem extends SelectionActionMixin(MenuItemMixin(LitElement)) {
58
68
 
59
69
  }
60
70
 
61
- customElements.define('d2l-selection-action-menu-item', MenuItem);
71
+ customElements.define('d2l-selection-action-menu-item', ActionMenuItem);
@@ -1,20 +1,17 @@
1
1
  import '../button/button-subtle.js';
2
- import '../icons/icon.js';
3
- import '../tooltip/tooltip.js';
4
2
  import { css, html, LitElement } from 'lit-element/lit-element.js';
5
3
  import { ButtonMixin } from '../button/button-mixin.js';
6
4
  import { ifDefined } from 'lit-html/directives/if-defined.js';
7
5
  import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
8
- import { RtlMixin } from '../../mixins/rtl-mixin.js';
9
6
  import { SelectionActionMixin } from './selection-action-mixin.js';
10
7
  import { SelectionInfo } from './selection-mixin.js';
11
8
 
12
9
  /**
13
- * An action associated with a selection component.
10
+ * A button action associated with a selection component.
14
11
  * @fires d2l-selection-action-click - Dispatched when the user clicks the action button. The `SelectionInfo` is provided as the event `detail`. If `requires-selection` was specified then the event will only be dispatched if items are selected.
15
12
  * @fires d2l-selection-observer-subscribe - Internal event
16
13
  */
17
- class Action extends LocalizeCoreElement(SelectionActionMixin(ButtonMixin(RtlMixin(LitElement)))) {
14
+ class Action extends LocalizeCoreElement(SelectionActionMixin(ButtonMixin(LitElement))) {
18
15
 
19
16
  static get properties() {
20
17
  return {
@@ -114,11 +114,11 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
114
114
  <!-- docs: start hidden content -->
115
115
  ### Properties
116
116
 
117
- | Property | Type | Description |
118
- |---|---|---|
119
- | `no-column-border` | Boolean, default: `false` | Hides the column borders on "default" table type |
120
- | `sticky-headers` | Boolean, default: `false` | Whether to make the header row sticky |
121
- | `type` | String, default: `'default'` | Type of the table style. Can be one of `default`, `light`. |
117
+ | Property | Type | Description | Default Value |
118
+ |---|---|---|---|
119
+ | `no-column-border` | boolean | Hides the column borders on "default" table type | false |
120
+ | `sticky-headers` | boolean | Whether to make the header row sticky | false |
121
+ | `type` | string | Type of the table style. Can be one of `default`, `light`. | 'default' |
122
122
 
123
123
  ## Light Type
124
124
 
@@ -241,10 +241,10 @@ When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used t
241
241
 
242
242
  ### Properties
243
243
 
244
- | Property | Type | Description |
245
- |---|---|---|
246
- | `desc` | Boolean, default: `false` | Whether sort direction is descending |
247
- | `nosort` | Booealn, default: `false` | Column is not currently sorted. Hides the ascending/descending sort icon. |
244
+ | Property | Type | Description | Default Value |
245
+ |---|---|---|---|
246
+ | `desc` | boolean | Whether sort direction is descending | false |
247
+ | `nosort` | boolean | Column is not currently sorted. Hides the ascending/descending sort icon. | false |
248
248
 
249
249
  ## Selection
250
250
 
@@ -6673,6 +6673,12 @@
6673
6673
  "path": "./components/list/list-header.js",
6674
6674
  "description": "A header for list components containing select-all, etc.",
6675
6675
  "attributes": [
6676
+ {
6677
+ "name": "no-selection",
6678
+ "description": "Whether to render select-all and selection summary",
6679
+ "type": "boolean",
6680
+ "default": "false"
6681
+ },
6676
6682
  {
6677
6683
  "name": "padding-type",
6678
6684
  "description": "How much padding to render list items with",
@@ -6688,7 +6694,9 @@
6688
6694
  ],
6689
6695
  "properties": [
6690
6696
  {
6691
- "name": "slim",
6697
+ "name": "noSelection",
6698
+ "attribute": "no-selection",
6699
+ "description": "Whether to render select-all and selection summary",
6692
6700
  "type": "boolean",
6693
6701
  "default": "false"
6694
6702
  },
@@ -6705,6 +6713,11 @@
6705
6713
  "description": "Whether all pages can be selected",
6706
6714
  "type": "boolean",
6707
6715
  "default": "false"
6716
+ },
6717
+ {
6718
+ "name": "slim",
6719
+ "type": "boolean",
6720
+ "default": "false"
6708
6721
  }
6709
6722
  ],
6710
6723
  "slots": [
@@ -8445,6 +8458,110 @@
8445
8458
  }
8446
8459
  ]
8447
8460
  },
8461
+ {
8462
+ "name": "d2l-selection-action-dropdown",
8463
+ "path": "./components/selection/selection-action-dropdown.js",
8464
+ "description": "A dropdown opener associated with a selection component.",
8465
+ "attributes": [
8466
+ {
8467
+ "name": "text",
8468
+ "description": "REQUIRED: Text for the dropdown opener button",
8469
+ "type": "string"
8470
+ },
8471
+ {
8472
+ "name": "requires-selection",
8473
+ "description": "Whether the action requires one or more selected items",
8474
+ "type": "boolean",
8475
+ "default": "false"
8476
+ },
8477
+ {
8478
+ "name": "selection-for",
8479
+ "description": "Id of the `SelectionMixin` component this component wants to observe (if not located within that component)",
8480
+ "type": "string"
8481
+ },
8482
+ {
8483
+ "name": "no-auto-open",
8484
+ "description": "Prevents the dropdown from opening automatically on or on key press",
8485
+ "type": "boolean",
8486
+ "default": "false"
8487
+ },
8488
+ {
8489
+ "name": "open-on-hover",
8490
+ "description": "Optionally open dropdown on click or hover action",
8491
+ "type": "boolean",
8492
+ "default": "false"
8493
+ },
8494
+ {
8495
+ "name": "disabled",
8496
+ "description": "Disables the dropdown opener",
8497
+ "type": "boolean",
8498
+ "default": "false"
8499
+ }
8500
+ ],
8501
+ "properties": [
8502
+ {
8503
+ "name": "text",
8504
+ "attribute": "text",
8505
+ "description": "REQUIRED: Text for the dropdown opener button",
8506
+ "type": "string"
8507
+ },
8508
+ {
8509
+ "name": "requiresSelection",
8510
+ "attribute": "requires-selection",
8511
+ "description": "Whether the action requires one or more selected items",
8512
+ "type": "boolean",
8513
+ "default": "false"
8514
+ },
8515
+ {
8516
+ "name": "selectionFor",
8517
+ "attribute": "selection-for",
8518
+ "description": "Id of the `SelectionMixin` component this component wants to observe (if not located within that component)",
8519
+ "type": "string"
8520
+ },
8521
+ {
8522
+ "name": "selectionInfo",
8523
+ "type": "SelectionInfo"
8524
+ },
8525
+ {
8526
+ "name": "dropdownOpener",
8527
+ "type": "boolean",
8528
+ "default": "true"
8529
+ },
8530
+ {
8531
+ "name": "noAutoOpen",
8532
+ "attribute": "no-auto-open",
8533
+ "description": "Prevents the dropdown from opening automatically on or on key press",
8534
+ "type": "boolean",
8535
+ "default": "false"
8536
+ },
8537
+ {
8538
+ "name": "openOnHover",
8539
+ "attribute": "open-on-hover",
8540
+ "description": "Optionally open dropdown on click or hover action",
8541
+ "type": "boolean",
8542
+ "default": "false"
8543
+ },
8544
+ {
8545
+ "name": "disabled",
8546
+ "attribute": "disabled",
8547
+ "description": "Disables the dropdown opener",
8548
+ "type": "boolean",
8549
+ "default": "false"
8550
+ }
8551
+ ],
8552
+ "events": [
8553
+ {
8554
+ "name": "d2l-selection-observer-subscribe",
8555
+ "description": "Internal event"
8556
+ }
8557
+ ],
8558
+ "slots": [
8559
+ {
8560
+ "name": "",
8561
+ "description": "Dropdown content (e.g., \"d2l-dropdown-content\", \"d2l-dropdown-menu\" or \"d2l-dropdown-tabs\")"
8562
+ }
8563
+ ]
8564
+ },
8448
8565
  {
8449
8566
  "name": "d2l-selection-action-menu-item",
8450
8567
  "path": "./components/selection/selection-action-menu-item.js",
@@ -8544,7 +8661,7 @@
8544
8661
  {
8545
8662
  "name": "d2l-selection-action",
8546
8663
  "path": "./components/selection/selection-action.js",
8547
- "description": "An action associated with a selection component.",
8664
+ "description": "A button action associated with a selection component.",
8548
8665
  "attributes": [
8549
8666
  {
8550
8667
  "name": "icon",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.230.4",
3
+ "version": "1.232.0",
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",
@@ -44,7 +44,7 @@
44
44
  "license": "Apache-2.0",
45
45
  "devDependencies": {
46
46
  "@babel/eslint-parser": "^7",
47
- "@brightspace-ui/stylelint-config": "^0.3",
47
+ "@brightspace-ui/stylelint-config": "^0.4",
48
48
  "@open-wc/testing": "^2",
49
49
  "@web/dev-server": "^0.1",
50
50
  "@web/test-runner": "^0.13",