@brightspace-ui/core 2.10.2 → 2.11.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.
@@ -52,6 +52,25 @@
52
52
  </d2l-tag-list>
53
53
  </d2l-demo-snippet>
54
54
 
55
+ <h2>Clearable Tag List</h2>
56
+ <d2l-demo-snippet fullscreen>
57
+ <d2l-tag-list description="A bunch of example tags" clearable>
58
+ <d2l-tag-list-item text="Example Tag"></d2l-tag-list-item>
59
+ <d2l-tag-list-item text="Longer Example Tag - much much much much much longer"></d2l-tag-list-item>
60
+ <d2l-tag-list-item text="Another Example Tag"></d2l-tag-list-item>
61
+ <d2l-tag-list-item-mixin-consumer name="Custom Tag List Item"></d2l-tag-list-item-mixin-consumer>
62
+ <d2l-tag-list-item text="Example Tag 5"></d2l-tag-list-item>
63
+ <d2l-tag-list-item text="Example Tag 6"></d2l-tag-list-item>
64
+ <d2l-tag-list-item text="Example Tag 7"></d2l-tag-list-item>
65
+ </d2l-tag-list>
66
+ <script>
67
+ document.addEventListener('d2l-tag-list-item-cleared', (e) => {
68
+ e.target.parentNode.removeChild(e.target);
69
+ console.log(`d2l-tag-list-item-cleared event dispatched. Value: ${e.detail.value}, handleFocus: ${e.detail.handleFocus}`);
70
+ });
71
+ </script>
72
+ </d2l-demo-snippet>
73
+
55
74
  </d2l-demo-page>
56
75
  </body>
57
76
  </html>
@@ -1,13 +1,23 @@
1
+ import '../button/button-icon.js';
1
2
  import '../colors/colors.js';
2
3
  import '../tooltip/tooltip.js';
3
4
  import { css, html } from 'lit';
5
+ import { announce } from '../../helpers/announce.js';
6
+ import { classMap } from 'lit/directives/class-map.js';
7
+ import { findComposedAncestor } from '../../helpers/dom.js';
4
8
  import { getUniqueId } from '../../helpers/uniqueId.js';
5
9
  import { labelStyles } from '../typography/styles.js';
10
+ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
11
+ import { RtlMixin } from '../../mixins/rtl-mixin.js';
6
12
 
7
- export const TagListItemMixin = superclass => class extends superclass {
13
+ export const TagListItemMixin = superclass => class extends LocalizeCoreElement(RtlMixin(superclass)) {
8
14
 
9
15
  static get properties() {
10
16
  return {
17
+ /**
18
+ * Enables the option to clear a tag list item. The `d2l-tag-list-item-cleared` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.
19
+ */
20
+ clearable: { type: Boolean },
11
21
  /**
12
22
  * @ignore
13
23
  */
@@ -26,27 +36,39 @@ export const TagListItemMixin = superclass => class extends superclass {
26
36
  display: none;
27
37
  }
28
38
  .tag-list-item-container {
39
+ align-items: center;
29
40
  background-color: var(--d2l-color-regolith);
30
41
  border-radius: 6px;
31
42
  box-shadow: inset 0 0 0 1px var(--d2l-color-gypsum), 0 2px 4px rgba(0, 0, 0, 0.03);
32
43
  box-sizing: border-box;
33
44
  color: var(--d2l-color-ferrite);
34
45
  cursor: pointer;
46
+ display: flex;
35
47
  max-width: 320px;
36
48
  min-width: 0;
37
49
  outline: none;
38
- overflow: hidden;
39
50
  padding: 0.25rem 0.6rem;
40
- text-overflow: ellipsis;
41
51
  transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
42
52
  white-space: nowrap;
43
53
  }
44
- .tag-list-item-container:focus,
45
- :host(:hover) .tag-list-item-container:focus {
54
+ .tag-list-item-container.tag-list-item-container-clearable {
55
+ padding-right: 0.25rem;
56
+ }
57
+ :host([dir="rtl"]) .tag-list-item-container.tag-list-item-container-clearable {
58
+ padding-left: 0.25rem;
59
+ padding-right: 0.6rem;
60
+ }
61
+ .tag-list-item-content {
62
+ outline: none;
63
+ overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ }
66
+ :host(:focus) .tag-list-item-container,
67
+ :host(:focus:hover) .tag-list-item-container {
46
68
  box-shadow: inset 0 0 0 2px var(--d2l-color-celestine), 0 2px 4px rgba(0, 0, 0, 0.03);
47
69
  }
48
70
  :host(:hover) .tag-list-item-container,
49
- .tag-list-item-container:focus {
71
+ :host(:focus) .tag-list-item-container {
50
72
  background-color: var(--d2l-color-sylvite);
51
73
  }
52
74
  :host(:hover) .tag-list-item-container {
@@ -58,11 +80,27 @@ export const TagListItemMixin = superclass => class extends superclass {
58
80
  transition: none;
59
81
  }
60
82
  }
83
+ .d2l-tag-list-item-clear-button {
84
+ padding-left: 3px;
85
+ }
86
+ :host([dir="rtl"]) .d2l-tag-list-item-clear-button {
87
+ padding-left: 0;
88
+ padding-right: 3px;
89
+ }
90
+ d2l-button-icon {
91
+ --d2l-button-icon-fill-color: var(--d2l-color-chromite);
92
+ --d2l-button-icon-min-height: 1.1rem;
93
+ --d2l-button-icon-min-width: 1.1rem;
94
+ }
95
+ d2l-button-icon:hover {
96
+ --d2l-button-icon-fill-color: var(--d2l-color-tungsten);
97
+ }
61
98
  `];
62
99
  }
63
100
 
64
101
  constructor() {
65
102
  super();
103
+ this.clearable = false;
66
104
  /** @ignore */
67
105
  this.role = 'listitem';
68
106
  this._id = getUniqueId();
@@ -71,24 +109,71 @@ export const TagListItemMixin = superclass => class extends superclass {
71
109
  firstUpdated(changedProperties) {
72
110
  super.firstUpdated(changedProperties);
73
111
 
74
- const container = this.shadowRoot.querySelector('.tag-list-item-container');
112
+ const container = this.shadowRoot.querySelector('.tag-list-item-content');
75
113
  this.addEventListener('focus', (e) => {
76
114
  // ignore focus events coming from inside the tag content
77
- if (e.composedPath()[0] === this) container.focus();
115
+ if (e.composedPath()[0] !== this) return;
116
+ const event = new FocusEvent('focus', { bubbles: true, cancelable: true });
117
+ container.dispatchEvent(event);
118
+ });
119
+ this.addEventListener('blur', () => {
120
+ const event = new FocusEvent('blur', { bubbles: true, cancelable: true });
121
+ container.dispatchEvent(event);
78
122
  });
79
- this.addEventListener('blur', () => container.blur());
123
+ this.addEventListener('keydown', this._handleKeydown);
124
+ }
125
+
126
+ handleClearItem(e, clearAll) {
127
+ if (!this.clearable) return;
128
+
129
+ let handleFocus = false;
130
+ if (e) {
131
+ const listItemParent = findComposedAncestor(e.composedPath()[0], (node) => node.role === 'listitem');
132
+ handleFocus = listItemParent ? true : false;
133
+ }
134
+
135
+ if (!clearAll) announce(this.localize('components.tag-list.cleared-item', { value: this.text }));
136
+
137
+ /** Dispatched when a user selects to delete a tag list item. The consumer must handle the actual element deletion and focus behaviour if there are no remaining list items. */
138
+ this.dispatchEvent(new CustomEvent(
139
+ 'd2l-tag-list-item-cleared',
140
+ { bubbles: true, composed: true, detail: { value: this.text, handleFocus } }
141
+ ));
142
+ }
143
+
144
+ _handleKeydown(e) {
145
+ const expectedKey = e.keyCode === 8 || e.keyCode === 46; // backspace or delete
146
+ if (!this.clearable || !expectedKey) return;
147
+ e.preventDefault();
148
+ this.handleClearItem(e);
80
149
  }
81
150
 
82
151
  _renderTag(tagContent, hasTruncationTooltip) {
152
+ const buttonText = typeof tagContent === 'object'
153
+ ? this.localize('components.tag-list.clear', { value: '' })
154
+ : this.localize('components.tag-list.clear', { value: tagContent });
83
155
  const tooltip = hasTruncationTooltip ? html`
84
- <d2l-tooltip for="${this._id}" show-truncated-only>
156
+ <d2l-tooltip for="${this._id}" offset="20" show-truncated-only>
85
157
  ${tagContent}
86
158
  </d2l-tooltip>
87
159
  ` : null;
160
+ const containerClasses = {
161
+ 'd2l-label-text': true,
162
+ 'tag-list-item-container': true,
163
+ 'tag-list-item-container-clearable': this.clearable
164
+ };
88
165
  return html`
89
166
  ${tooltip}
90
- <div class="tag-list-item-container d2l-label-text" id="${this._id}" tabindex="-1">
91
- ${tagContent}
167
+ <div class="${classMap(containerClasses)}">
168
+ <div class="tag-list-item-content" id="${this._id}" tabindex="-1">${tagContent}</div>
169
+ ${this.clearable ? html`
170
+ <d2l-button-icon
171
+ class="d2l-tag-list-item-clear-button"
172
+ @click="${this.handleClearItem}"
173
+ icon="tier1:close-small"
174
+ tabindex="-1"
175
+ text="${buttonText}">
176
+ </d2l-button-icon>` : null}
92
177
  </div>
93
178
  `;
94
179
  }
@@ -1,6 +1,8 @@
1
1
  import '../button/button-subtle.js';
2
2
  import { css, html, LitElement } from 'lit';
3
+ import { announce } from '../../helpers/announce.js';
3
4
  import { ArrowKeysMixin } from '../../mixins/arrow-keys-mixin.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
4
6
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
5
7
  import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
6
8
  import { styleMap } from 'lit/directives/style-map.js';
@@ -16,10 +18,23 @@ const PAGE_SIZE_LINES = {
16
18
  };
17
19
  const MARGIN_TOP_RIGHT = 6;
18
20
 
21
+ async function filterAsync(arr, callback) {
22
+ const fail = Symbol();
23
+ const results = await Promise.all(arr.map(async item => {
24
+ const callbackResult = await callback(item);
25
+ return callbackResult ? item : fail;
26
+ }));
27
+ return results.filter(i => i !== fail);
28
+ }
29
+
19
30
  class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
20
31
 
21
32
  static get properties() {
22
33
  return {
34
+ /**
35
+ * Enables the option to clear all inner tag list items. The `d2l-tag-list-item-cleared` event will be dispatched for each list item when the user selects to Clear All. The consumer must handle the actual item deletion.
36
+ */
37
+ clearable: { type: Boolean },
23
38
  /**
24
39
  * REQUIRED: A description of the tag list for additional accessibility context
25
40
  * @type {string}
@@ -56,6 +71,12 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
56
71
  position: absolute;
57
72
  visibility: hidden;
58
73
  }
74
+ .d2l-tag-list-clear-button {
75
+ visibility: hidden;
76
+ }
77
+ .d2l-tag-list-clear-button.d2l-tag-list-clear-button-visible {
78
+ visibility: visible;
79
+ }
59
80
  `;
60
81
  }
61
82
 
@@ -63,7 +84,9 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
63
84
  super();
64
85
  /** @ignore */
65
86
  this.arrowKeysDirection = 'leftrightupdown';
87
+ this.clearable = false;
66
88
  this._chompIndex = 10000;
89
+ this._clearButtonWidth = 0;
67
90
  this._hasResized = false;
68
91
  this._resizeObserver = null;
69
92
  this._showHiddenTags = false;
@@ -71,6 +94,7 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
71
94
 
72
95
  disconnectedCallback() {
73
96
  super.disconnectedCallback();
97
+ if (this._clearButtonResizeObserver) this._clearButtonResizeObserver.disconnect();
74
98
  if (this._resizeObserver) this._resizeObserver.disconnect();
75
99
  if (this._subtleButtonResizeObserver) this._subtleButtonResizeObserver.disconnect();
76
100
  }
@@ -78,7 +102,7 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
78
102
  firstUpdated(changedProperties) {
79
103
  super.firstUpdated(changedProperties);
80
104
 
81
- const subtleButton = this.shadowRoot.querySelector('.d2l-tag-list-hidden-button');
105
+ const subtleButton = this.shadowRoot.querySelector('.d2l-tag-list-hidden-button');
82
106
  this._subtleButtonResizeObserver = new ResizeObserver(() => {
83
107
  this._subtleButtonWidth = Math.ceil(parseFloat(getComputedStyle(subtleButton).getPropertyValue('width')));
84
108
  });
@@ -87,6 +111,12 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
87
111
  const container = this.shadowRoot.querySelector('.tag-list-outer-container');
88
112
  this._resizeObserver = new ResizeObserver((e) => requestAnimationFrame(() => this._handleResize(e)));
89
113
  this._resizeObserver.observe(container);
114
+
115
+ const clearButton = this.shadowRoot.querySelector('d2l-button-subtle.d2l-tag-list-clear-button');
116
+ this._clearButtonResizeObserver = new ResizeObserver(() => {
117
+ this._clearButtonWidth = Math.ceil(parseFloat(getComputedStyle(clearButton).getPropertyValue('width')));
118
+ });
119
+ this._clearButtonResizeObserver.observe(clearButton);
90
120
  }
91
121
 
92
122
  render() {
@@ -104,9 +134,9 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
104
134
  });
105
135
  }
106
136
 
107
- let button = null;
137
+ let overflowButton = null;
108
138
  if (hasHiddenTags) {
109
- button = this._showHiddenTags ? html`
139
+ overflowButton = this._showHiddenTags ? html`
110
140
  <d2l-button-subtle
111
141
  class="d2l-tag-list-button"
112
142
  @click="${this._toggleHiddenTagVisibility}"
@@ -122,11 +152,22 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
122
152
  </d2l-button-subtle>
123
153
  `;
124
154
  }
155
+ const clearableClasses = {
156
+ 'd2l-tag-list-clear-button': true,
157
+ 'd2l-tag-list-clear-button-visible': this.clearable && this._items && this._items.length > 0
158
+ };
125
159
 
126
160
  const list = html`
127
- <div role="list" class="tag-list-container" aria-describedby="d2l-tag-list-description">
161
+ <div role="list" class="tag-list-container" aria-describedby="d2l-tag-list-description" @d2l-tag-list-item-cleared="${this._handleItemDeleted}">
128
162
  <slot @slotchange="${this._handleSlotChange}"></slot>
129
- ${button}
163
+ ${overflowButton}
164
+ <d2l-button-subtle
165
+ class="${classMap(clearableClasses)}"
166
+ @click="${this._handleClearAll}"
167
+ slim
168
+ text="${this.localize('components.tag-list.clear-all')}"
169
+ >
170
+ </d2l-button-subtle>
130
171
  </div>
131
172
  `;
132
173
 
@@ -154,6 +195,8 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
154
195
  _chomp() {
155
196
  if (!this.shadowRoot || !this._lines || !this._itemLayouts) return;
156
197
 
198
+ const clearButtonWidth = this.clearable ? this._clearButtonWidth : 0;
199
+
157
200
  const showing = {
158
201
  count: 0,
159
202
  width: 0
@@ -187,20 +230,22 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
187
230
  }
188
231
  }
189
232
 
190
- if (!isOverflowing) {
233
+ if (!isOverflowing && !this.clearable) {
191
234
  this._chompIndex = showing.count;
192
235
  return;
193
236
  }
194
237
 
195
- // calculate if additional item(s) should be hidden due to subtle button needing space
238
+ // calculate if additional item(s) should be hidden due to subtle button(s) needing space
196
239
  for (let j = this._itemLayouts.length; j--;) {
197
- if ((showing.width + this._subtleButtonWidth) < this._availableWidth) {
240
+ if ((this.clearable && !isOverflowing && ((showing.width + clearButtonWidth) < this._availableWidth))
241
+ || ((showing.width + this._subtleButtonWidth + clearButtonWidth) < this._availableWidth)) {
198
242
  break;
199
243
  }
200
244
  const itemLayoutOverflowing = this._itemLayouts[j];
201
245
  if (itemLayoutOverflowing.trigger !== 'soft-show') {
202
246
  continue;
203
247
  }
248
+ isOverflowing = true;
204
249
  showing.width -= itemLayoutOverflowing.width;
205
250
  showing.count -= 1;
206
251
  }
@@ -222,15 +267,56 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
222
267
  return items.filter(({ isHidden }) => !isHidden);
223
268
  }
224
269
 
225
- _getTagListItems() {
270
+ async _getTagListItems() {
226
271
  const slot = this.shadowRoot && this.shadowRoot.querySelector('slot');
227
272
  if (!slot) return;
228
- return slot.assignedNodes({ flatten: true }).filter((node) => {
273
+
274
+ const results = await filterAsync(slot.assignedNodes({ flatten: true }), async node => {
229
275
  if (node.nodeType !== Node.ELEMENT_NODE) return false;
276
+ await node.updateComplete;
277
+
230
278
  const role = node.getAttribute('role');
279
+ if (role !== 'listitem') return false;
280
+
281
+ if (this.clearable) node.setAttribute('clearable', 'clearable');
231
282
  node.removeAttribute('data-is-chomped');
232
- return (role === 'listitem');
283
+
284
+ return true;
233
285
  });
286
+ return results;
287
+ }
288
+
289
+ _getVisibleEffectiveChildren() {
290
+ if (!this.shadowRoot) {
291
+ return [];
292
+ }
293
+
294
+ const showMoreButton = this.shadowRoot.querySelector('.d2l-tag-list-button') || [];
295
+ const clearButton = this.shadowRoot.querySelector('.d2l-tag-list-clear-button') || [];
296
+ return this._items.slice(0, this._chompIndex).concat(showMoreButton).concat(clearButton);
297
+ }
298
+
299
+ _handleClearAll(e) {
300
+ if (!this._items) return;
301
+
302
+ announce(this.localize('components.tag-list.cleared-all'));
303
+
304
+ this._items.forEach((item) => {
305
+ item.handleClearItem(e, true);
306
+ });
307
+ }
308
+
309
+ _handleItemDeleted(e) {
310
+ if (!this.clearable) return;
311
+ if (!e || !e.detail || !e.detail.handleFocus) return;
312
+
313
+ const rootTarget = e.composedPath()[0];
314
+ const children = this._getVisibleEffectiveChildren();
315
+ const itemIndex = children.indexOf(rootTarget);
316
+ if (children.length > 1) {
317
+ if (children[itemIndex - 1]) children[itemIndex - 1].focus();
318
+ else children[itemIndex + 1].focus();
319
+ }
234
320
  }
235
321
 
236
322
  _handleResize(entries) {
@@ -241,18 +327,20 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
241
327
  if (!this._hasResized) {
242
328
  this._hasResized = true;
243
329
  this._handleSlotChange();
330
+ } else {
331
+ this._chomp();
244
332
  }
245
- this._chomp();
246
333
  }
247
334
 
248
335
  _handleSlotChange() {
249
336
  if (!this._hasResized) return;
250
337
 
251
338
  requestAnimationFrame(async() => {
252
- this._items = this._getTagListItems();
253
- if (!this._items || this._items.length === 0) return;
254
-
255
- await Promise.all(this._items.map(item => item.updateComplete));
339
+ this._items = await this._getTagListItems();
340
+ if (!this._items || this._items.length === 0) {
341
+ this._chompIndex = 10000;
342
+ return;
343
+ }
256
344
 
257
345
  this._itemLayouts = this._getItemLayouts(this._items);
258
346
  this._itemHeight = this._items[0].offsetHeight;
@@ -9768,6 +9768,12 @@
9768
9768
  "name": "text",
9769
9769
  "description": "REQUIRED: Text to display",
9770
9770
  "type": "string"
9771
+ },
9772
+ {
9773
+ "name": "clearable",
9774
+ "description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-cleared` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
9775
+ "type": "boolean",
9776
+ "default": "false"
9771
9777
  }
9772
9778
  ],
9773
9779
  "properties": [
@@ -9776,6 +9782,25 @@
9776
9782
  "attribute": "text",
9777
9783
  "description": "REQUIRED: Text to display",
9778
9784
  "type": "string"
9785
+ },
9786
+ {
9787
+ "name": "clearable",
9788
+ "attribute": "clearable",
9789
+ "description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-cleared` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
9790
+ "type": "boolean",
9791
+ "default": "false"
9792
+ }
9793
+ ],
9794
+ "events": [
9795
+ {
9796
+ "name": "focus"
9797
+ },
9798
+ {
9799
+ "name": "blur"
9800
+ },
9801
+ {
9802
+ "name": "d2l-tag-list-item-cleared",
9803
+ "description": "Dispatched when a user selects to delete a tag list item. The consumer must handle the actual element deletion and focus behaviour if there are no remaining list items."
9779
9804
  }
9780
9805
  ]
9781
9806
  },
@@ -9787,6 +9812,12 @@
9787
9812
  "name": "description",
9788
9813
  "description": "REQUIRED: A description of the tag list for additional accessibility context",
9789
9814
  "type": "string"
9815
+ },
9816
+ {
9817
+ "name": "clearable",
9818
+ "description": "Enables the option to clear all inner tag list items. The `d2l-tag-list-item-cleared` event will be dispatched for each list item when the user selects to Clear All. The consumer must handle the actual item deletion.",
9819
+ "type": "boolean",
9820
+ "default": "false"
9790
9821
  }
9791
9822
  ],
9792
9823
  "properties": [
@@ -9796,6 +9827,13 @@
9796
9827
  "description": "REQUIRED: A description of the tag list for additional accessibility context",
9797
9828
  "type": "string"
9798
9829
  },
9830
+ {
9831
+ "name": "clearable",
9832
+ "attribute": "clearable",
9833
+ "description": "Enables the option to clear all inner tag list items. The `d2l-tag-list-item-cleared` event will be dispatched for each list item when the user selects to Clear All. The consumer must handle the actual item deletion.",
9834
+ "type": "boolean",
9835
+ "default": "false"
9836
+ },
9799
9837
  {
9800
9838
  "name": "arrowKeysDirection",
9801
9839
  "type": "string",
@@ -9815,6 +9853,12 @@
9815
9853
  {
9816
9854
  "name": "name",
9817
9855
  "type": "string"
9856
+ },
9857
+ {
9858
+ "name": "clearable",
9859
+ "description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-cleared` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
9860
+ "type": "boolean",
9861
+ "default": "false"
9818
9862
  }
9819
9863
  ],
9820
9864
  "properties": [
@@ -9822,6 +9866,25 @@
9822
9866
  "name": "name",
9823
9867
  "attribute": "name",
9824
9868
  "type": "string"
9869
+ },
9870
+ {
9871
+ "name": "clearable",
9872
+ "attribute": "clearable",
9873
+ "description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-cleared` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
9874
+ "type": "boolean",
9875
+ "default": "false"
9876
+ }
9877
+ ],
9878
+ "events": [
9879
+ {
9880
+ "name": "focus"
9881
+ },
9882
+ {
9883
+ "name": "blur"
9884
+ },
9885
+ {
9886
+ "name": "d2l-tag-list-item-cleared",
9887
+ "description": "Dispatched when a user selects to delete a tag list item. The consumer must handle the actual element deletion and focus behaviour if there are no remaining list items."
9825
9888
  }
9826
9889
  ]
9827
9890
  },
package/lang/ar.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "إمكانية الرؤية",
96
96
  "components.tabs.next": "التمرير إلى الأمام",
97
97
  "components.tabs.previous": "التمرير إلى الخلف",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "تقسيم العرض القابل للضبط",
package/lang/cy.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Gwelededd",
96
96
  "components.tabs.next": "Sgrolio Ymlaen",
97
97
  "components.tabs.previous": "Sgrolio Yn Ôl",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Gwedd Hollt Addasadwy",
package/lang/da.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Synlighed",
96
96
  "components.tabs.next": "Rul frem",
97
97
  "components.tabs.previous": "Rul tilbage",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Justerbar delt visning",
package/lang/de.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Sichtbarkeit",
96
96
  "components.tabs.next": "Weiterblättern",
97
97
  "components.tabs.previous": "Zurückblättern",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Anpassbare geteilte Ansicht",
package/lang/en.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibility",
96
96
  "components.tabs.next": "Scroll Forward",
97
97
  "components.tabs.previous": "Scroll Backward",
98
+ "components.tag-list.clear": "Click, press backspace, or press delete key to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Adjustable Split View",
package/lang/es-es.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibilidad",
96
96
  "components.tabs.next": "Desplazarse hacia delante",
97
97
  "components.tabs.previous": "Desplazarse hacia atrás",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Vista dividida ajustable",
package/lang/es.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibilidad",
96
96
  "components.tabs.next": "Desplazarse hacia adelante",
97
97
  "components.tabs.previous": "Desplazarse hacia atrás",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.cleared-all": "Removed all tag list items",
100
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
101
+ "components.tag-list.clear-all": "Clear All",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Pantalla dividida ajustable",
package/lang/fr-fr.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibilité",
96
96
  "components.tabs.next": "Faire défiler vers l'avant",
97
97
  "components.tabs.previous": "Faire défiler vers l'arrière",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Vue fractionnée réglable",
package/lang/fr.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibilité",
96
96
  "components.tabs.next": "Défilement avant",
97
97
  "components.tabs.previous": "Défilement arrière",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Vue partagée réglable",
package/lang/hi.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "दृश्यता",
96
96
  "components.tabs.next": "आगे स्क्रॉल करें",
97
97
  "components.tabs.previous": "पीछे स्क्रॉल करें",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "समायोजन योग्य विभाजन दृश्य",
package/lang/ja.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "表示",
96
96
  "components.tabs.next": "前方にスクロール",
97
97
  "components.tabs.previous": "後方にスクロール",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "調整可能な分割ビュー",
package/lang/ko.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "표시여부",
96
96
  "components.tabs.next": "앞으로 스크롤",
97
97
  "components.tabs.previous": "뒤로 스크롤",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "조정 가능한 분할 보기",
package/lang/nl.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Zichtbaarheid",
96
96
  "components.tabs.next": "Naar voren scrollen",
97
97
  "components.tabs.previous": "Naar achteren scrollen",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Instelbare gesplitste weergave",
package/lang/pt.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Visibilidade",
96
96
  "components.tabs.next": "Ir para frente",
97
97
  "components.tabs.previous": "Ir para trás",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Exibição dividida ajustável",
package/lang/sv.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Synlighet",
96
96
  "components.tabs.next": "Bläddra framåt",
97
97
  "components.tabs.previous": "Bläddra bakåt",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Justerbar delad vy",
package/lang/tr.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "Görünürlük",
96
96
  "components.tabs.next": "İleri Kaydır",
97
97
  "components.tabs.previous": "Geri Kaydır",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "Ayarlanabilir Bölünmüş Görüntü",
package/lang/zh-cn.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "可见性",
96
96
  "components.tabs.next": "向前滚动",
97
97
  "components.tabs.previous": "向后滚动",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "可调分屏视图",
package/lang/zh-tw.js CHANGED
@@ -95,6 +95,10 @@ export default {
95
95
  "components.switch.visibility": "能見度",
96
96
  "components.tabs.next": "向前捲動",
97
97
  "components.tabs.previous": "向後捲動",
98
+ "components.tag-list.clear": "Click to remove item {value}",
99
+ "components.tag-list.clear-all": "Clear All",
100
+ "components.tag-list.cleared-all": "Removed all tag list items",
101
+ "components.tag-list.cleared-item": "Removed tag list item {value}",
98
102
  "components.tag-list.num-hidden": "+ {count} more",
99
103
  "components.tag-list.show-less": "Show Less",
100
104
  "templates.primary-secondary.adjustableSplitView": "可調整的分割檢視",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.10.2",
3
+ "version": "2.11.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",