@brightspace-ui/core 2.80.10 → 2.81.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.
Files changed (41) hide show
  1. package/components/inputs/input-text.js +11 -6
  2. package/components/list/README.md +14 -14
  3. package/components/list/demo/demo-list-nested-lazy-load.js +5 -5
  4. package/components/list/demo/demo-list-nested.js +8 -8
  5. package/components/list/demo/demo-list.js +3 -3
  6. package/components/list/demo/list-expand-collapse.html +3 -3
  7. package/components/list/demo/list-item-actions.html +16 -16
  8. package/components/list/demo/list-item-scroll.html +2 -2
  9. package/components/list/demo/list-nested.html +5 -5
  10. package/components/list/list-controls.js +54 -0
  11. package/components/list/list-header.js +2 -51
  12. package/components/list/list.js +2 -1
  13. package/components/selection/README.md +12 -12
  14. package/components/selection/demo/selection.html +12 -17
  15. package/components/selection/selection-action-menu-item.js +1 -1
  16. package/components/selection/{selection-header.js → selection-controls.js} +21 -21
  17. package/components/table/README.md +10 -10
  18. package/components/table/demo/table-test.js +3 -3
  19. package/components/table/{table-header.js → table-controls.js} +4 -4
  20. package/components/table/table-wrapper.js +2 -2
  21. package/custom-elements.json +101 -25
  22. package/lang/ar.js +2 -2
  23. package/lang/cy.js +2 -2
  24. package/lang/da.js +2 -2
  25. package/lang/de.js +2 -2
  26. package/lang/en.js +2 -2
  27. package/lang/es-es.js +2 -2
  28. package/lang/es.js +2 -2
  29. package/lang/fr-fr.js +2 -2
  30. package/lang/fr.js +2 -2
  31. package/lang/hi.js +2 -2
  32. package/lang/ja.js +2 -2
  33. package/lang/ko.js +2 -2
  34. package/lang/nl.js +2 -2
  35. package/lang/pt.js +2 -2
  36. package/lang/sv.js +2 -2
  37. package/lang/tr.js +2 -2
  38. package/lang/zh-cn.js +2 -2
  39. package/lang/zh-tw.js +2 -2
  40. package/package.json +1 -1
  41. package/templates/primary-secondary/demo/integration.html +7 -7
@@ -1,6 +1,6 @@
1
1
  import '../colors/colors.js';
2
2
  import '../tooltip/tooltip.js';
3
- import { css, html, LitElement } from 'lit';
3
+ import { css, html, LitElement, nothing } from 'lit';
4
4
  import { classMap } from 'lit/directives/class-map.js';
5
5
  import { FocusMixin } from '../../mixins/focus-mixin.js';
6
6
  import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
@@ -460,18 +460,23 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
460
460
  <div class="d2l-input-inside-before" @keypress="${this._suppressEvent}">${this.dir === 'rtl' ? unit : ''}<slot name="${firstSlotName}" @slotchange="${this._handleSlotChange}"></slot></div>
461
461
  <div class="d2l-input-inside-after" @keypress="${this._suppressEvent}">${this.dir !== 'rtl' ? unit : ''}<slot name="${lastSlotName}" @slotchange="${this._handleSlotChange}"></slot></div>
462
462
  ${ (!isValid && !this.hideInvalidIcon && !this._focused) ? html`<div class="d2l-input-text-invalid-icon" style="${styleMap(invalidIconStyles)}" @click="${this._handleInvalidIconClick}"></div>` : null}
463
- ${ this.validationError ? html`<d2l-tooltip for=${this._inputId} state="error" align="start">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>` : null }
464
463
  </div><div id="after-slot" class="d2l-skeletize" ?hidden="${!this._hasAfterContent}"><slot name="after" @slotchange="${this._handleAfterSlotChange}"></slot></div>
465
464
  </div>
466
465
  ${offscreenContainer}
467
466
  `;
467
+
468
+ let label = nothing;
468
469
  if (this.label && !this.labelHidden && !this.labelledBy) {
469
470
  const unitLabel = this._getUnitLabel();
470
- return html`
471
- <label class="d2l-input-label d2l-skeletize" for="${this._inputId}">${this.label}${unitLabel ? html`<span class="d2l-offscreen">${unitLabel}</span>` : ''}</label>
472
- ${input}`;
471
+ label = html`<label class="d2l-input-label d2l-skeletize" for="${this._inputId}">${this.label}${unitLabel ? html`<span class="d2l-offscreen">${unitLabel}</span>` : ''}</label>`;
472
+ }
473
+
474
+ let tooltip = nothing;
475
+ if (this.validationError && !this.skeleton) {
476
+ tooltip = html`<d2l-tooltip state="error" align="start">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>`;
473
477
  }
474
- return input;
478
+
479
+ return html`${tooltip}${label}${input}`;
475
480
  }
476
481
 
477
482
  updated(changedProperties) {
@@ -156,7 +156,7 @@ The `d2l-list` is the container to create a styled list of items using `d2l-list
156
156
 
157
157
  ## Selection Lists
158
158
 
159
- The `d2l-list` supports selectable items within a list, including both single and multi selection. Selection is enabled when `d2l-list-item`s have the `selectable` attribute. When items are selectable, multiple selection is the default behaviour, however the `selection-single` attribute can be applied to the `d2l-list` to enable single selection. A `d2l-list-header` component can be added to `d2l-list`'s `header` slot to provide select-all and bulk actions.
159
+ The `d2l-list` supports selectable items within a list, including both single and multi selection. Selection is enabled when `d2l-list-item`s have the `selectable` attribute. When items are selectable, multiple selection is the default behaviour, however the `selection-single` attribute can be applied to the `d2l-list` to enable single selection. A `d2l-list-controls` component can be added to `d2l-list`'s `controls` slot to provide select-all and bulk actions.
160
160
 
161
161
  ### Accessibility Properties
162
162
 
@@ -168,16 +168,16 @@ If a `d2l-list-item` is selectable then it should have a `label` attribute that
168
168
  ```html
169
169
  <script type="module">
170
170
  import '@brightspace-ui/core/components/list/list.js';
171
- import '@brightspace-ui/core/components/list/list-header.js';
171
+ import '@brightspace-ui/core/components/list/list-controls.js';
172
172
  import '@brightspace-ui/core/components/list/list-item.js';
173
173
  import '@brightspace-ui/core/components/list/list-item-content.js';
174
174
  import '@brightspace-ui/core/components/selection/selection-action.js';
175
175
  </script>
176
176
 
177
177
  <d2l-list style="width: 100%">
178
- <d2l-list-header slot="header">
178
+ <d2l-list-controls slot="controls">
179
179
  <d2l-selection-action icon="tier1:delete" text="Delete" requires-selection></d2l-selection-action>
180
- </d2l-list-header>
180
+ </d2l-list-controls>
181
181
  <d2l-list-item selectable key="eth" label="Earth Sciences">
182
182
  <d2l-list-item-content>
183
183
  <div>Earth Sciences</div>
@@ -207,16 +207,16 @@ If a `d2l-list-item` is expandable then it should have a `label` attribute that
207
207
  ```html
208
208
  <script type="module">
209
209
  import '@brightspace-ui/core/components/list/list.js';
210
- import '@brightspace-ui/core/components/list/list-header.js';
210
+ import '@brightspace-ui/core/components/list/list-controls.js';
211
211
  import '@brightspace-ui/core/components/list/list-item.js';
212
212
  import '@brightspace-ui/core/components/list/list-item-content.js';
213
213
  import '@brightspace-ui/core/components/selection/selection-action.js';
214
214
  </script>
215
215
 
216
216
  <d2l-list grid style="width: 100%">
217
- <d2l-list-header slot="header">
217
+ <d2l-list-controls slot="controls">
218
218
  <d2l-selection-action icon="tier1:delete" text="Delete" requires-selection></d2l-selection-action>
219
- </d2l-list-header>
219
+ </d2l-list-controls>
220
220
  <d2l-list-item selectable expandable key="expand-1" label="Expandable item #1">
221
221
  <d2l-list-item-content>
222
222
  <div>Expandable item #1</div>
@@ -325,25 +325,25 @@ If an item is draggable, the `drag-handle-text` attribute should be used to prov
325
325
  <d2l-my-drag-drop-elem style="width: 100%;"></d2l-my-drag-drop-elem>
326
326
  ```
327
327
 
328
- ## List Header [d2l-list-header]
328
+ ## List Controls [d2l-list-controls]
329
329
 
330
- The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot to provide a select-all checkbox, summary, a slot for `d2l-selection-action`s, and overflow-group behaviour.
330
+ The `d2l-list-controls` component can be placed in the `d2l-list`'s `controls` slot to provide a select-all checkbox, summary, a slot for `d2l-selection-action`s, and overflow-group behaviour.
331
331
 
332
- <!-- docs: demo live name:d2l-list-header autoSize:false size:medium -->
332
+ <!-- docs: demo live name:d2l-list-controls autoSize:false size:medium -->
333
333
  ```html
334
334
  <script type="module">
335
335
  import '@brightspace-ui/core/components/list/list.js';
336
- import '@brightspace-ui/core/components/list/list-header.js';
336
+ import '@brightspace-ui/core/components/list/list-controls.js';
337
337
  import '@brightspace-ui/core/components/list/list-item.js';
338
338
  import '@brightspace-ui/core/components/list/list-item-content.js';
339
339
  import '@brightspace-ui/core/components/selection/selection-action.js';
340
340
  </script>
341
341
 
342
342
  <d2l-list style="width: 100%">
343
- <d2l-list-header slot="header">
343
+ <d2l-list-controls slot="controls">
344
344
  <d2l-selection-action icon="tier1:delete" text="Delete" requires-selection></d2l-selection-action>
345
345
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
346
- </d2l-list-header>
346
+ </d2l-list-controls>
347
347
  <d2l-list-item selectable key="eth" label="Earth Sciences">
348
348
  <d2l-list-item-content>
349
349
  <div>Earth Sciences</div>
@@ -365,7 +365,7 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
365
365
  | Property | Type | Description |
366
366
  |---|---|---|
367
367
  | `no-selection` | Boolean | Whether to render select-all and selection summary |
368
- | `no-sticky` | Boolean | Disables sticky positioning for the header |
368
+ | `no-sticky` | Boolean | Disables sticky positioning for the controls |
369
369
  | `select-all-pages-allowed` | Boolean | Whether all pages can be selected |
370
370
  <!-- docs: end hidden content -->
371
371
 
@@ -1,7 +1,7 @@
1
1
  import '../list-item-content.js';
2
2
  import '../list-item.js';
3
3
  import '../list.js';
4
- import '../list-header.js';
4
+ import '../list-controls.js';
5
5
  import '../../selection/selection-action.js';
6
6
  import { html, LitElement, nothing } from 'lit';
7
7
  import { getUniqueId } from '../../../helpers/uniqueId.js';
@@ -87,7 +87,7 @@ class ListDemoNestedLazyLoad extends LitElement {
87
87
  _renderList(items, nested, includeHeader = false) {
88
88
  return html`
89
89
  <d2l-list grid drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}">
90
- ${ includeHeader ? this._renderListHeader() : nothing }
90
+ ${ includeHeader ? this._renderListControls() : nothing }
91
91
  ${repeat(items, item => item.key, item => html`
92
92
  ${this._renderListItem(item)}
93
93
  `)}
@@ -95,12 +95,12 @@ class ListDemoNestedLazyLoad extends LitElement {
95
95
  `;
96
96
  }
97
97
 
98
- _renderListHeader() {
98
+ _renderListControls() {
99
99
  return html`
100
- <d2l-list-header slot="header">
100
+ <d2l-list-controls slot="controls">
101
101
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
102
102
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
103
- </d2l-list-header>
103
+ </d2l-list-controls>
104
104
  `;
105
105
  }
106
106
 
@@ -7,7 +7,7 @@ import '../../dropdown/dropdown-more.js';
7
7
  import '../../menu/menu.js';
8
8
  import '../../menu/menu-item.js';
9
9
  import '../../paging/pager-load-more.js';
10
- import '../list-header.js';
10
+ import '../list-controls.js';
11
11
  import '../../selection/selection-action.js';
12
12
  import { css, html, LitElement, nothing } from 'lit';
13
13
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -25,7 +25,7 @@ class ListDemoNested extends LitElement {
25
25
  disableExpandFeature: { type: Boolean, attribute: 'disable-expand-feature' },
26
26
  expanded: { type: Boolean },
27
27
  includeSecondaryActions: { type: Boolean, attribute: 'include-secondary-actions' },
28
- includeListHeader: { type: Boolean, attribute: 'include-list-header' },
28
+ includeListControls: { type: Boolean, attribute: 'include-list-controls' },
29
29
  includeActionHref: { type: Boolean, attribute: 'include-action-href' },
30
30
  useButtonListItem: { type: Boolean, attribute: 'use-button-item' },
31
31
  showLoadMore: { type: Boolean, attribute: 'show-load-more' },
@@ -60,7 +60,7 @@ class ListDemoNested extends LitElement {
60
60
  render() {
61
61
  return html`
62
62
  <div @d2l-list-items-move="${this._handleListItemsMove}">
63
- ${this._renderList(this._loadedItems, false, this.includeListHeader, this.showLoadMore)}
63
+ ${this._renderList(this._loadedItems, false, this.includeListControls, this.showLoadMore)}
64
64
  </div>
65
65
  `;
66
66
  }
@@ -167,10 +167,10 @@ class ListDemoNested extends LitElement {
167
167
  </d2l-list-item-content>`;
168
168
  }
169
169
 
170
- _renderList(items, nested, includeHeader = false, showLoadMore = false) {
170
+ _renderList(items, nested, includeControls = false, showLoadMore = false) {
171
171
  return html`
172
172
  <d2l-list ?grid="${!this.disableListGrid}" drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}">
173
- ${ includeHeader ? this._renderListHeader() : nothing }
173
+ ${ includeControls ? this._renderListControls() : nothing }
174
174
  ${repeat(items, item => item.key, item => html`
175
175
  ${this._renderListItem(item)}
176
176
  ${this._renderListItemButton(item)}
@@ -180,12 +180,12 @@ class ListDemoNested extends LitElement {
180
180
  `;
181
181
  }
182
182
 
183
- _renderListHeader() {
183
+ _renderListControls() {
184
184
  return html`
185
- <d2l-list-header slot="header">
185
+ <d2l-list-controls slot="controls">
186
186
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
187
187
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
188
- </d2l-list-header>
188
+ </d2l-list-controls>
189
189
  `;
190
190
  }
191
191
 
@@ -10,7 +10,7 @@ import '../../selection/selection-action.js';
10
10
  import '../../selection/selection-action-dropdown.js';
11
11
  import '../../selection/selection-action-menu-item.js';
12
12
  import '../../tooltip/tooltip.js';
13
- import '../list-header.js';
13
+ import '../list-controls.js';
14
14
  import '../list-item-content.js';
15
15
  import '../list-item.js';
16
16
  import '../list.js';
@@ -148,7 +148,7 @@ class DemoList extends LitElement {
148
148
  const remainingItemCount = this.items.length - loadedItems.length;
149
149
  return html`
150
150
  <d2l-list ?grid="${this.grid}" item-count="${this.items.length}">
151
- <d2l-list-header slot="header" select-all-pages-allowed>
151
+ <d2l-list-controls slot="controls" select-all-pages-allowed>
152
152
  <d2l-selection-action icon="tier1:plus-default" text="Add" @d2l-selection-action-click="${this._handleAddItem}"></d2l-selection-action>
153
153
  <d2l-selection-action-dropdown text="Move To" requires-selection>
154
154
  <d2l-dropdown-menu>
@@ -173,7 +173,7 @@ class DemoList extends LitElement {
173
173
  </d2l-dropdown-menu>
174
174
  </d2l-dropdown-button-subtle>
175
175
  <d2l-selection-action icon="tier1:gear" text="Settings" requires-selection></d2l-selection-action>
176
- </d2l-list-header>
176
+ </d2l-list-controls>
177
177
  ${repeat(loadedItems, item => item.key, item => {
178
178
  const tooltipButtonId = getUniqueId();
179
179
  return html`
@@ -24,7 +24,7 @@
24
24
  expanded
25
25
  include-action-href
26
26
  include-secondary-actions
27
- include-list-header></d2l-demo-list-nested>
27
+ include-list-controls></d2l-demo-list-nested>
28
28
  </template>
29
29
  </d2l-demo-snippet>
30
30
 
@@ -50,7 +50,7 @@
50
50
  expandable
51
51
  expanded
52
52
  include-secondary-actions
53
- include-list-header
53
+ include-list-controls
54
54
  disable-list-grid></d2l-demo-list-nested>
55
55
  </template>
56
56
  </d2l-demo-snippet>
@@ -85,7 +85,7 @@
85
85
  selectable
86
86
  expandable
87
87
  include-secondary-actions
88
- include-list-header
88
+ include-list-controls
89
89
  use-button-item></d2l-demo-list-nested>
90
90
  </template>
91
91
  </d2l-demo-snippet>
@@ -13,7 +13,7 @@
13
13
  import '../../menu/menu-item.js';
14
14
  import '../../selection/selection-action.js';
15
15
  import '../../tooltip/tooltip.js';
16
- import '../list-header.js';
16
+ import '../list-controls.js';
17
17
  import '../list-item-button.js';
18
18
  import '../list-item-content.js';
19
19
  import '../list-item.js';
@@ -149,10 +149,10 @@
149
149
  <d2l-demo-snippet>
150
150
  <template>
151
151
  <d2l-list>
152
- <d2l-list-header slot="header">
152
+ <d2l-list-controls slot="controls">
153
153
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
154
154
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
155
- </d2l-list-header>
155
+ </d2l-list-controls>
156
156
  <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
157
157
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
158
158
  </d2l-list-item>
@@ -171,10 +171,10 @@
171
171
  <d2l-demo-snippet>
172
172
  <template>
173
173
  <d2l-list selection-single>
174
- <d2l-list-header slot="header">
174
+ <d2l-list-controls slot="controls">
175
175
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
176
176
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
177
- </d2l-list-header>
177
+ </d2l-list-controls>
178
178
  <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
179
179
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
180
180
  </d2l-list-item>
@@ -193,13 +193,13 @@
193
193
  <d2l-demo-snippet>
194
194
  <template>
195
195
  <d2l-list>
196
- <d2l-list-header slot="header">
196
+ <d2l-list-controls slot="controls">
197
197
  <d2l-selection-action icon="tier1:tag-hollow" text="Tag" requires-selection></d2l-selection-action>
198
198
  <d2l-selection-action icon="tier1:share" text="Share" requires-selection></d2l-selection-action>
199
199
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
200
200
  <d2l-selection-action icon="tier1:delete" text="Delete" requires-selection></d2l-selection-action>
201
201
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
202
- </d2l-list-header>
202
+ </d2l-list-controls>
203
203
  <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
204
204
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
205
205
  </d2l-list-item>
@@ -218,7 +218,7 @@
218
218
  <d2l-demo-snippet>
219
219
  <template>
220
220
  <d2l-list>
221
- <d2l-list-header slot="header"></d2l-list-header>
221
+ <d2l-list-controls slot="controls"></d2l-list-controls>
222
222
  <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
223
223
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
224
224
  </d2l-list-item>
@@ -237,10 +237,10 @@
237
237
  <d2l-demo-snippet id="selection-link-demo">
238
238
  <template>
239
239
  <d2l-list>
240
- <d2l-list-header slot="header">
240
+ <d2l-list-controls slot="controls">
241
241
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
242
242
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
243
- </d2l-list-header>
243
+ </d2l-list-controls>
244
244
  <d2l-list-item href="http://www.d2l.com" selectable key="1" label="Introductory Earth Sciences">
245
245
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
246
246
  </d2l-list-item>
@@ -264,10 +264,10 @@
264
264
  <d2l-demo-snippet id="selection-button-demo">
265
265
  <template>
266
266
  <d2l-list>
267
- <d2l-list-header slot="header">
267
+ <d2l-list-controls slot="controls">
268
268
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
269
269
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
270
- </d2l-list-header>
270
+ </d2l-list-controls>
271
271
  <d2l-list-item-button selectable key="1" label="Introductory Earth Sciences">
272
272
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
273
273
  </d2l-list-item-button>
@@ -291,10 +291,10 @@
291
291
  <d2l-demo-snippet id="grid-link-demo">
292
292
  <template>
293
293
  <d2l-list grid>
294
- <d2l-list-header slot="header">
294
+ <d2l-list-controls slot="controls">
295
295
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
296
296
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
297
- </d2l-list-header>
297
+ </d2l-list-controls>
298
298
  <d2l-list-item href="http://www.d2l.com" selectable key="1" label="Introductory Earth Sciences">
299
299
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
300
300
  <div slot="actions">
@@ -327,10 +327,10 @@
327
327
  <d2l-demo-snippet id="grid-button-demo">
328
328
  <template>
329
329
  <d2l-list grid>
330
- <d2l-list-header slot="header">
330
+ <d2l-list-controls slot="controls">
331
331
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
332
332
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
333
- </d2l-list-header>
333
+ </d2l-list-controls>
334
334
  <d2l-list-item-button selectable key="1" label="Introductory Earth Sciences">
335
335
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
336
336
  <div slot="actions">
@@ -18,7 +18,7 @@
18
18
  </script>
19
19
  <style>
20
20
  html {
21
- --d2l-list-header-background-color: #f1f5fb;
21
+ --d2l-list-controls-background-color: #f1f5fb;
22
22
  }
23
23
  .container {
24
24
  height: 400px;
@@ -80,7 +80,7 @@
80
80
  Use <code>alignToTop=false</code> to avoid the issue.
81
81
  </p>
82
82
  </div>
83
-
83
+
84
84
  <d2l-list>
85
85
  <d2l-list-item selectable key="1" label="Introductory Earth Sciences">
86
86
  <d2l-list-item-content>Introductory Earth Sciences</d2l-list-item-content>
@@ -14,7 +14,7 @@
14
14
  import '../list-item-content.js';
15
15
  import './list-item-custom.js';
16
16
  import '../list-item.js';
17
- import '../list-header.js';
17
+ import '../list-controls.js';
18
18
  import '../list.js';
19
19
  import '../../menu/menu.js';
20
20
  import '../../menu/menu-item.js';
@@ -31,10 +31,10 @@
31
31
  <d2l-demo-snippet>
32
32
  <template>
33
33
  <d2l-list grid>
34
- <d2l-list-header slot="header">
34
+ <d2l-list-controls slot="controls">
35
35
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
36
36
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
37
- </d2l-list-header>
37
+ </d2l-list-controls>
38
38
  <d2l-list-item selectable key="L1-1" label="Label for L1-1">
39
39
  <d2l-list-item-content>
40
40
  <div>Earth Sciences (L1)</div>
@@ -123,10 +123,10 @@
123
123
  <d2l-demo-snippet>
124
124
  <template>
125
125
  <d2l-list grid>
126
- <d2l-list-header slot="header">
126
+ <d2l-list-controls slot="controls">
127
127
  <d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
128
128
  <d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
129
- </d2l-list-header>
129
+ </d2l-list-controls>
130
130
  <d2l-demo-list-item-custom key="L1-1"></d2l-demo-list-item-custom>
131
131
  <d2l-demo-list-item-custom key="L1-2"></d2l-demo-list-item-custom>
132
132
  <d2l-demo-list-item-custom key="L1-3"></d2l-demo-list-item-custom>
@@ -0,0 +1,54 @@
1
+ import { css } from 'lit';
2
+ import { findComposedAncestor } from '../../helpers/dom.js';
3
+ import { SelectionControls } from '../selection/selection-controls.js';
4
+
5
+ /**
6
+ * Controls for list components containing select-all, etc.
7
+ */
8
+ export class ListControls extends SelectionControls {
9
+ static get properties() {
10
+ return {
11
+ _extendSeparator: { state: true }
12
+ };
13
+ }
14
+
15
+ static get styles() {
16
+ return [super.styles, css`
17
+ :host {
18
+ --d2l-selection-controls-background-color: var(--d2l-list-controls-background-color, var(--d2l-list-header-background-color));
19
+ z-index: 6; /* must be greater than d2l-list-item-active-border */
20
+ }
21
+ :host([no-sticky]) {
22
+ z-index: auto;
23
+ }
24
+ .d2l-list-controls-extend-separator {
25
+ padding: 0 0.9rem;
26
+ }
27
+ `];
28
+ }
29
+
30
+ constructor() {
31
+ super();
32
+ this._extendSeparator = false;
33
+ }
34
+
35
+ connectedCallback() {
36
+ super.connectedCallback();
37
+
38
+ const parent = findComposedAncestor(this.parentNode, node => node && node.tagName === 'D2L-LIST');
39
+ if (parent) this._extendSeparator = parent.hasAttribute('extend-separators');
40
+ }
41
+
42
+ _getSelectionControlsContainerClasses() {
43
+ return {
44
+ ...super._getSelectionControlsContainerClasses(),
45
+ 'd2l-list-controls-extend-separator': this._extendSeparator
46
+ };
47
+ }
48
+
49
+ _getSelectionControlsLabel() {
50
+ return this.localize('components.list-controls.label');
51
+ }
52
+ }
53
+
54
+ customElements.define('d2l-list-controls', ListControls);
@@ -1,54 +1,5 @@
1
- import { css } from 'lit';
2
- import { findComposedAncestor } from '../../helpers/dom.js';
3
- import { SelectionHeader } from '../selection/selection-header.js';
1
+ import { ListControls } from './list-controls.js';
4
2
 
5
- /**
6
- * A header for list components containing select-all, etc.
7
- */
8
- class ListHeader extends SelectionHeader {
9
- static get properties() {
10
- return {
11
- _extendSeparator: { state: true }
12
- };
13
- }
14
-
15
- static get styles() {
16
- return [super.styles, css`
17
- :host {
18
- --d2l-selection-header-background-color: var(--d2l-list-header-background-color);
19
- z-index: 6; /* must be greater than d2l-list-item-active-border */
20
- }
21
- :host([no-sticky]) {
22
- z-index: auto;
23
- }
24
- .d2l-list-header-extend-separator {
25
- padding: 0 0.9rem;
26
- }
27
- `];
28
- }
29
-
30
- constructor() {
31
- super();
32
- this._extendSeparator = false;
33
- }
34
-
35
- connectedCallback() {
36
- super.connectedCallback();
37
-
38
- const parent = findComposedAncestor(this.parentNode, node => node && node.tagName === 'D2L-LIST');
39
- if (parent) this._extendSeparator = parent.hasAttribute('extend-separators');
40
- }
41
-
42
- _getSelectionHeaderContainerClasses() {
43
- return {
44
- ...super._getSelectionHeaderContainerClasses(),
45
- 'd2l-list-header-extend-separator': this._extendSeparator
46
- };
47
- }
48
-
49
- _getSelectionHeaderLabel() {
50
- return this.localize('components.list-header.label');
51
- }
52
- }
3
+ class ListHeader extends ListControls {}
53
4
 
54
5
  customElements.define('d2l-list-header', ListHeader);
@@ -13,7 +13,7 @@ export const listSelectionStates = SelectionInfo.states;
13
13
  /**
14
14
  * A container for a styled list of items ("d2l-list-item"). It provides the appropriate "list" semantics as well as options for displaying separators, etc.
15
15
  * @slot - Slot for list items (ex. `d2l-list-item`, `d2l-list-item-button`, or custom items)
16
- * @slot header - Slot for `d2l-list-header` to be rendered above the list
16
+ * @slot controls - Slot for `d2l-list-controls` to be rendered above the list
17
17
  * @slot pager - Slot for `d2l-pager-load-more` to be rendered below the list
18
18
  * @fires d2l-list-items-move - Dispatched when one or more items are moved. See [Event Details: d2l-list-items-move](#event-details%3A-%40d2l-list-items-move).
19
19
  */
@@ -121,6 +121,7 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
121
121
  render() {
122
122
  const role = !this.grid ? 'list' : 'application';
123
123
  return html`
124
+ <slot name="controls"></slot>
124
125
  <slot name="header"></slot>
125
126
  <div role="${role}">
126
127
  <slot @keydown="${this._handleKeyDown}" @slotchange="${this._handleSlotChange}"></slot>
@@ -36,7 +36,7 @@ The `SelectionMixin` defines the `selection-single` attribute that consumers can
36
36
  </script>
37
37
  <script type="module">
38
38
  import '@brightspace-ui/core/components/selection/selection-action.js';
39
- import '@brightspace-ui/core/components/selection/selection-header.js';
39
+ import '@brightspace-ui/core/components/selection/selection-controls.js';
40
40
  import '@brightspace-ui/core/components/selection/selection-input.js';
41
41
  import '@brightspace-ui/core/components/selection/selection-select-all.js';
42
42
  import '@brightspace-ui/core/components/selection/selection-summary.js';
@@ -64,10 +64,10 @@ The `SelectionMixin` defines the `selection-single` attribute that consumers can
64
64
  </style>
65
65
  <!-- docs: end hidden content -->
66
66
  <d2l-demo-selection>
67
- <d2l-selection-header>
67
+ <d2l-selection-controls>
68
68
  <d2l-selection-action text="Bookmark" icon="tier1:bookmark-hollow" requires-selection></d2l-selection-action>
69
69
  <d2l-selection-action text="Settings" icon="tier1:gear"></d2l-selection-action>
70
- </d2l-selection-header>
70
+ </d2l-selection-controls>
71
71
  <ul>
72
72
  <li><d2l-selection-input key="geo" label="Geography" selected></d2l-selection-input>Geography</li>
73
73
  <li><d2l-selection-input key="sci" label="Science"></d2l-selection-input>Science</li>
@@ -308,7 +308,7 @@ The `d2l-selection-select-all` component may be placed inside the selection cont
308
308
  margin-right: 15px;
309
309
  }
310
310
  #other-list {
311
- margin-left: 0;
311
+ margin-left: 0;
312
312
  }
313
313
  }
314
314
  </style>
@@ -429,17 +429,17 @@ The `d2l-selection-summary` component may be placed inside the selection control
429
429
  | `selection-for` | String | Id of the corresponding `SelectionMixin` component, if not placed within it. |
430
430
  <!-- docs: end hidden content -->
431
431
 
432
- ## Selection Header [d2l-selection-header]
432
+ ## Selection Controls [d2l-selection-controls]
433
433
 
434
- The `d2l-selection-header` provides a standardized wrapper to display selection information and actions. It includes a select-all checkbox, summary, a slot for `d2l-selection-action`s, and overflow-group behaviour.
434
+ The `d2l-selection-controls` provides a standardized wrapper to display selection information and actions. It includes a select-all checkbox, summary, a slot for `d2l-selection-action`s, and overflow-group behaviour.
435
435
 
436
- When using lists, use the list-specific `d2l-list-header` instead, which extends this component's behaviour.
436
+ When using lists, use the list-specific `d2l-list-controls` instead, which extends this component's behaviour.
437
437
 
438
- <!-- docs: demo live name:d2l-selection-header display:block -->
438
+ <!-- docs: demo live name:d2l-selection-controls display:block -->
439
439
  ```html
440
440
  <script type="module">
441
441
  import '@brightspace-ui/core/components/selection/selection-action.js';
442
- import '@brightspace-ui/core/components/selection/selection-header.js';
442
+ import '@brightspace-ui/core/components/selection/selection-controls.js';
443
443
  import '@brightspace-ui/core/components/selection/selection-input.js';
444
444
  import '@brightspace-ui/core/components/selection/demo/demo-selection.js';
445
445
  </script>
@@ -463,10 +463,10 @@ When using lists, use the list-specific `d2l-list-header` instead, which extends
463
463
  </style>
464
464
  <!-- docs: end hidden content -->
465
465
  <d2l-demo-selection>
466
- <d2l-selection-header>
466
+ <d2l-selection-controls>
467
467
  <d2l-selection-action text="Bookmark" icon="tier1:bookmark-hollow" requires-selection></d2l-selection-action>
468
468
  <d2l-selection-action text="Settings" icon="tier1:gear"></d2l-selection-action>
469
- </d2l-selection-header>
469
+ </d2l-selection-controls>
470
470
  <ul>
471
471
  <li><d2l-selection-input key="geo" label="Geography" selected></d2l-selection-input>Geography</li>
472
472
  <li><d2l-selection-input key="sci" label="Science"></d2l-selection-input>Science</li>
@@ -481,6 +481,6 @@ When using lists, use the list-specific `d2l-list-header` instead, which extends
481
481
  | Property | Type | Description |
482
482
  |---|---|---|
483
483
  | `no-selection` | Boolean | Whether to render select-all and selection summary |
484
- | `no-sticky` | Boolean | Disables sticky positioning for the header |
484
+ | `no-sticky` | Boolean | Disables sticky positioning for the controls |
485
485
  | `select-all-pages-allowed` | Boolean | Whether all pages can be selected |
486
486
  <!-- docs: end hidden content -->