@brightspace-ui/core 2.52.1 → 2.54.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.
- package/components/filter/README.md +37 -8
- package/components/filter/demo/filter.html +24 -24
- package/components/filter/filter-dimension-set-value.js +21 -3
- package/components/filter/filter-dimension-set.js +1 -0
- package/components/filter/filter.js +12 -4
- package/custom-elements.json +219 -0
- package/mixins/localize-mixin.js +19 -40
- package/mixins/localize-mixin.md +2 -3
- package/package.json +1 -1
|
@@ -159,7 +159,7 @@ The filter will announce changes to filter selections, search results, and when
|
|
|
159
159
|
|
|
160
160
|
<!-- docs: end hidden content -->
|
|
161
161
|
|
|
162
|
-
##
|
|
162
|
+
## Dimension Set [d2l-filter-dimension-set]
|
|
163
163
|
|
|
164
164
|
The `d2l-filter-dimension-set` component is the main dimension type that will work for most use cases. Used alongside the [d2l-filter-dimension-set-value](#d2l-filter-dimension-set-value), this will give you a selectable list of filter values.
|
|
165
165
|
|
|
@@ -197,7 +197,7 @@ The `d2l-filter-dimension-set` component is the main dimension type that will wo
|
|
|
197
197
|
| `value-only-active-filter-text` | Boolean | Whether to hide the dimension in the text sent to active filter subscribers |
|
|
198
198
|
<!-- docs: end hidden content -->
|
|
199
199
|
|
|
200
|
-
##
|
|
200
|
+
## Dimension Set Value [d2l-filter-dimension-set-value]
|
|
201
201
|
|
|
202
202
|
This component is built to be used alongside the [d2l-filter-dimension-set](#d2l-filter-dimension-set) component, this will give you a selectable list of filter values.
|
|
203
203
|
|
|
@@ -210,8 +210,9 @@ This component is built to be used alongside the [d2l-filter-dimension-set](#d2l
|
|
|
210
210
|
</script>
|
|
211
211
|
<d2l-filter>
|
|
212
212
|
<d2l-filter-dimension-set key="course" text="Course" >
|
|
213
|
-
<d2l-filter-dimension-set-value key="art" text="Art" selected></d2l-filter-dimension-set-value>
|
|
214
|
-
<d2l-filter-dimension-set-value key="
|
|
213
|
+
<d2l-filter-dimension-set-value key="art" text="Art" count="1" selected></d2l-filter-dimension-set-value>
|
|
214
|
+
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="3" disabled></d2l-filter-dimension-set-value>
|
|
215
|
+
<d2l-filter-dimension-set-value key="biology" text="Biology" count="5"></d2l-filter-dimension-set-value>
|
|
215
216
|
</d2l-filter-dimension-set>
|
|
216
217
|
</d2l-filter>
|
|
217
218
|
```
|
|
@@ -220,12 +221,43 @@ This component is built to be used alongside the [d2l-filter-dimension-set](#d2l
|
|
|
220
221
|
|
|
221
222
|
| Property | Type | Description |
|
|
222
223
|
|---|---|---|
|
|
224
|
+
| `count` | Number | Count for the value in the list. If no count is provided, no count will be displayed |
|
|
223
225
|
| `disabled` | Boolean, default: `false` | Whether the value in the filter is disabled or not |
|
|
224
226
|
| `key` | String, required | Unique identifier within a dimension for the value |
|
|
225
227
|
| `text` | String, required | Text for the value in the list |
|
|
226
228
|
| `selected` | Boolean, default: `false` | Whether the value in the filter is selected or not |
|
|
227
229
|
<!-- docs: end hidden content -->
|
|
228
230
|
|
|
231
|
+
## Counts [d2l-filter-dimension-set-value]
|
|
232
|
+
|
|
233
|
+
The `count` property displays a count next to each filter value to indicate the number of results a value will yield. This helps users more effectively explore data and make selections, so it’s a good idea to provide these counts if it can be done performantly.
|
|
234
|
+
|
|
235
|
+
Note that when using multiple filter dimensions, the counts should be updated when selections are made across dimensions so that they always reflect the number of results a filter will yield.
|
|
236
|
+
|
|
237
|
+
<!-- docs: demo code align:start autoOpen:true autoSize:false size:large -->
|
|
238
|
+
```html
|
|
239
|
+
<script type="module">
|
|
240
|
+
import '@brightspace-ui/core/components/filter/filter.js';
|
|
241
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
|
242
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set-value.js';
|
|
243
|
+
</script>
|
|
244
|
+
<d2l-filter>
|
|
245
|
+
<d2l-filter-dimension-set key="course" text="Course" >
|
|
246
|
+
<d2l-filter-dimension-set-value key="art" text="Art" count="0"></d2l-filter-dimension-set-value>
|
|
247
|
+
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="1" selected></d2l-filter-dimension-set-value>
|
|
248
|
+
<d2l-filter-dimension-set-value key="biology" text="Biology" count="1024"></d2l-filter-dimension-set-value>
|
|
249
|
+
<d2l-filter-dimension-set-value key="chemistry" text="Chemistry" count="25" disabled></d2l-filter-dimension-set-value>
|
|
250
|
+
<d2l-filter-dimension-set-value key="drama" text="Drama" count="362"></d2l-filter-dimension-set-value>
|
|
251
|
+
<d2l-filter-dimension-set-value key="english" text="English" count="881"></d2l-filter-dimension-set-value>
|
|
252
|
+
<d2l-filter-dimension-set-value key="how-to" text="How To Write a How To Article With a Flashy Title" count="212"></d2l-filter-dimension-set-value>
|
|
253
|
+
<d2l-filter-dimension-set-value key="math" text="Math" count="22365"></d2l-filter-dimension-set-value>
|
|
254
|
+
<d2l-filter-dimension-set-value key="physics" text="Physics" count="27"></d2l-filter-dimension-set-value>
|
|
255
|
+
<d2l-filter-dimension-set-value key="stats" text="Statistics" count="2"></d2l-filter-dimension-set-value>
|
|
256
|
+
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft" count="96"></d2l-filter-dimension-set-value>
|
|
257
|
+
</d2l-filter-dimension-set>
|
|
258
|
+
</d2l-filter>
|
|
259
|
+
```
|
|
260
|
+
|
|
229
261
|
## Tags for Applied Filters [d2l-filter-tags]
|
|
230
262
|
|
|
231
263
|
A tag-list allowing the user to see (and remove) the currently applied filters. Works with the `d2l-filter`. It supports hooking up to multiple filters.
|
|
@@ -374,13 +406,10 @@ The `d2l-filter-overflow-group` is a container for multiple filters that handles
|
|
|
374
406
|
| `tags` | Boolean, default: `false` | Show `d2l-filter-tags` beneath the filters. Tags will be shown for all filters in the group. |
|
|
375
407
|
<!-- docs: end hidden content -->
|
|
376
408
|
|
|
377
|
-
## Filter Dimension: Date [d2l-filter-dimension-date]
|
|
378
|
-
|
|
379
|
-
**Coming Soon!**
|
|
380
|
-
|
|
381
409
|
<!-- docs: start hidden content -->
|
|
382
410
|
## Future Improvements
|
|
383
411
|
|
|
412
|
+
* Date Dimension - Ability to filter by dates
|
|
384
413
|
* ability to delay change events until the user has pressed an apply button (see [#341](https://github.com/BrightspaceUI/core/issues/341))
|
|
385
414
|
|
|
386
415
|
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
<template>
|
|
25
25
|
<d2l-filter>
|
|
26
26
|
<d2l-filter-dimension-set key="course" text="Course" select-all>
|
|
27
|
-
<d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
|
|
28
|
-
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" selected></d2l-filter-dimension-set-value>
|
|
29
|
-
<d2l-filter-dimension-set-value key="biology" text="Biology"></d2l-filter-dimension-set-value>
|
|
30
|
-
<d2l-filter-dimension-set-value key="chemistry" text="Chemistry" disabled></d2l-filter-dimension-set-value>
|
|
31
|
-
<d2l-filter-dimension-set-value key="drama" text="Drama" disabled></d2l-filter-dimension-set-value>
|
|
32
|
-
<d2l-filter-dimension-set-value key="english" text="English"></d2l-filter-dimension-set-value>
|
|
33
|
-
<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>
|
|
34
|
-
<d2l-filter-dimension-set-value key="math" text="Math"></d2l-filter-dimension-set-value>
|
|
35
|
-
<d2l-filter-dimension-set-value key="physics" text="Physics"></d2l-filter-dimension-set-value>
|
|
36
|
-
<d2l-filter-dimension-set-value key="stats" text="Statistics"></d2l-filter-dimension-set-value>
|
|
37
|
-
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft"></d2l-filter-dimension-set-value>
|
|
27
|
+
<d2l-filter-dimension-set-value key="art" text="Art" count="12"></d2l-filter-dimension-set-value>
|
|
28
|
+
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="2" selected></d2l-filter-dimension-set-value>
|
|
29
|
+
<d2l-filter-dimension-set-value key="biology" text="Biology" count="15"></d2l-filter-dimension-set-value>
|
|
30
|
+
<d2l-filter-dimension-set-value key="chemistry" text="Chemistry" count="1"disabled></d2l-filter-dimension-set-value>
|
|
31
|
+
<d2l-filter-dimension-set-value key="drama" text="Drama" count="23" disabled></d2l-filter-dimension-set-value>
|
|
32
|
+
<d2l-filter-dimension-set-value key="english" text="English" count="100"></d2l-filter-dimension-set-value>
|
|
33
|
+
<d2l-filter-dimension-set-value key="how-to" text="How To Write a How To Article With a Flashy Title" count="100"></d2l-filter-dimension-set-value>
|
|
34
|
+
<d2l-filter-dimension-set-value key="math" text="Math" count="50"></d2l-filter-dimension-set-value>
|
|
35
|
+
<d2l-filter-dimension-set-value key="physics" text="Physics" count="23"></d2l-filter-dimension-set-value>
|
|
36
|
+
<d2l-filter-dimension-set-value key="stats" text="Statistics" count="333"></d2l-filter-dimension-set-value>
|
|
37
|
+
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft" count="2211"></d2l-filter-dimension-set-value>
|
|
38
38
|
</d2l-filter-dimension-set>
|
|
39
39
|
</d2l-filter>
|
|
40
40
|
</template>
|
|
@@ -59,22 +59,22 @@
|
|
|
59
59
|
<template>
|
|
60
60
|
<d2l-filter>
|
|
61
61
|
<d2l-filter-dimension-set key="course" text="Course" select-all>
|
|
62
|
-
<d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
|
|
63
|
-
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" selected></d2l-filter-dimension-set-value>
|
|
64
|
-
<d2l-filter-dimension-set-value key="biology" text="Biology"></d2l-filter-dimension-set-value>
|
|
65
|
-
<d2l-filter-dimension-set-value key="chemistry" text="Chemistry"></d2l-filter-dimension-set-value>
|
|
66
|
-
<d2l-filter-dimension-set-value key="drama" text="Drama"></d2l-filter-dimension-set-value>
|
|
67
|
-
<d2l-filter-dimension-set-value key="english" text="English"></d2l-filter-dimension-set-value>
|
|
68
|
-
<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>
|
|
69
|
-
<d2l-filter-dimension-set-value key="math" text="Math"></d2l-filter-dimension-set-value>
|
|
70
|
-
<d2l-filter-dimension-set-value key="physics" text="Physics"></d2l-filter-dimension-set-value>
|
|
71
|
-
<d2l-filter-dimension-set-value key="stats" text="Statistics"></d2l-filter-dimension-set-value>
|
|
62
|
+
<d2l-filter-dimension-set-value key="art" text="Art" count="0"></d2l-filter-dimension-set-value>
|
|
63
|
+
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="1" selected></d2l-filter-dimension-set-value>
|
|
64
|
+
<d2l-filter-dimension-set-value key="biology" text="Biology" count="-12"></d2l-filter-dimension-set-value>
|
|
65
|
+
<d2l-filter-dimension-set-value key="chemistry" text="Chemistry" count="12.35"></d2l-filter-dimension-set-value>
|
|
66
|
+
<d2l-filter-dimension-set-value key="drama" text="Drama" count="xxx"></d2l-filter-dimension-set-value>
|
|
67
|
+
<d2l-filter-dimension-set-value key="english" text="English" count="881"></d2l-filter-dimension-set-value>
|
|
68
|
+
<d2l-filter-dimension-set-value key="how-to" text="How To Write a How To Article With a Flashy Title" count="100"></d2l-filter-dimension-set-value>
|
|
69
|
+
<d2l-filter-dimension-set-value key="math" text="Math" count="23909"></d2l-filter-dimension-set-value>
|
|
70
|
+
<d2l-filter-dimension-set-value key="physics" text="Physics" count="1012"></d2l-filter-dimension-set-value>
|
|
71
|
+
<d2l-filter-dimension-set-value key="stats" text="Statistics" count="2"></d2l-filter-dimension-set-value>
|
|
72
72
|
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft"></d2l-filter-dimension-set-value>
|
|
73
73
|
</d2l-filter-dimension-set>
|
|
74
74
|
<d2l-filter-dimension-set key="role" text="Role">
|
|
75
|
-
<d2l-filter-dimension-set-value key="admin" text="Admin"></d2l-filter-dimension-set-value>
|
|
76
|
-
<d2l-filter-dimension-set-value key="instructor" text="Instructor"></d2l-filter-dimension-set-value>
|
|
77
|
-
<d2l-filter-dimension-set-value key="student" text="Student"></d2l-filter-dimension-set-value>
|
|
75
|
+
<d2l-filter-dimension-set-value key="admin" text="Admin" count="0"></d2l-filter-dimension-set-value>
|
|
76
|
+
<d2l-filter-dimension-set-value key="instructor" text="Instructor" count="22"></d2l-filter-dimension-set-value>
|
|
77
|
+
<d2l-filter-dimension-set-value key="student" text="Student" count="50"></d2l-filter-dimension-set-value>
|
|
78
78
|
</d2l-filter-dimension-set>
|
|
79
79
|
<d2l-filter-dimension-set key="semester" text="Semester" selection-single>
|
|
80
80
|
<d2l-filter-dimension-set-value key="fall" text="Fall"></d2l-filter-dimension-set-value>
|
|
@@ -8,6 +8,11 @@ class FilterDimensionSetValue extends LitElement {
|
|
|
8
8
|
|
|
9
9
|
static get properties() {
|
|
10
10
|
return {
|
|
11
|
+
/**
|
|
12
|
+
* Count for the value in the list. If no count is provided, no count will be displayed
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
count: { type: Number },
|
|
11
16
|
/**
|
|
12
17
|
* Whether this value in the filter is disabled or not
|
|
13
18
|
* @type {boolean}
|
|
@@ -38,6 +43,21 @@ class FilterDimensionSetValue extends LitElement {
|
|
|
38
43
|
this.text = '';
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
get count() {
|
|
47
|
+
return this._count;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
set count(val) {
|
|
51
|
+
if (val < 0) val = 0;
|
|
52
|
+
if (!Number.isInteger(val)) val = Math.floor(val);
|
|
53
|
+
if (Number.isNaN(val)) val = undefined;
|
|
54
|
+
const oldVal = this._count;
|
|
55
|
+
if (oldVal !== val) {
|
|
56
|
+
this._count = val;
|
|
57
|
+
this.requestUpdate('count', oldVal);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
41
61
|
updated(changedProperties) {
|
|
42
62
|
super.updated(changedProperties);
|
|
43
63
|
|
|
@@ -45,11 +65,10 @@ class FilterDimensionSetValue extends LitElement {
|
|
|
45
65
|
changedProperties.forEach((oldValue, prop) => {
|
|
46
66
|
if (oldValue === undefined) return;
|
|
47
67
|
|
|
48
|
-
if (prop === 'disabled' || prop === 'selected' || prop === 'text') {
|
|
68
|
+
if (prop === 'count' || prop === 'disabled' || prop === 'selected' || prop === 'text') {
|
|
49
69
|
changes.set(prop, this[prop]);
|
|
50
70
|
}
|
|
51
71
|
});
|
|
52
|
-
|
|
53
72
|
if (changes.size > 0) {
|
|
54
73
|
/** @ignore */
|
|
55
74
|
this.dispatchEvent(new CustomEvent('d2l-filter-dimension-set-value-data-change', {
|
|
@@ -59,7 +78,6 @@ class FilterDimensionSetValue extends LitElement {
|
|
|
59
78
|
}));
|
|
60
79
|
}
|
|
61
80
|
}
|
|
62
|
-
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
customElements.define('d2l-filter-dimension-set-value', FilterDimensionSetValue);
|
|
@@ -103,6 +103,7 @@ class FilterDimensionSet extends LitElement {
|
|
|
103
103
|
const valueNodes = this._getSlottedNodes();
|
|
104
104
|
const values = valueNodes.map(value => {
|
|
105
105
|
return {
|
|
106
|
+
count: value.count,
|
|
106
107
|
disabled: value.disabled,
|
|
107
108
|
key: value.key,
|
|
108
109
|
selected: value.selected,
|
|
@@ -16,10 +16,11 @@ import '../selection/selection-select-all.js';
|
|
|
16
16
|
import '../selection/selection-summary.js';
|
|
17
17
|
|
|
18
18
|
import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles } from '../typography/styles.js';
|
|
19
|
-
import { css, html, LitElement } from 'lit';
|
|
19
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
20
20
|
import { announce } from '../../helpers/announce.js';
|
|
21
21
|
import { classMap } from 'lit/directives/class-map.js';
|
|
22
22
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
23
|
+
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
23
24
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
24
25
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
25
26
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
@@ -120,12 +121,16 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
120
121
|
white-space: nowrap;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
.d2l-filter-dimension-set-value
|
|
124
|
+
.d2l-filter-dimension-set-value {
|
|
124
125
|
color: var(--d2l-color-ferrite);
|
|
126
|
+
display: flex;
|
|
127
|
+
gap: 0.45rem;
|
|
125
128
|
line-height: unset;
|
|
129
|
+
overflow: hidden;
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
d2l-list-item[disabled] .d2l-filter-dimension-set-value
|
|
132
|
+
d2l-list-item[disabled] .d2l-filter-dimension-set-value,
|
|
133
|
+
d2l-list-item[disabled] .d2l-body-small {
|
|
129
134
|
color: var(--d2l-color-chromite);
|
|
130
135
|
}
|
|
131
136
|
|
|
@@ -417,7 +422,10 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
417
422
|
label="${item.text}"
|
|
418
423
|
selectable
|
|
419
424
|
?selected="${item.selected}">
|
|
420
|
-
<div class="d2l-filter-dimension-set-value
|
|
425
|
+
<div class="d2l-filter-dimension-set-value d2l-body-compact">
|
|
426
|
+
<div class="d2l-filter-dimension-set-value-text">${item.text}</div>
|
|
427
|
+
${item.count !== undefined ? html`<div class="d2l-body-small">(${formatNumber(item.count)})</div>` : nothing}
|
|
428
|
+
</div>
|
|
421
429
|
</d2l-list-item>
|
|
422
430
|
`)}
|
|
423
431
|
</d2l-list>
|
package/custom-elements.json
CHANGED
|
@@ -167,6 +167,10 @@
|
|
|
167
167
|
"description": "Type of the alert being displayed",
|
|
168
168
|
"type": "'default'|'critical'|'success'|'warning'",
|
|
169
169
|
"default": "\"default\""
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "documentLocaleSettings",
|
|
173
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
170
174
|
}
|
|
171
175
|
],
|
|
172
176
|
"events": [
|
|
@@ -326,6 +330,10 @@
|
|
|
326
330
|
"description": "Renders in compact mode, displaying only the last item",
|
|
327
331
|
"type": "boolean",
|
|
328
332
|
"default": "false"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "documentLocaleSettings",
|
|
336
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
329
337
|
}
|
|
330
338
|
],
|
|
331
339
|
"slots": [
|
|
@@ -691,6 +699,10 @@
|
|
|
691
699
|
"attribute": "summary",
|
|
692
700
|
"description": "Summary of the calendar for accessibility",
|
|
693
701
|
"type": "string"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "documentLocaleSettings",
|
|
705
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
694
706
|
}
|
|
695
707
|
],
|
|
696
708
|
"events": [
|
|
@@ -1198,6 +1210,10 @@
|
|
|
1198
1210
|
"type": "'count'|'notification'",
|
|
1199
1211
|
"default": "\"count\""
|
|
1200
1212
|
},
|
|
1213
|
+
{
|
|
1214
|
+
"name": "documentLocaleSettings",
|
|
1215
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
1216
|
+
},
|
|
1201
1217
|
{
|
|
1202
1218
|
"name": "skeleton",
|
|
1203
1219
|
"attribute": "skeleton",
|
|
@@ -1345,6 +1361,10 @@
|
|
|
1345
1361
|
"type": "'count'|'notification'",
|
|
1346
1362
|
"default": "\"count\""
|
|
1347
1363
|
},
|
|
1364
|
+
{
|
|
1365
|
+
"name": "documentLocaleSettings",
|
|
1366
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
1367
|
+
},
|
|
1348
1368
|
{
|
|
1349
1369
|
"name": "skeleton",
|
|
1350
1370
|
"attribute": "skeleton",
|
|
@@ -1628,6 +1648,10 @@
|
|
|
1628
1648
|
"type": "boolean",
|
|
1629
1649
|
"default": "false"
|
|
1630
1650
|
},
|
|
1651
|
+
{
|
|
1652
|
+
"name": "documentLocaleSettings",
|
|
1653
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
1654
|
+
},
|
|
1631
1655
|
{
|
|
1632
1656
|
"name": "asyncContainerCustom",
|
|
1633
1657
|
"type": "boolean"
|
|
@@ -1733,6 +1757,10 @@
|
|
|
1733
1757
|
"type": "number",
|
|
1734
1758
|
"default": "600"
|
|
1735
1759
|
},
|
|
1760
|
+
{
|
|
1761
|
+
"name": "documentLocaleSettings",
|
|
1762
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
1763
|
+
},
|
|
1736
1764
|
{
|
|
1737
1765
|
"name": "asyncContainerCustom",
|
|
1738
1766
|
"type": "boolean"
|
|
@@ -2213,6 +2241,10 @@
|
|
|
2213
2241
|
"description": "Optionally render a d2l-focus-trap around the dropdown content",
|
|
2214
2242
|
"type": "boolean",
|
|
2215
2243
|
"default": "false"
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
"name": "documentLocaleSettings",
|
|
2247
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
2216
2248
|
}
|
|
2217
2249
|
],
|
|
2218
2250
|
"events": [
|
|
@@ -2582,6 +2614,10 @@
|
|
|
2582
2614
|
"description": "Optionally render a d2l-focus-trap around the dropdown content",
|
|
2583
2615
|
"type": "boolean",
|
|
2584
2616
|
"default": "false"
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
"name": "documentLocaleSettings",
|
|
2620
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
2585
2621
|
}
|
|
2586
2622
|
],
|
|
2587
2623
|
"events": [
|
|
@@ -2951,6 +2987,10 @@
|
|
|
2951
2987
|
"description": "Optionally render a d2l-focus-trap around the dropdown content",
|
|
2952
2988
|
"type": "boolean",
|
|
2953
2989
|
"default": "false"
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
"name": "documentLocaleSettings",
|
|
2993
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
2954
2994
|
}
|
|
2955
2995
|
],
|
|
2956
2996
|
"events": [
|
|
@@ -3262,6 +3302,11 @@
|
|
|
3262
3302
|
"description": "REQUIRED: Unique key to represent this value in the dimension",
|
|
3263
3303
|
"type": "string"
|
|
3264
3304
|
},
|
|
3305
|
+
{
|
|
3306
|
+
"name": "count",
|
|
3307
|
+
"description": "Count for the value in the list. If no count is provided, no count will be displayed",
|
|
3308
|
+
"type": "number"
|
|
3309
|
+
},
|
|
3265
3310
|
{
|
|
3266
3311
|
"name": "disabled",
|
|
3267
3312
|
"description": "Whether this value in the filter is disabled or not",
|
|
@@ -3288,6 +3333,12 @@
|
|
|
3288
3333
|
"description": "REQUIRED: Unique key to represent this value in the dimension",
|
|
3289
3334
|
"type": "string"
|
|
3290
3335
|
},
|
|
3336
|
+
{
|
|
3337
|
+
"name": "count",
|
|
3338
|
+
"attribute": "count",
|
|
3339
|
+
"description": "Count for the value in the list. If no count is provided, no count will be displayed",
|
|
3340
|
+
"type": "number"
|
|
3341
|
+
},
|
|
3291
3342
|
{
|
|
3292
3343
|
"name": "disabled",
|
|
3293
3344
|
"attribute": "disabled",
|
|
@@ -3468,6 +3519,10 @@
|
|
|
3468
3519
|
"name": "openerType",
|
|
3469
3520
|
"type": "string",
|
|
3470
3521
|
"default": "\"DEFAULT\""
|
|
3522
|
+
},
|
|
3523
|
+
{
|
|
3524
|
+
"name": "documentLocaleSettings",
|
|
3525
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3471
3526
|
}
|
|
3472
3527
|
],
|
|
3473
3528
|
"events": [
|
|
@@ -3512,6 +3567,10 @@
|
|
|
3512
3567
|
"description": "The text displayed in this component's label (hidden when default is used)",
|
|
3513
3568
|
"type": "string",
|
|
3514
3569
|
"default": "\"\\\"Active Filters:\\\"\""
|
|
3570
|
+
},
|
|
3571
|
+
{
|
|
3572
|
+
"name": "documentLocaleSettings",
|
|
3573
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3515
3574
|
}
|
|
3516
3575
|
]
|
|
3517
3576
|
},
|
|
@@ -3558,6 +3617,10 @@
|
|
|
3558
3617
|
"description": "Indicates if the filter is open",
|
|
3559
3618
|
"type": "boolean",
|
|
3560
3619
|
"default": "false"
|
|
3620
|
+
},
|
|
3621
|
+
{
|
|
3622
|
+
"name": "documentLocaleSettings",
|
|
3623
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3561
3624
|
}
|
|
3562
3625
|
],
|
|
3563
3626
|
"events": [
|
|
@@ -3633,6 +3696,10 @@
|
|
|
3633
3696
|
"name": "errors",
|
|
3634
3697
|
"type": "object",
|
|
3635
3698
|
"default": "[]"
|
|
3699
|
+
},
|
|
3700
|
+
{
|
|
3701
|
+
"name": "documentLocaleSettings",
|
|
3702
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3636
3703
|
}
|
|
3637
3704
|
]
|
|
3638
3705
|
},
|
|
@@ -3707,6 +3774,10 @@
|
|
|
3707
3774
|
"description": "Indicates that the form should interrupt and warn on navigation if the user has unsaved changes on native elements.",
|
|
3708
3775
|
"type": "boolean",
|
|
3709
3776
|
"default": "false"
|
|
3777
|
+
},
|
|
3778
|
+
{
|
|
3779
|
+
"name": "documentLocaleSettings",
|
|
3780
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3710
3781
|
}
|
|
3711
3782
|
],
|
|
3712
3783
|
"events": [
|
|
@@ -3760,6 +3831,10 @@
|
|
|
3760
3831
|
"description": "Indicates that the form should interrupt and warn on navigation if the user has unsaved changes on native elements.",
|
|
3761
3832
|
"type": "boolean",
|
|
3762
3833
|
"default": "false"
|
|
3834
|
+
},
|
|
3835
|
+
{
|
|
3836
|
+
"name": "documentLocaleSettings",
|
|
3837
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3763
3838
|
}
|
|
3764
3839
|
],
|
|
3765
3840
|
"events": [
|
|
@@ -3840,6 +3915,10 @@
|
|
|
3840
3915
|
"attribute": "name",
|
|
3841
3916
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
3842
3917
|
"type": "string"
|
|
3918
|
+
},
|
|
3919
|
+
{
|
|
3920
|
+
"name": "documentLocaleSettings",
|
|
3921
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
3843
3922
|
}
|
|
3844
3923
|
]
|
|
3845
3924
|
},
|
|
@@ -4442,6 +4521,10 @@
|
|
|
4442
4521
|
"attribute": "name",
|
|
4443
4522
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
4444
4523
|
"type": "string"
|
|
4524
|
+
},
|
|
4525
|
+
{
|
|
4526
|
+
"name": "documentLocaleSettings",
|
|
4527
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
4445
4528
|
}
|
|
4446
4529
|
],
|
|
4447
4530
|
"events": [
|
|
@@ -4508,6 +4591,10 @@
|
|
|
4508
4591
|
"description": "Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)",
|
|
4509
4592
|
"type": "boolean",
|
|
4510
4593
|
"default": "false"
|
|
4594
|
+
},
|
|
4595
|
+
{
|
|
4596
|
+
"name": "documentLocaleSettings",
|
|
4597
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
4511
4598
|
}
|
|
4512
4599
|
]
|
|
4513
4600
|
},
|
|
@@ -4739,6 +4826,10 @@
|
|
|
4739
4826
|
"attribute": "name",
|
|
4740
4827
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
4741
4828
|
"type": "string"
|
|
4829
|
+
},
|
|
4830
|
+
{
|
|
4831
|
+
"name": "documentLocaleSettings",
|
|
4832
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
4742
4833
|
}
|
|
4743
4834
|
],
|
|
4744
4835
|
"events": [
|
|
@@ -4926,6 +5017,10 @@
|
|
|
4926
5017
|
"attribute": "name",
|
|
4927
5018
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
4928
5019
|
"type": "string"
|
|
5020
|
+
},
|
|
5021
|
+
{
|
|
5022
|
+
"name": "documentLocaleSettings",
|
|
5023
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
4929
5024
|
}
|
|
4930
5025
|
],
|
|
4931
5026
|
"events": [
|
|
@@ -5092,6 +5187,10 @@
|
|
|
5092
5187
|
"attribute": "name",
|
|
5093
5188
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
5094
5189
|
"type": "string"
|
|
5190
|
+
},
|
|
5191
|
+
{
|
|
5192
|
+
"name": "documentLocaleSettings",
|
|
5193
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
5095
5194
|
}
|
|
5096
5195
|
],
|
|
5097
5196
|
"events": [
|
|
@@ -5432,6 +5531,10 @@
|
|
|
5432
5531
|
"attribute": "name",
|
|
5433
5532
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
5434
5533
|
"type": "string"
|
|
5534
|
+
},
|
|
5535
|
+
{
|
|
5536
|
+
"name": "documentLocaleSettings",
|
|
5537
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
5435
5538
|
}
|
|
5436
5539
|
],
|
|
5437
5540
|
"events": [
|
|
@@ -5630,6 +5733,10 @@
|
|
|
5630
5733
|
"attribute": "name",
|
|
5631
5734
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
5632
5735
|
"type": "string"
|
|
5736
|
+
},
|
|
5737
|
+
{
|
|
5738
|
+
"name": "documentLocaleSettings",
|
|
5739
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
5633
5740
|
}
|
|
5634
5741
|
],
|
|
5635
5742
|
"events": [
|
|
@@ -5738,6 +5845,10 @@
|
|
|
5738
5845
|
"description": "Value of the input",
|
|
5739
5846
|
"type": "string",
|
|
5740
5847
|
"default": "\"\""
|
|
5848
|
+
},
|
|
5849
|
+
{
|
|
5850
|
+
"name": "documentLocaleSettings",
|
|
5851
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
5741
5852
|
}
|
|
5742
5853
|
],
|
|
5743
5854
|
"events": [
|
|
@@ -6100,6 +6211,10 @@
|
|
|
6100
6211
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
6101
6212
|
"type": "string"
|
|
6102
6213
|
},
|
|
6214
|
+
{
|
|
6215
|
+
"name": "documentLocaleSettings",
|
|
6216
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
6217
|
+
},
|
|
6103
6218
|
{
|
|
6104
6219
|
"name": "skeleton",
|
|
6105
6220
|
"attribute": "skeleton",
|
|
@@ -6339,6 +6454,10 @@
|
|
|
6339
6454
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
6340
6455
|
"type": "string"
|
|
6341
6456
|
},
|
|
6457
|
+
{
|
|
6458
|
+
"name": "documentLocaleSettings",
|
|
6459
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
6460
|
+
},
|
|
6342
6461
|
{
|
|
6343
6462
|
"name": "skeleton",
|
|
6344
6463
|
"attribute": "skeleton",
|
|
@@ -6577,6 +6696,10 @@
|
|
|
6577
6696
|
"attribute": "name",
|
|
6578
6697
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
6579
6698
|
"type": "string"
|
|
6699
|
+
},
|
|
6700
|
+
{
|
|
6701
|
+
"name": "documentLocaleSettings",
|
|
6702
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
6580
6703
|
}
|
|
6581
6704
|
],
|
|
6582
6705
|
"events": [
|
|
@@ -6754,6 +6877,10 @@
|
|
|
6754
6877
|
"attribute": "name",
|
|
6755
6878
|
"description": "Name of the form control. Submitted with the form as part of a name/value pair.",
|
|
6756
6879
|
"type": "string"
|
|
6880
|
+
},
|
|
6881
|
+
{
|
|
6882
|
+
"name": "documentLocaleSettings",
|
|
6883
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
6757
6884
|
}
|
|
6758
6885
|
],
|
|
6759
6886
|
"events": [
|
|
@@ -7052,6 +7179,10 @@
|
|
|
7052
7179
|
"type": "'normal'|'none'",
|
|
7053
7180
|
"default": "\"normal\""
|
|
7054
7181
|
},
|
|
7182
|
+
{
|
|
7183
|
+
"name": "documentLocaleSettings",
|
|
7184
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
7185
|
+
},
|
|
7055
7186
|
{
|
|
7056
7187
|
"name": "dragHandleText",
|
|
7057
7188
|
"attribute": "drag-handle-text",
|
|
@@ -7189,6 +7320,10 @@
|
|
|
7189
7320
|
"description": "Whether all pages can be selected",
|
|
7190
7321
|
"type": "boolean",
|
|
7191
7322
|
"default": "false"
|
|
7323
|
+
},
|
|
7324
|
+
{
|
|
7325
|
+
"name": "documentLocaleSettings",
|
|
7326
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
7192
7327
|
}
|
|
7193
7328
|
],
|
|
7194
7329
|
"slots": [
|
|
@@ -7316,6 +7451,10 @@
|
|
|
7316
7451
|
"type": "'normal'|'none'",
|
|
7317
7452
|
"default": "\"normal\""
|
|
7318
7453
|
},
|
|
7454
|
+
{
|
|
7455
|
+
"name": "documentLocaleSettings",
|
|
7456
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
7457
|
+
},
|
|
7319
7458
|
{
|
|
7320
7459
|
"name": "dragHandleText",
|
|
7321
7460
|
"attribute": "drag-handle-text",
|
|
@@ -7489,6 +7628,10 @@
|
|
|
7489
7628
|
"description": "Disables the handle",
|
|
7490
7629
|
"type": "boolean",
|
|
7491
7630
|
"default": "false"
|
|
7631
|
+
},
|
|
7632
|
+
{
|
|
7633
|
+
"name": "documentLocaleSettings",
|
|
7634
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
7492
7635
|
}
|
|
7493
7636
|
],
|
|
7494
7637
|
"events": [
|
|
@@ -7748,6 +7891,10 @@
|
|
|
7748
7891
|
"type": "'normal'|'none'",
|
|
7749
7892
|
"default": "\"normal\""
|
|
7750
7893
|
},
|
|
7894
|
+
{
|
|
7895
|
+
"name": "documentLocaleSettings",
|
|
7896
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
7897
|
+
},
|
|
7751
7898
|
{
|
|
7752
7899
|
"name": "dragHandleText",
|
|
7753
7900
|
"attribute": "drag-handle-text",
|
|
@@ -8370,6 +8517,10 @@
|
|
|
8370
8517
|
}
|
|
8371
8518
|
],
|
|
8372
8519
|
"properties": [
|
|
8520
|
+
{
|
|
8521
|
+
"name": "documentLocaleSettings",
|
|
8522
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8523
|
+
},
|
|
8373
8524
|
{
|
|
8374
8525
|
"name": "text",
|
|
8375
8526
|
"attribute": "text",
|
|
@@ -8566,6 +8717,10 @@
|
|
|
8566
8717
|
"description": "REQUIRED: Current number of completed units.\nValid values: A number between 0 and max",
|
|
8567
8718
|
"type": "number",
|
|
8568
8719
|
"default": "0"
|
|
8720
|
+
},
|
|
8721
|
+
{
|
|
8722
|
+
"name": "documentLocaleSettings",
|
|
8723
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8569
8724
|
}
|
|
8570
8725
|
]
|
|
8571
8726
|
},
|
|
@@ -8638,6 +8793,10 @@
|
|
|
8638
8793
|
"description": "REQUIRED: Current number of completed units.\nValid values: A number between 0 and max",
|
|
8639
8794
|
"type": "number",
|
|
8640
8795
|
"default": "0"
|
|
8796
|
+
},
|
|
8797
|
+
{
|
|
8798
|
+
"name": "documentLocaleSettings",
|
|
8799
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8641
8800
|
}
|
|
8642
8801
|
]
|
|
8643
8802
|
},
|
|
@@ -8697,6 +8856,10 @@
|
|
|
8697
8856
|
"description": "REQUIRED: Current number of completed units.\nValid values: A number between 0 and max",
|
|
8698
8857
|
"type": "number",
|
|
8699
8858
|
"default": "0"
|
|
8859
|
+
},
|
|
8860
|
+
{
|
|
8861
|
+
"name": "documentLocaleSettings",
|
|
8862
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8700
8863
|
}
|
|
8701
8864
|
]
|
|
8702
8865
|
},
|
|
@@ -8767,6 +8930,10 @@
|
|
|
8767
8930
|
"description": "Whether the component is active or inactive",
|
|
8768
8931
|
"type": "boolean",
|
|
8769
8932
|
"default": "false"
|
|
8933
|
+
},
|
|
8934
|
+
{
|
|
8935
|
+
"name": "documentLocaleSettings",
|
|
8936
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8770
8937
|
}
|
|
8771
8938
|
],
|
|
8772
8939
|
"events": [
|
|
@@ -8969,6 +9136,10 @@
|
|
|
8969
9136
|
"name": "openerType",
|
|
8970
9137
|
"type": "string",
|
|
8971
9138
|
"default": "\"DEFAULT\""
|
|
9139
|
+
},
|
|
9140
|
+
{
|
|
9141
|
+
"name": "documentLocaleSettings",
|
|
9142
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
8972
9143
|
}
|
|
8973
9144
|
],
|
|
8974
9145
|
"events": [
|
|
@@ -9029,6 +9200,10 @@
|
|
|
9029
9200
|
"description": "The number of additional items to load.",
|
|
9030
9201
|
"type": "number",
|
|
9031
9202
|
"default": "50"
|
|
9203
|
+
},
|
|
9204
|
+
{
|
|
9205
|
+
"name": "documentLocaleSettings",
|
|
9206
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9032
9207
|
}
|
|
9033
9208
|
],
|
|
9034
9209
|
"events": [
|
|
@@ -9203,6 +9378,10 @@
|
|
|
9203
9378
|
"description": "REQUIRED: Text for the dropdown opener button",
|
|
9204
9379
|
"type": "string"
|
|
9205
9380
|
},
|
|
9381
|
+
{
|
|
9382
|
+
"name": "documentLocaleSettings",
|
|
9383
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9384
|
+
},
|
|
9206
9385
|
{
|
|
9207
9386
|
"name": "requiresSelection",
|
|
9208
9387
|
"attribute": "requires-selection",
|
|
@@ -9416,6 +9595,10 @@
|
|
|
9416
9595
|
"description": "REQUIRED: The text for the action",
|
|
9417
9596
|
"type": "string"
|
|
9418
9597
|
},
|
|
9598
|
+
{
|
|
9599
|
+
"name": "documentLocaleSettings",
|
|
9600
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9601
|
+
},
|
|
9419
9602
|
{
|
|
9420
9603
|
"name": "requiresSelection",
|
|
9421
9604
|
"attribute": "requires-selection",
|
|
@@ -9564,6 +9747,10 @@
|
|
|
9564
9747
|
}
|
|
9565
9748
|
],
|
|
9566
9749
|
"properties": [
|
|
9750
|
+
{
|
|
9751
|
+
"name": "documentLocaleSettings",
|
|
9752
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9753
|
+
},
|
|
9567
9754
|
{
|
|
9568
9755
|
"name": "selectionFor",
|
|
9569
9756
|
"attribute": "selection-for",
|
|
@@ -9606,6 +9793,10 @@
|
|
|
9606
9793
|
"type": "boolean",
|
|
9607
9794
|
"default": "false"
|
|
9608
9795
|
},
|
|
9796
|
+
{
|
|
9797
|
+
"name": "documentLocaleSettings",
|
|
9798
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9799
|
+
},
|
|
9609
9800
|
{
|
|
9610
9801
|
"name": "selectionFor",
|
|
9611
9802
|
"attribute": "selection-for",
|
|
@@ -9646,6 +9837,10 @@
|
|
|
9646
9837
|
"description": "Text to display if no items are selected",
|
|
9647
9838
|
"type": "string"
|
|
9648
9839
|
},
|
|
9840
|
+
{
|
|
9841
|
+
"name": "documentLocaleSettings",
|
|
9842
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
9843
|
+
},
|
|
9649
9844
|
{
|
|
9650
9845
|
"name": "selectionFor",
|
|
9651
9846
|
"attribute": "selection-for",
|
|
@@ -9995,6 +10190,10 @@
|
|
|
9995
10190
|
"name": "onIcon",
|
|
9996
10191
|
"type": "TemplateResult<1>"
|
|
9997
10192
|
},
|
|
10193
|
+
{
|
|
10194
|
+
"name": "documentLocaleSettings",
|
|
10195
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10196
|
+
},
|
|
9998
10197
|
{
|
|
9999
10198
|
"name": "disabled",
|
|
10000
10199
|
"attribute": "disabled",
|
|
@@ -10402,6 +10601,10 @@
|
|
|
10402
10601
|
"type": "number",
|
|
10403
10602
|
"default": "-1"
|
|
10404
10603
|
},
|
|
10604
|
+
{
|
|
10605
|
+
"name": "documentLocaleSettings",
|
|
10606
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10607
|
+
},
|
|
10405
10608
|
{
|
|
10406
10609
|
"name": "arrowKeysDirection",
|
|
10407
10610
|
"type": "string",
|
|
@@ -10470,6 +10673,10 @@
|
|
|
10470
10673
|
"description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-clear` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
|
|
10471
10674
|
"type": "boolean",
|
|
10472
10675
|
"default": "false"
|
|
10676
|
+
},
|
|
10677
|
+
{
|
|
10678
|
+
"name": "documentLocaleSettings",
|
|
10679
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10473
10680
|
}
|
|
10474
10681
|
],
|
|
10475
10682
|
"events": [
|
|
@@ -10522,6 +10729,10 @@
|
|
|
10522
10729
|
"type": "number",
|
|
10523
10730
|
"default": "0"
|
|
10524
10731
|
},
|
|
10732
|
+
{
|
|
10733
|
+
"name": "documentLocaleSettings",
|
|
10734
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10735
|
+
},
|
|
10525
10736
|
{
|
|
10526
10737
|
"name": "arrowKeysDirection",
|
|
10527
10738
|
"type": "string",
|
|
@@ -10567,6 +10778,10 @@
|
|
|
10567
10778
|
"description": "Enables the option to clear a tag list item. The `d2l-tag-list-item-clear` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.",
|
|
10568
10779
|
"type": "boolean",
|
|
10569
10780
|
"default": "false"
|
|
10781
|
+
},
|
|
10782
|
+
{
|
|
10783
|
+
"name": "documentLocaleSettings",
|
|
10784
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10570
10785
|
}
|
|
10571
10786
|
],
|
|
10572
10787
|
"events": [
|
|
@@ -10914,6 +11129,10 @@
|
|
|
10914
11129
|
"description": "Whether content fills the screen or not",
|
|
10915
11130
|
"type": "'fullscreen'|'normal'",
|
|
10916
11131
|
"default": "\"fullscreen\""
|
|
11132
|
+
},
|
|
11133
|
+
{
|
|
11134
|
+
"name": "documentLocaleSettings",
|
|
11135
|
+
"default": "\"getDocumentLocaleSettings()\""
|
|
10917
11136
|
}
|
|
10918
11137
|
],
|
|
10919
11138
|
"events": [
|
package/mixins/localize-mixin.js
CHANGED
|
@@ -11,16 +11,15 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
static documentLocaleSettings = getDocumentLocaleSettings();
|
|
15
|
+
|
|
14
16
|
constructor() {
|
|
15
17
|
super();
|
|
16
|
-
|
|
17
|
-
this.__documentLocaleSettings = getDocumentLocaleSettings();
|
|
18
18
|
this.__resourcesLoadedPromise = new Promise((resolve) => {
|
|
19
19
|
let first = true;
|
|
20
20
|
this.__languageChangeCallback = () => {
|
|
21
21
|
if (!this._hasResources()) return;
|
|
22
|
-
const
|
|
23
|
-
const localizeResources = this.constructor._getAllLocalizeResources(possibleLanguages);
|
|
22
|
+
const localizeResources = this.constructor._getAllLocalizeResources();
|
|
24
23
|
const resourcesLoadedPromise = Promise.all(localizeResources);
|
|
25
24
|
resourcesLoadedPromise
|
|
26
25
|
.then((results) => {
|
|
@@ -45,18 +44,17 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
|
|
|
45
44
|
});
|
|
46
45
|
|
|
47
46
|
this.__updatedProperties = new Map();
|
|
48
|
-
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
connectedCallback() {
|
|
52
50
|
super.connectedCallback();
|
|
53
|
-
this.
|
|
51
|
+
this.constructor.documentLocaleSettings.addChangeListener(this.__languageChangeCallback);
|
|
54
52
|
this.__languageChangeCallback();
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
disconnectedCallback() {
|
|
58
56
|
super.disconnectedCallback();
|
|
59
|
-
this.
|
|
57
|
+
this.constructor.documentLocaleSettings.removeChangeListener(this.__languageChangeCallback);
|
|
60
58
|
this.__updatedProperties.clear();
|
|
61
59
|
}
|
|
62
60
|
|
|
@@ -130,49 +128,30 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
|
|
|
130
128
|
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
_generatePossibleLanguages() {
|
|
134
|
-
const langs = new Set();
|
|
135
|
-
|
|
136
|
-
let docLang = this.__documentLocaleSettings.language;
|
|
137
|
-
if (docLang) {
|
|
138
|
-
docLang = docLang.toLowerCase();
|
|
139
|
-
langs.add(docLang);
|
|
140
|
-
|
|
141
|
-
if (docLang.indexOf('-') !== -1) {
|
|
142
|
-
const baseDocLang = docLang.split('-')[0];
|
|
143
|
-
langs.add(baseDocLang);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let docFallbackLang = this.__documentLocaleSettings.fallbackLanguage;
|
|
148
|
-
if (docFallbackLang) {
|
|
149
|
-
docFallbackLang = docFallbackLang.toLowerCase();
|
|
150
|
-
langs.add(docFallbackLang);
|
|
131
|
+
static _generatePossibleLanguages(config) {
|
|
151
132
|
|
|
152
|
-
|
|
153
|
-
const baseDocFallbackLang = docFallbackLang.split('-')[0];
|
|
154
|
-
langs.add(baseDocFallbackLang);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
133
|
+
if (config?.useBrowserLangs) return navigator.languages.map(e => e.toLowerCase()).concat('en');
|
|
157
134
|
|
|
158
|
-
|
|
159
|
-
langs
|
|
135
|
+
const { language, fallbackLanguage } = this.documentLocaleSettings;
|
|
136
|
+
const langs = [ language, fallbackLanguage ]
|
|
137
|
+
.filter(e => e)
|
|
138
|
+
.map(e => [ e.toLowerCase(), e.split('-')[0] ])
|
|
139
|
+
.flat();
|
|
160
140
|
|
|
161
|
-
return Array.from(langs);
|
|
141
|
+
return Array.from(new Set([ ...langs, 'en-us', 'en' ]));
|
|
162
142
|
}
|
|
163
143
|
|
|
164
|
-
static _getAllLocalizeResources(
|
|
144
|
+
static _getAllLocalizeResources(config = this.localizeConfig) {
|
|
165
145
|
let resourcesLoadedPromises = [];
|
|
166
146
|
const superCtor = Object.getPrototypeOf(this);
|
|
167
147
|
// get imported terms for each config, head up the chain to get them all
|
|
168
148
|
if ('_getAllLocalizeResources' in superCtor) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
resourcesLoadedPromises = superCtor._getAllLocalizeResources(possibleLanguages, superConfig);
|
|
149
|
+
const superConfig = Object.hasOwn(superCtor, 'localizeConfig') && superCtor.localizeConfig.importFunc ? superCtor.localizeConfig : config;
|
|
150
|
+
resourcesLoadedPromises = superCtor._getAllLocalizeResources(superConfig);
|
|
172
151
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const res = this.getLocalizeResources(
|
|
152
|
+
if (Object.hasOwn(this, 'getLocalizeResources') || Object.hasOwn(this, 'resources')) {
|
|
153
|
+
const possibleLanguages = this._generatePossibleLanguages(config);
|
|
154
|
+
const res = this.getLocalizeResources(possibleLanguages, config);
|
|
176
155
|
resourcesLoadedPromises.push(res);
|
|
177
156
|
}
|
|
178
157
|
return resourcesLoadedPromises;
|
package/mixins/localize-mixin.md
CHANGED
|
@@ -77,13 +77,12 @@ class MyComponent extends LocalizeDynamicMixin(LitElement) {
|
|
|
77
77
|
// Import path must be relative
|
|
78
78
|
importFunc: async lang => (await import(`../lang/${lang}.js`)).default,
|
|
79
79
|
// Optionally enable OSLO
|
|
80
|
-
osloCollection: 'my-project\\myComponent',
|
|
80
|
+
osloCollection: '@d2l\\my-project\\myComponent',
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
|
-
|
|
86
|
-
When using this method, depending on various user settings, it's possible that a language file that does not exist will be requested, resulting in a network error (404). In production, your build system should prevent this by transpiling the variable dynamic import into a `switch` statement.
|
|
85
|
+
Occasionally, it may be desirable to localize based on the user's browser settings. To do this, add `useBrowserLangs: true` to your `localizeConfig` object. This option should only be used if *all* supported *locales* have corresponding files named with their 4-character locale code, and all supported *languages*, in addition, have 2-character files. (e.g. `en-us.js`, `en-ca.js` and `en.js`)
|
|
87
86
|
|
|
88
87
|
If your build system does not support variable dynamic imports, you'll need to manually set up imports for each supported language:
|
|
89
88
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.54.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",
|