@brightspace-ui/core 2.18.8 → 2.20.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/filter.js +4 -8
- package/components/link/link.js +5 -3
- package/components/switch/README.md +0 -2
- package/components/switch/demo/switch.html +0 -8
- package/components/switch/switch-mixin.js +1 -11
- package/custom-elements.json +0 -22
- package/lang/ar.js +2 -2
- package/lang/cy.js +2 -2
- package/lang/da.js +2 -2
- package/lang/de.js +2 -2
- package/lang/en.js +2 -2
- package/lang/es-es.js +2 -2
- package/lang/es.js +2 -2
- package/lang/fr-fr.js +2 -2
- package/lang/fr.js +2 -2
- package/lang/hi.js +2 -2
- package/lang/ja.js +2 -2
- package/lang/ko.js +2 -2
- package/lang/nl.js +2 -2
- package/lang/pt.js +2 -2
- package/lang/sv.js +2 -2
- package/lang/tr.js +2 -2
- package/lang/zh-cn.js +2 -2
- package/lang/zh-tw.js +2 -2
- package/mixins/demo/localize-test.js +11 -13
- package/mixins/focus-visible-polyfill-mixin.md +1 -1
- package/mixins/localize-mixin.js +5 -4
- package/mixins/localize-mixin.md +11 -0
- package/package.json +1 -1
|
@@ -297,7 +297,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
297
297
|
slot="header"
|
|
298
298
|
@click="${this._handleClearAll}"
|
|
299
299
|
?disabled="${this._totalAppliedCount === 0}"
|
|
300
|
-
description="${this.localize('components.filter.clearAllDescription')}"
|
|
300
|
+
description="${this.text ? this.localize('components.filter.clearAllDescriptionOverride', { filterText: this.text }) : this.localize('components.filter.clearAllDescription')}"
|
|
301
301
|
text="${this.localize('components.filter.clearAll')}">
|
|
302
302
|
</d2l-button-subtle>
|
|
303
303
|
`;
|
|
@@ -309,7 +309,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
309
309
|
<d2l-button-subtle
|
|
310
310
|
@click="${this._handleClear}"
|
|
311
311
|
?disabled="${dimension.loading || dimension.appliedCount === 0}"
|
|
312
|
-
description="${
|
|
312
|
+
description="${this.localize('components.filter.clearDescription', { filterName: dimension.text })}"
|
|
313
313
|
text="${this.localize('components.filter.clear')}">
|
|
314
314
|
</d2l-button-subtle>
|
|
315
315
|
`;
|
|
@@ -485,11 +485,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
485
485
|
this._dispatchChangeEventNow(false);
|
|
486
486
|
this.requestUpdate();
|
|
487
487
|
|
|
488
|
-
|
|
489
|
-
announce(this.localize('components.filter.clearAnnounceSingle'));
|
|
490
|
-
} else {
|
|
491
|
-
announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
|
|
492
|
-
}
|
|
488
|
+
announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
|
|
493
489
|
}
|
|
494
490
|
|
|
495
491
|
_handleClearAll() {
|
|
@@ -504,7 +500,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
504
500
|
this._dispatchChangeEventNow(true);
|
|
505
501
|
this.requestUpdate();
|
|
506
502
|
|
|
507
|
-
announce(this.localize('components.filter.clearAllAnnounce'));
|
|
503
|
+
this.text ? announce(this.localize('components.filter.clearAllAnnounceOverride', { filterText: this.text })) : announce(this.localize('components.filter.clearAllAnnounce'));
|
|
508
504
|
}
|
|
509
505
|
|
|
510
506
|
_handleDimensionDataChange(e) {
|
package/components/link/link.js
CHANGED
|
@@ -2,21 +2,23 @@ import '../colors/colors.js';
|
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
|
+
import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
|
|
5
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
7
|
|
|
7
8
|
export const linkStyles = css`
|
|
8
9
|
.d2l-link, .d2l-link:visited, .d2l-link:active, .d2l-link:link {
|
|
9
10
|
color: var(--d2l-color-celestine);
|
|
10
11
|
cursor: pointer;
|
|
12
|
+
outline-style: none;
|
|
11
13
|
text-decoration: none;
|
|
12
14
|
}
|
|
13
15
|
:host([skeleton]) .d2l-link.d2l-skeletize::before {
|
|
14
16
|
bottom: 0.2rem;
|
|
15
17
|
top: 0.2rem;
|
|
16
18
|
}
|
|
17
|
-
.d2l-link:hover,
|
|
19
|
+
.d2l-link:hover,
|
|
20
|
+
.d2l-link.focus-visible {
|
|
18
21
|
color: var(--d2l-color-celestine-minus-1);
|
|
19
|
-
outline-width: 0;
|
|
20
22
|
text-decoration: underline;
|
|
21
23
|
}
|
|
22
24
|
.d2l-link.d2l-link-main {
|
|
@@ -42,7 +44,7 @@ export const linkStyles = css`
|
|
|
42
44
|
* This component can be used just like the native anchor tag.
|
|
43
45
|
* @slot - The content (e.g., text) that when selected causes navigation
|
|
44
46
|
*/
|
|
45
|
-
class Link extends FocusMixin(LitElement) {
|
|
47
|
+
class Link extends FocusMixin(FocusVisiblePolyfillMixin(LitElement)) {
|
|
46
48
|
|
|
47
49
|
static get properties() {
|
|
48
50
|
return {
|
|
@@ -49,7 +49,6 @@ The `d2l-switch` element is a generic switch with on/off semantics.
|
|
|
49
49
|
| `disabled` | Boolean | Disables the switch |
|
|
50
50
|
| `on` | Boolean | Whether the switch is "on" or "off" |
|
|
51
51
|
| `text-position` | String | Valid values are: `start`, `end` (default), and `hidden` |
|
|
52
|
-
| `tooltip` | String | Text to display in a tooltip for the switch |
|
|
53
52
|
### Events
|
|
54
53
|
|
|
55
54
|
- `change`: dispatched when the `on` property is updated
|
|
@@ -88,7 +87,6 @@ The `d2l-switch-visibility` element is a variant of the generic switch configure
|
|
|
88
87
|
| `disabled` | Boolean | Disabled the switch |
|
|
89
88
|
| `on` | Boolean | Whether the switch is "on" or "off" |
|
|
90
89
|
| `text-position` | String | Valid values are: `start`, `end` (default), and `hidden` |
|
|
91
|
-
| `tooltip` | String | Text to display in a tooltip for the switch |
|
|
92
90
|
|
|
93
91
|
### Events
|
|
94
92
|
|
|
@@ -45,14 +45,6 @@
|
|
|
45
45
|
</template>
|
|
46
46
|
</d2l-demo-snippet>
|
|
47
47
|
|
|
48
|
-
<h2>On/Off (with tooltip)</h2>
|
|
49
|
-
|
|
50
|
-
<d2l-demo-snippet>
|
|
51
|
-
<template>
|
|
52
|
-
<d2l-switch text="Dark Mode" tooltip="Whether dark mode is turned on or off." on></d2l-switch>
|
|
53
|
-
</template>
|
|
54
|
-
</d2l-demo-snippet>
|
|
55
|
-
|
|
56
48
|
<h2>Visibility</h2>
|
|
57
49
|
|
|
58
50
|
<d2l-demo-snippet>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
|
-
import '../tooltip/tooltip.js';
|
|
3
2
|
import { css, html } from 'lit';
|
|
4
3
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
4
|
import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
|
|
@@ -31,12 +30,7 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
|
|
|
31
30
|
* @type {'start'|'end'|'hidden'}
|
|
32
31
|
* @default end
|
|
33
32
|
*/
|
|
34
|
-
textPosition: { type: String, attribute: 'text-position', reflect: true }
|
|
35
|
-
/**
|
|
36
|
-
* The text that is displayed in a tooltip when the switch is hovered over.
|
|
37
|
-
* @type {string}
|
|
38
|
-
*/
|
|
39
|
-
tooltip: { type: String, reflect: true }
|
|
33
|
+
textPosition: { type: String, attribute: 'text-position', reflect: true }
|
|
40
34
|
};
|
|
41
35
|
}
|
|
42
36
|
|
|
@@ -172,7 +166,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
|
|
|
172
166
|
this.labelHidden = false;
|
|
173
167
|
this.on = false;
|
|
174
168
|
this.textPosition = 'end';
|
|
175
|
-
this._switchId = getUniqueId();
|
|
176
169
|
this._textId = getUniqueId();
|
|
177
170
|
}
|
|
178
171
|
|
|
@@ -192,7 +185,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
|
|
|
192
185
|
const text = html`<span id="${this._textId}" class="d2l-switch-text">${this.text}</span>`;
|
|
193
186
|
const textPosition = (this.textPosition === 'start' || this.textPosition === 'hidden'
|
|
194
187
|
? this.textPosition : 'end');
|
|
195
|
-
const tooltip = (this.tooltip ? html`<d2l-tooltip for="${this._switchId}">${this.tooltip}</d2l-tooltip>` : '');
|
|
196
188
|
return html`
|
|
197
189
|
${textPosition === 'start' ? text : ''}
|
|
198
190
|
<div
|
|
@@ -201,7 +193,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
|
|
|
201
193
|
aria-labelledby="${ifDefined(textPosition !== 'hidden' ? this._textId : undefined)}"
|
|
202
194
|
class="d2l-switch-container"
|
|
203
195
|
@click="${this._handleClick}"
|
|
204
|
-
id="${this._switchId}"
|
|
205
196
|
@keydown="${this._handleKeyDown}"
|
|
206
197
|
@keyup="${this._handleKeyUp}"
|
|
207
198
|
role="switch"
|
|
@@ -212,7 +203,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
|
|
|
212
203
|
<div class="d2l-switch-icon-off">${this.offIcon}</div>
|
|
213
204
|
</div>
|
|
214
205
|
</div>
|
|
215
|
-
${tooltip}
|
|
216
206
|
${textPosition === 'end' ? text : ''}
|
|
217
207
|
`;
|
|
218
208
|
}
|
package/custom-elements.json
CHANGED
|
@@ -9358,11 +9358,6 @@
|
|
|
9358
9358
|
"type": "string",
|
|
9359
9359
|
"default": "\"\\\"Visibility\\\"\""
|
|
9360
9360
|
},
|
|
9361
|
-
{
|
|
9362
|
-
"name": "tooltip",
|
|
9363
|
-
"description": "The text that is displayed in a tooltip when the switch is hovered over.",
|
|
9364
|
-
"type": "string"
|
|
9365
|
-
},
|
|
9366
9361
|
{
|
|
9367
9362
|
"name": "disabled",
|
|
9368
9363
|
"description": "Disables the switch from being toggled.",
|
|
@@ -9398,12 +9393,6 @@
|
|
|
9398
9393
|
"type": "string",
|
|
9399
9394
|
"default": "\"\\\"Visibility\\\"\""
|
|
9400
9395
|
},
|
|
9401
|
-
{
|
|
9402
|
-
"name": "tooltip",
|
|
9403
|
-
"attribute": "tooltip",
|
|
9404
|
-
"description": "The text that is displayed in a tooltip when the switch is hovered over.",
|
|
9405
|
-
"type": "string"
|
|
9406
|
-
},
|
|
9407
9396
|
{
|
|
9408
9397
|
"name": "disabled",
|
|
9409
9398
|
"attribute": "disabled",
|
|
@@ -9448,11 +9437,6 @@
|
|
|
9448
9437
|
"description": "REQUIRED: The text that is displayed for the switch label.",
|
|
9449
9438
|
"type": "string"
|
|
9450
9439
|
},
|
|
9451
|
-
{
|
|
9452
|
-
"name": "tooltip",
|
|
9453
|
-
"description": "The text that is displayed in a tooltip when the switch is hovered over.",
|
|
9454
|
-
"type": "string"
|
|
9455
|
-
},
|
|
9456
9440
|
{
|
|
9457
9441
|
"name": "disabled",
|
|
9458
9442
|
"description": "Disables the switch from being toggled.",
|
|
@@ -9487,12 +9471,6 @@
|
|
|
9487
9471
|
"description": "REQUIRED: The text that is displayed for the switch label.",
|
|
9488
9472
|
"type": "string"
|
|
9489
9473
|
},
|
|
9490
|
-
{
|
|
9491
|
-
"name": "tooltip",
|
|
9492
|
-
"attribute": "tooltip",
|
|
9493
|
-
"description": "The text that is displayed in a tooltip when the switch is hovered over.",
|
|
9494
|
-
"type": "string"
|
|
9495
|
-
},
|
|
9496
9474
|
{
|
|
9497
9475
|
"name": "disabled",
|
|
9498
9476
|
"attribute": "disabled",
|
package/lang/ar.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "مسح",
|
|
13
13
|
"components.filter.clearAll": "مسح الكل",
|
|
14
14
|
"components.filter.clearAllAnnounce": "جارٍ مسح كل عوامل التصفية",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "مسح كل عوامل التصفية",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "جارٍ مسح عوامل التصفية لـ: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "جارٍ مسح عوامل التصفية",
|
|
18
19
|
"components.filter.clearDescription": "مسح عوامل التصفية لـ: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "مسح عوامل التصفية",
|
|
20
20
|
"components.filter.loading": "يتم تحميل عوامل التصفية",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, zero {لم يتم تطبيق عوامل تصفية.} one {تم تطبيق عامل تصفية واحد.} other {{number} من عوامل التصفية التي تم تطبيقها.}}",
|
|
22
22
|
"components.filter.filters": "عوامل التصفية",
|
package/lang/cy.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Clirio",
|
|
13
13
|
"components.filter.clearAll": "Clirio’r Cyfan",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Wrthi’n clirio’r holl hidlwyr",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Clirio’r holl hidlwyr",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Wrthi’n clirio hidlwyr ar gyfer: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Wrthi'n clirio hidlwyr",
|
|
18
19
|
"components.filter.clearDescription": "Wrthi’n clirio hidlwyd ar gyfer: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Clirio Hidlwyr",
|
|
20
20
|
"components.filter.loading": "Wrthi’n llwytho hidlyddion",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, zero {Dim hildwyr wedi'u gweithredu.} one {1 hidlydd wedi'i weithredu.} other {{number} hidlydd wedi'u gweithredu.}}",
|
|
22
22
|
"components.filter.filters": "Hidlyddion",
|
package/lang/da.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Ryd",
|
|
13
13
|
"components.filter.clearAll": "Ryd alle",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Rydder alle filtre",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Ryd alle filtre",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Rydder filtre for: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Rydder filtre",
|
|
18
19
|
"components.filter.clearDescription": "Ryd filtre for: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Ryd filtre",
|
|
20
20
|
"components.filter.loading": "Indlæser filtre",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Ingen filtre anvendt.} one {1 filter anvendt.} other {{number} filtre anvendt.}}",
|
|
22
22
|
"components.filter.filters": "Filtre",
|
package/lang/de.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Löschen",
|
|
13
13
|
"components.filter.clearAll": "Alle löschen",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Alle Filter werden gelöscht",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Alle Filter löschen",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Filter für {filterName} werden gelöscht",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Filter werden gelöscht",
|
|
18
19
|
"components.filter.clearDescription": "Filter für {filterName} löschen",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Filter löschen",
|
|
20
20
|
"components.filter.loading": "Filter werden geladen",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Keine Filter angewendet.} one {1 Filter angewendet.} other {{number} Filter angewendet.}}",
|
|
22
22
|
"components.filter.filters": "Filter",
|
package/lang/en.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Clear",
|
|
13
13
|
"components.filter.clearAll": "Clear All",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Clearing all filters",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Clear all filters",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Clearing filters for: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Clearing filters",
|
|
18
19
|
"components.filter.clearDescription": "Clear filters for: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Clear filters",
|
|
20
20
|
"components.filter.loading": "Loading filters",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {No filters applied.} one {1 filter applied.} other {{number} filters applied.}}",
|
|
22
22
|
"components.filter.filters": "Filters",
|
package/lang/es-es.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Borrar",
|
|
13
13
|
"components.filter.clearAll": "Borrar todo",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Borrando todos los filtros",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Borrar todos los filtros",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Borrando filtros para: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Borrando filtros",
|
|
18
19
|
"components.filter.clearDescription": "Borrar filtros para: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Borrar filtros",
|
|
20
20
|
"components.filter.loading": "Cargando filtros",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Sin filtros aplicados.} one {1 filtro aplicado.} other {{number} filtros aplicados.}}",
|
|
22
22
|
"components.filter.filters": "Filtros",
|
package/lang/es.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Borrar",
|
|
13
13
|
"components.filter.clearAll": "Borrar todo",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Borrando todos los filtros",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Borrar todos los filtros",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Borrando filtros para: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Borrando filtros",
|
|
18
19
|
"components.filter.clearDescription": "Borrar filtros para: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Borrar filtros",
|
|
20
20
|
"components.filter.loading": "Cargando filtros",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Sin filtros aplicados.} one {1 filtro aplicado.} other {{number} filtros aplicados.}}",
|
|
22
22
|
"components.filter.filters": "Filtros",
|
package/lang/fr-fr.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Effacer",
|
|
13
13
|
"components.filter.clearAll": "Tout effacer",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Suppression de tous les filtres",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Supprimer tous les filtres",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Suppression des filtres pour : {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Suppression des filtres",
|
|
18
19
|
"components.filter.clearDescription": "Supprimer les filtres pour : {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Supprimer les filtres",
|
|
20
20
|
"components.filter.loading": "Chargement des filtres",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Aucun filtre appliqué.} one {1 filtre appliqué.} other {{number} filtres appliqués.}}",
|
|
22
22
|
"components.filter.filters": "Filtres",
|
package/lang/fr.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Effacer",
|
|
13
13
|
"components.filter.clearAll": "Effacer tout",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Effacement de tous les filtres en cours",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Effacer tous les filtres",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Effacement des filtres pour : {filterName} en cours",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Effacement des filtres en cours",
|
|
18
19
|
"components.filter.clearDescription": "Effacer les filtres pour : {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Effacer les filtres",
|
|
20
20
|
"components.filter.loading": "Chargement des filtres",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Aucun filtre appliqué.} one {1 filtre appliqué.} other {{number} filtres appliqués.}}",
|
|
22
22
|
"components.filter.filters": "Filtres",
|
package/lang/hi.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "साफ़ करें",
|
|
13
13
|
"components.filter.clearAll": "सभी साफ़ करें",
|
|
14
14
|
"components.filter.clearAllAnnounce": "सभी फिल्टर साफ़ किए जा रहे हैं",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "सभी फिल्टर साफ़ करें",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "इसके लिए फ़िल्टर साफ़ हो रहे हैं: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "फ़िल्टर्स साफ़ किए जा रहे हैं",
|
|
18
19
|
"components.filter.clearDescription": "इसके लिए फ़िल्टर्स साफ़ करें: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "फ़िल्टर साफ़ करें",
|
|
20
20
|
"components.filter.loading": "फिल्टर्स लोड किए जा रहे हैं",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {कोई फ़िल्टर लागू नहीं किए गए} one {1 फ़िल्टर लागू किया गया।} other {{number} फ़िल्टर्स लागू किए गए।}}",
|
|
22
22
|
"components.filter.filters": "फ़िल्टर्स",
|
package/lang/ja.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "クリア",
|
|
13
13
|
"components.filter.clearAll": "すべてをクリア",
|
|
14
14
|
"components.filter.clearAllAnnounce": "すべてのフィルタのクリア",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "すべてのフィルターをクリア",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "{filterName} フィルタのクリア",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "フィルタのクリア",
|
|
18
19
|
"components.filter.clearDescription": "{filterName} フィルタのクリア",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "フィルタのクリア",
|
|
20
20
|
"components.filter.loading": "フィルタのロード中",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {フィルタは適用されていません。} other {{number} 個のフィルタが適用されています。}}",
|
|
22
22
|
"components.filter.filters": "フィルタ",
|
package/lang/ko.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "지우기",
|
|
13
13
|
"components.filter.clearAll": "모두 지우기",
|
|
14
14
|
"components.filter.clearAllAnnounce": "모든 필터 지우기",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "모든 필터 지우기",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "{filterName}에 대한 필터 지우기",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "필터 지우기",
|
|
18
19
|
"components.filter.clearDescription": "{filterName}에 대한 필터를 지웁니다.",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "필터 지우기",
|
|
20
20
|
"components.filter.loading": "필터 로드 중",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {적용된 필터 없음.} other {{number}개 필터 적용됨.}}",
|
|
22
22
|
"components.filter.filters": "개 필터",
|
package/lang/nl.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Wissen",
|
|
13
13
|
"components.filter.clearAll": "Alles wissen",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Alle filters wissen",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Alle filters wissen",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Filters wissen voor {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Filters wissen",
|
|
18
19
|
"components.filter.clearDescription": "Filters wissen voor {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Filters wissen",
|
|
20
20
|
"components.filter.loading": "Laden van filters",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Geen filters toegepast.} one {1 filter toegepast.} other {{number} filters toegepast.}}",
|
|
22
22
|
"components.filter.filters": "Filters", // mfv-translated
|
package/lang/pt.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Limpar",
|
|
13
13
|
"components.filter.clearAll": "Limpar tudo",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Limpando todos os filtros",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Limpar todos os filtros",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Limpando filtros para: {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Limpando filtros",
|
|
18
19
|
"components.filter.clearDescription": "Limpar filtros para: {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Limpar filtros",
|
|
20
20
|
"components.filter.loading": "Carregar filtros",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Nenhum filtro aplicado.} one {1 filtro aplicado.} other {{number} filtros aplicados.}}",
|
|
22
22
|
"components.filter.filters": "Filtros",
|
package/lang/sv.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Rensa",
|
|
13
13
|
"components.filter.clearAll": "Rensa alla",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Rensar alla filter",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Rensa alla filter",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "Rensar filter för {filterName}",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Rensar filter",
|
|
18
19
|
"components.filter.clearDescription": "Rensa filter för {filterName}",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Rensa filter",
|
|
20
20
|
"components.filter.loading": "Läser in filter",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Inga filter tillämpade.} one {1 filter tillämpat.} other {{number} filter tillämpade.}}",
|
|
22
22
|
"components.filter.filters": "Filter",
|
package/lang/tr.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "Temizle",
|
|
13
13
|
"components.filter.clearAll": "Tümünü Temizle",
|
|
14
14
|
"components.filter.clearAllAnnounce": "Tüm filtreler temizleniyor",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "Tüm filtreleri temizle",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "{filterName} için filtreler temizleniyor",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "Filtreler temizleniyor",
|
|
18
19
|
"components.filter.clearDescription": "{filterName} için filtreleri temizle",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "Filtreleri temizle",
|
|
20
20
|
"components.filter.loading": "Filtreler yükleniyor",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {Filtre uygulanmadı.} one {1 filtre uygulandı.} other {{number} filtre uygulandı.}}",
|
|
22
22
|
"components.filter.filters": "Filtre",
|
package/lang/zh-cn.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "清除",
|
|
13
13
|
"components.filter.clearAll": "全部清除",
|
|
14
14
|
"components.filter.clearAllAnnounce": "清除所有筛选器",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "清除所有筛选器",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "正在清除筛选器:{ filterName }",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "清除筛选",
|
|
18
19
|
"components.filter.clearDescription": "清除筛选条件:{ filterName }",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "清除筛选",
|
|
20
20
|
"components.filter.loading": "正在加载筛选器",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {未应用筛选器。} other {已应用 {number} 个筛选器。}}",
|
|
22
22
|
"components.filter.filters": "个筛选条件",
|
package/lang/zh-tw.js
CHANGED
|
@@ -12,11 +12,11 @@ export default {
|
|
|
12
12
|
"components.filter.clear": "清除",
|
|
13
13
|
"components.filter.clearAll": "全部清除",
|
|
14
14
|
"components.filter.clearAllAnnounce": "正在清除所有篩選器",
|
|
15
|
+
"components.filter.clearAllAnnounceOverride": "Clearing all filters for: {filterText}",
|
|
15
16
|
"components.filter.clearAllDescription": "清除所有篩選器",
|
|
17
|
+
"components.filter.clearAllDescriptionOverride": "Clear all filters for: {filterText}",
|
|
16
18
|
"components.filter.clearAnnounce": "正在清除 {filterName} 的篩選器",
|
|
17
|
-
"components.filter.clearAnnounceSingle": "正在清除篩選器",
|
|
18
19
|
"components.filter.clearDescription": "清除 {filterName} 的篩選器",
|
|
19
|
-
"components.filter.clearDescriptionSingle": "清除篩選器",
|
|
20
20
|
"components.filter.loading": "正在載入篩選條件",
|
|
21
21
|
"components.filter.filterCountDescription": "{number, plural, =0 {未套用篩選條件。} other {已套用 {number} 項篩選條件。}}",
|
|
22
22
|
"components.filter.filters": "篩選器",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, LitElement } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { LocalizeDynamicMixin } from '../../mixins/localize-dynamic-mixin.js';
|
|
3
3
|
|
|
4
|
-
class LocalizeTest extends
|
|
4
|
+
class LocalizeTest extends LocalizeDynamicMixin(LitElement) {
|
|
5
5
|
|
|
6
6
|
static get properties() {
|
|
7
7
|
return {
|
|
@@ -11,7 +11,7 @@ class LocalizeTest extends LocalizeMixin(LitElement) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
static
|
|
14
|
+
static get localizeConfig() {
|
|
15
15
|
const langResources = {
|
|
16
16
|
'ar': { 'hello': 'مرحبا {name}' },
|
|
17
17
|
'de': { 'hello': 'Hallo {name}' },
|
|
@@ -29,17 +29,15 @@ class LocalizeTest extends LocalizeMixin(LitElement) {
|
|
|
29
29
|
'zh-cn': { 'hello': '你好 {name}' },
|
|
30
30
|
'zh-tw': { 'hello': '你好 {name}' }
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
32
|
+
return {
|
|
33
|
+
importFunc: async lang => {
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
resolve(langResources[lang]);
|
|
37
|
+
}, 50);
|
|
38
|
+
});
|
|
39
39
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return null;
|
|
40
|
+
};
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
render() {
|
|
@@ -18,7 +18,7 @@ import { FocusVisiblePolyfillMixin } from '@brightspace-ui/core/mixins/focus-vis
|
|
|
18
18
|
class MyComponent extends FocusVisiblePolyfillMixin(LitElement) {
|
|
19
19
|
static get styles() {
|
|
20
20
|
return css`
|
|
21
|
-
/* styles to apply when clicked or focused with a
|
|
21
|
+
/* styles to apply when clicked or focused with a keyboard */
|
|
22
22
|
button:hover,
|
|
23
23
|
button:focus {
|
|
24
24
|
background-color: #cccccc;
|
package/mixins/localize-mixin.js
CHANGED
|
@@ -163,12 +163,13 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
static _getAllLocalizeResources(possibleLanguages, config = this.localizeConfig) {
|
|
166
|
-
let resourcesLoadedPromises;
|
|
166
|
+
let resourcesLoadedPromises = [];
|
|
167
167
|
const superCtor = Object.getPrototypeOf(this);
|
|
168
|
+
// get imported terms for each config, head up the chain to get them all
|
|
168
169
|
if ('_getAllLocalizeResources' in superCtor) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
resourcesLoadedPromises =
|
|
170
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
171
|
+
const superConfig = superCtor.hasOwnProperty('localizeConfig') && superCtor.localizeConfig.importFunc ? superCtor.localizeConfig : config;
|
|
172
|
+
resourcesLoadedPromises = superCtor._getAllLocalizeResources(possibleLanguages, superConfig);
|
|
172
173
|
}
|
|
173
174
|
// eslint-disable-next-line no-prototype-builtins
|
|
174
175
|
if (this.hasOwnProperty('getLocalizeResources') || this.hasOwnProperty('resources')) {
|
package/mixins/localize-mixin.md
CHANGED
|
@@ -103,6 +103,17 @@ static get localizeConfig() {
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
**Note:** If using `LocalizeCoreElement` or a mixin that utilizes `LocalizeCoreElement` as well as `LocalizeDynamicMixin` or a mixin that uses `LocalizeDynamicMixin`, `LocalizeDynamicMixin` **must** appear before `LocalizeCoreElement` in the chain. For example:
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
import { LocalizeCoreElement } from '@brightspace-ui/core/helpers/localize-core-element.js';
|
|
110
|
+
import { LocalizeDynamicMixin } from '@brightspace-ui/core/mixins/localize-dynamic-mixin.js';
|
|
111
|
+
|
|
112
|
+
class MyComponent extends LocalizeDynamicMixin(LocalizeCoreElement(LitElement)) {
|
|
113
|
+
...
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
106
117
|
## `localize()`
|
|
107
118
|
|
|
108
119
|
Once your localization resources are available, the `localize()` method is used to localize a piece of text in your `render()` method.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.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",
|