@brightspace-ui/core 3.12.0 → 3.14.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.
@@ -8,6 +8,7 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
8
8
  import { FormElementMixin } from '../form/form-element-mixin.js';
9
9
  import { getUniqueId } from '../../helpers/uniqueId.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
+ import { InteractiveMixin } from '../../mixins/interactive/interactive-mixin.js';
11
12
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
12
13
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
13
14
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
@@ -32,7 +33,7 @@ export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusiv
32
33
  * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
33
34
  * @fires change - Dispatched when there is a change to selected start date or selected end date. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar date format (`YYYY-MM-DD`).
34
35
  */
35
- class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement))))) {
36
+ class InputDateRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement)))))) {
36
37
 
37
38
  static get properties() {
38
39
  return {
@@ -177,7 +178,7 @@ class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
177
178
  const endDateInput = this.shadowRoot && this.shadowRoot.querySelector('.d2l-input-date-range-end');
178
179
  const tooltipStart = (this.validationError && !this.startOpened && !this.childErrors.has(startDateInput)) ? html`<d2l-tooltip align="start" announced for="${this._startInputId}" state="error" class="vdiff-target">${this.validationError}</d2l-tooltip>` : null;
179
180
  const tooltipEnd = (this.validationError && !this.endOpened && !this.childErrors.has(endDateInput)) ? html`<d2l-tooltip align="start" announced for="${this._endInputId}" state="error" class="vdiff-target">${this.validationError}</d2l-tooltip>` : null;
180
- return html`
181
+ return this.renderInteractiveContainer(html`
181
182
  ${tooltipStart}
182
183
  ${tooltipEnd}
183
184
  <d2l-input-fieldset
@@ -230,7 +231,9 @@ class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
230
231
  </d2l-input-date-time-range-to>
231
232
  <slot slot="inline-help" name="inline-help"></slot>
232
233
  </d2l-input-fieldset>
233
- `;
234
+ `,
235
+ this.localize('components.input-date-range.interactive-label'),
236
+ () => { this.shadowRoot.querySelector('d2l-input-date').focus(); });
234
237
  }
235
238
 
236
239
  updated(changedProperties) {
@@ -9,6 +9,7 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
9
9
  import { FormElementMixin } from '../form/form-element-mixin.js';
10
10
  import { getUniqueId } from '../../helpers/uniqueId.js';
11
11
  import { ifDefined } from 'lit/directives/if-defined.js';
12
+ import { InteractiveMixin } from '../../mixins/interactive/interactive-mixin.js';
12
13
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
13
14
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
14
15
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
@@ -65,7 +66,7 @@ export function getShiftedEndDateTime(startValue, endValue, prevStartValue, incl
65
66
  * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
66
67
  * @fires change - Dispatched when there is a change to selected start date-time or selected end date-time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`).
67
68
  */
68
- class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement))))) {
69
+ class InputDateTimeRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement)))))) {
69
70
 
70
71
  static get properties() {
71
72
  return {
@@ -225,7 +226,7 @@ class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMi
225
226
 
226
227
  const tooltipStart = (this.validationError && !this.startOpened && !this.childErrors.has(startDateTimeInput)) ? html`<d2l-tooltip align="start" announced for="${this._startInputId}" position="bottom" state="error" class="vdiff-target">${this.validationError}</d2l-tooltip>` : null;
227
228
  const tooltipEnd = (this.validationError && !this.endOpened && !this.childErrors.has(endDateTimeInput)) ? html`<d2l-tooltip align="start" announced for="${this._endInputId}" position="bottom" state="error" class="vdiff-target">${this.validationError}</d2l-tooltip>` : null;
228
- return html`
229
+ return this.renderInteractiveContainer(html`
229
230
  ${tooltipStart}
230
231
  ${tooltipEnd}
231
232
  <d2l-input-fieldset
@@ -287,7 +288,9 @@ class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMi
287
288
  </d2l-input-date-time-range-to>
288
289
  <slot slot="inline-help" name="inline-help"></slot>
289
290
  </d2l-input-fieldset>
290
- `;
291
+ `,
292
+ this.localize('components.input-date-time-range.interactive-label'),
293
+ () => { this.shadowRoot.querySelector('d2l-input-date-time').focus(); });
291
294
  }
292
295
 
293
296
  updated(changedProperties) {
package/lang/ar.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "لا شيء",
44
44
  "components.input-date-range.endDate": "تاريخ الانتهاء",
45
45
  "components.input-date-range.errorBadInput": "يجب أن يكون تاريخ {startLabel} قبل {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "تاريخ البدء",
47
48
  "components.input-date-time-range-to.to": "إلى",
48
49
  "components.input-date-time-range.endDate": "تاريخ الانتهاء",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "يجب أن يكون التاريخ في {minDate} أو بعده",
54
55
  "components.input-date-time.errorOutsideRange": "يجب أن يكون التاريخ بين {minDate} و{maxDate}",
55
56
  "components.input-date-time.time": "الوقت",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "مسح",
57
59
  "components.input-date.errorMaxDateOnly": "يجب أن يكون التاريخ في {maxDate} أو قبله",
58
60
  "components.input-date.errorMinDateOnly": "يجب أن يكون التاريخ في {minDate} أو بعده",
package/lang/cy.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Dim",
44
44
  "components.input-date-range.endDate": "Dyddiad Dod i Ben",
45
45
  "components.input-date-range.errorBadInput": "Rhaid i {startLabel} fod cyn {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Dyddiad Dechrau",
47
48
  "components.input-date-time-range-to.to": "i",
48
49
  "components.input-date-time-range.endDate": "Dyddiad Dod i Ben",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Rhaid i’r dyddiad fod ar neu ar ôl {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "Rhaid i'r dyddiad fod rhwng {minDate} a {maxDate}",
55
56
  "components.input-date-time.time": "Amser",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Clirio",
57
59
  "components.input-date.errorMaxDateOnly": "Rhaid i’r dyddiad fod cyn neu ar {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "Rhaid i’r dyddiad fod ar neu ar ôl {minDate}",
package/lang/da.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Ingen",
44
44
  "components.input-date-range.endDate": "Slutdato",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} skal være før {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Startdato",
47
48
  "components.input-date-time-range-to.to": "for",
48
49
  "components.input-date-time-range.endDate": "Slutdato",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Datoen skal være den {minDate} eller senere",
54
55
  "components.input-date-time.errorOutsideRange": "Datoen skal være mellem {minDate} og {maxDate}",
55
56
  "components.input-date-time.time": "Tid",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Ryd",
57
59
  "components.input-date.errorMaxDateOnly": "Datoen skal være den {maxDate} eller tidligere",
58
60
  "components.input-date.errorMinDateOnly": "Datoen skal være den {minDate} eller senere",
package/lang/de.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Keine",
44
44
  "components.input-date-range.endDate": "Enddatum",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} muss vor {endLabel} liegen",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Startdatum",
47
48
  "components.input-date-time-range-to.to": "bis",
48
49
  "components.input-date-time-range.endDate": "Enddatum",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Das Datum muss am oder nach dem {minDate} liegen",
54
55
  "components.input-date-time.errorOutsideRange": "Datum muss zwischen {minDate} und {maxDate} liegen",
55
56
  "components.input-date-time.time": "Uhrzeit",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Löschen",
57
59
  "components.input-date.errorMaxDateOnly": "Das Datum muss am oder vor dem {maxDate} liegen",
58
60
  "components.input-date.errorMinDateOnly": "Das Datum muss am oder nach dem {minDate} liegen",
package/lang/en-gb.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "None",
44
44
  "components.input-date-range.endDate": "End Date",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} must be before {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Start Date",
47
48
  "components.input-date-time-range-to.to": "to",
48
49
  "components.input-date-time-range.endDate": "End Date",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Date must be on or after {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "Date must be between {minDate} and {maxDate}",
55
56
  "components.input-date-time.time": "Time",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Clear",
57
59
  "components.input-date.errorMaxDateOnly": "Date must be before or on {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "Date must be on or after {minDate}",
package/lang/en.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "None",
44
44
  "components.input-date-range.endDate": "End Date",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} must be before {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Start Date",
47
48
  "components.input-date-time-range-to.to": "to",
48
49
  "components.input-date-time-range.endDate": "End Date",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Date must be on or after {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "Date must be between {minDate} and {maxDate}",
55
56
  "components.input-date-time.time": "Time",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Clear",
57
59
  "components.input-date.errorMaxDateOnly": "Date must be before or on {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "Date must be on or after {minDate}",
package/lang/es-es.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Ninguno",
44
44
  "components.input-date-range.endDate": "Fecha final",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} debe ser anterior a {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Fecha de inicio",
47
48
  "components.input-date-time-range-to.to": "para",
48
49
  "components.input-date-time-range.endDate": "Fecha final",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "La fecha debe ser {minDate} o posterior",
54
55
  "components.input-date-time.errorOutsideRange": "La fecha debe estar entre el {minDate} y el {maxDate}",
55
56
  "components.input-date-time.time": "Tiempo",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Borrar",
57
59
  "components.input-date.errorMaxDateOnly": "La fecha debe ser {maxDate} o anterior",
58
60
  "components.input-date.errorMinDateOnly": "La fecha debe ser {minDate} o posterior",
package/lang/es.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Ninguno",
44
44
  "components.input-date-range.endDate": "Fecha final",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} debe estar antes de {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Fecha de inicio",
47
48
  "components.input-date-time-range-to.to": "hasta",
48
49
  "components.input-date-time-range.endDate": "Fecha final",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "La fecha debe ser {minDate} o posterior",
54
55
  "components.input-date-time.errorOutsideRange": "La fecha debe estar entre {minDate} y {maxDate}",
55
56
  "components.input-date-time.time": "Hora",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Borrar",
57
59
  "components.input-date.errorMaxDateOnly": "La fecha debe ser {maxDate} o anterior",
58
60
  "components.input-date.errorMinDateOnly": "La fecha debe ser {minDate} o posterior",
package/lang/fr-fr.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Aucune",
44
44
  "components.input-date-range.endDate": "Date de fin",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} doit être antérieur à {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Date de début",
47
48
  "components.input-date-time-range-to.to": "à",
48
49
  "components.input-date-time-range.endDate": "Date de fin",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "La date doit être égale ou postérieure au {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "La date doit être comprise entre {minDate} et {maxDate}",
55
56
  "components.input-date-time.time": "Heure",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Effacer",
57
59
  "components.input-date.errorMaxDateOnly": "La date doit être antérieure ou égale au {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "La date doit être égale ou postérieure au {minDate}",
package/lang/fr.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Aucun",
44
44
  "components.input-date-range.endDate": "Date de fin",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} doit précéder {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Date du début",
47
48
  "components.input-date-time-range-to.to": "à",
48
49
  "components.input-date-time-range.endDate": "Date de fin",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "La date doit être {minDate} ou une date ultérieure",
54
55
  "components.input-date-time.errorOutsideRange": "La date doit être comprise entre {minDate} et {maxDate}",
55
56
  "components.input-date-time.time": "Heure",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Effacer",
57
59
  "components.input-date.errorMaxDateOnly": "La date doit être {maxDate} ou une date antérieure",
58
60
  "components.input-date.errorMinDateOnly": "La date doit être {minDate} ou une date ultérieure",
package/lang/hi.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "कोई नहीं",
44
44
  "components.input-date-range.endDate": "समाप्ति तारीख़",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} {endLabel} से पहले का होना चाहिए",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "प्रारंभ तारीख़",
47
48
  "components.input-date-time-range-to.to": "प्रति",
48
49
  "components.input-date-time-range.endDate": "समाप्ति तारीख़",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "तारीख, {minDate} या उससे बाद की होनी चाहिए",
54
55
  "components.input-date-time.errorOutsideRange": "तारीख़ {minDate} और {maxDate} के बीच होनी चाहिए",
55
56
  "components.input-date-time.time": "समय",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "साफ़ करें",
57
59
  "components.input-date.errorMaxDateOnly": "तारीख, {maxDate} या उससे पहले की होनी चाहिए",
58
60
  "components.input-date.errorMinDateOnly": "तारीख, {minDate} या उससे बाद की होनी चाहिए",
package/lang/ja.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "なし",
44
44
  "components.input-date-range.endDate": "終了日",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} は {endLabel} より前にする必要があります",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "開始日",
47
48
  "components.input-date-time-range-to.to": "~",
48
49
  "components.input-date-time-range.endDate": "終了日",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "日付は {minDate} 以降にする必要があります",
54
55
  "components.input-date-time.errorOutsideRange": "日付は {minDate} から {maxDate} の間にする必要があります",
55
56
  "components.input-date-time.time": "時刻",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "クリア",
57
59
  "components.input-date.errorMaxDateOnly": "日付は {maxDate} 以前にする必要があります",
58
60
  "components.input-date.errorMinDateOnly": "日付は {minDate} 以降にする必要があります",
package/lang/ko.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "없음",
44
44
  "components.input-date-range.endDate": "종료일",
45
45
  "components.input-date-range.errorBadInput": "{startLabel}은(는) {endLabel} 앞에 있어야 합니다",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "시작일",
47
48
  "components.input-date-time-range-to.to": "~",
48
49
  "components.input-date-time-range.endDate": "종료일",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "날짜는 {minDate} 또는 그 이후여야 합니다",
54
55
  "components.input-date-time.errorOutsideRange": "날짜는 {minDate}와 {maxDate} 사이여야 합니다.",
55
56
  "components.input-date-time.time": "시간",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "지우기",
57
59
  "components.input-date.errorMaxDateOnly": "날짜는 {maxDate} 또는 그 이전이어야 합니다",
58
60
  "components.input-date.errorMinDateOnly": "날짜는 {minDate} 또는 그 이후여야 합니다",
package/lang/nl.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Geen",
44
44
  "components.input-date-range.endDate": "Einddatum",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} moet voor {endLabel} liggen",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Startdatum",
47
48
  "components.input-date-time-range-to.to": "tot",
48
49
  "components.input-date-time-range.endDate": "Einddatum",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Datum moet op of na {minDate} liggen",
54
55
  "components.input-date-time.errorOutsideRange": "Datum moet tussen {minDate} en {maxDate} liggen",
55
56
  "components.input-date-time.time": "Tijd",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Wissen",
57
59
  "components.input-date.errorMaxDateOnly": "Datum moet voor of op {maxDate} liggen",
58
60
  "components.input-date.errorMinDateOnly": "Datum moet op of na {minDate} liggen",
package/lang/pt.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Nenhum",
44
44
  "components.input-date-range.endDate": "Data final",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} precisa ser anterior a {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Data de início",
47
48
  "components.input-date-time-range-to.to": "a",
48
49
  "components.input-date-time-range.endDate": "Data final",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "A data deve ser igual ou posterior a {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "A data precisa estar entre {minDate} e {maxDate}",
55
56
  "components.input-date-time.time": "Hora",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Limpar",
57
59
  "components.input-date.errorMaxDateOnly": "A data deve ser anterior ou igual a {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "A data deve ser igual ou posterior a {minDate}",
package/lang/sv.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Inga",
44
44
  "components.input-date-range.endDate": "Slutdatum",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} måste vara före {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Startdatum",
47
48
  "components.input-date-time-range-to.to": "till",
48
49
  "components.input-date-time-range.endDate": "Slutdatum",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Datumet måste vara {minDate} eller senare",
54
55
  "components.input-date-time.errorOutsideRange": "Datumet ska vara mellan {minDate} och {maxDate}",
55
56
  "components.input-date-time.time": "Tid",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Rensa",
57
59
  "components.input-date.errorMaxDateOnly": "Datumet måste vara {maxDate} eller tidigare",
58
60
  "components.input-date.errorMinDateOnly": "Datumet måste vara {minDate} eller senare",
package/lang/tr.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "Yok",
44
44
  "components.input-date-range.endDate": "Bitiş Tarihi",
45
45
  "components.input-date-range.errorBadInput": "{startLabel}, {endLabel} tarihinden önce olmalıdır",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "Başlangıç Tarihi",
47
48
  "components.input-date-time-range-to.to": "Kime",
48
49
  "components.input-date-time-range.endDate": "Bitiş Tarihi",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "Tarih, {minDate} veya sonraki bir tarih olmalıdır",
54
55
  "components.input-date-time.errorOutsideRange": "Tarih, {minDate} ile {maxDate} arasında olmalıdır",
55
56
  "components.input-date-time.time": "Saat",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "Temizle",
57
59
  "components.input-date.errorMaxDateOnly": "Tarih, {maxDate} veya önceki bir tarih olmalıdır",
58
60
  "components.input-date.errorMinDateOnly": "Tarih, {minDate} veya sonraki bir tarih olmalıdır",
package/lang/zh-cn.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "无",
44
44
  "components.input-date-range.endDate": "结束日期",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} 必须早于 {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "开始日期",
47
48
  "components.input-date-time-range-to.to": "至",
48
49
  "components.input-date-time-range.endDate": "结束日期",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "日期必须晚于或等于 {minDate}",
54
55
  "components.input-date-time.errorOutsideRange": "日期必须介于 {minDate} 和 {maxDate} 之间",
55
56
  "components.input-date-time.time": "时间",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "清除",
57
59
  "components.input-date.errorMaxDateOnly": "日期必须早于或等于 {maxDate}",
58
60
  "components.input-date.errorMinDateOnly": "日期必须晚于或等于 {minDate}",
package/lang/zh-tw.js CHANGED
@@ -43,6 +43,7 @@ export default {
43
43
  "components.input-color.none": "無",
44
44
  "components.input-date-range.endDate": "結束日期",
45
45
  "components.input-date-range.errorBadInput": "{startLabel} 必須早於 {endLabel}",
46
+ "components.input-date-range.interactive-label": "Date range input",
46
47
  "components.input-date-range.startDate": "開始日期",
47
48
  "components.input-date-time-range-to.to": "至",
48
49
  "components.input-date-time-range.endDate": "結束日期",
@@ -53,6 +54,7 @@ export default {
53
54
  "components.input-date-time.errorMinDateOnly": "日期必須晚於 {minDate} 或為當日",
54
55
  "components.input-date-time.errorOutsideRange": "日期必須介於 {minDate} 與 {maxDate} 之間",
55
56
  "components.input-date-time.time": "時間",
57
+ "components.input-date-time-range.interactive-label": "Date and time range input",
56
58
  "components.input-date.clear": "清除",
57
59
  "components.input-date.errorMaxDateOnly": "日期必須早於 {maxDate} 或為當日",
58
60
  "components.input-date.errorMinDateOnly": "日期必須晚於 {minDate} 或為當日",
@@ -1,3 +1,4 @@
1
+ import { clearDismissible, setDismissible } from '../../helpers/dismissible.js';
1
2
  import { css, html } from 'lit';
2
3
  import { findComposedAncestor, isComposedAncestor } from '../../helpers/dom.js';
3
4
  import { classMap } from 'lit/directives/class-map.js';
@@ -7,11 +8,6 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
7
8
  import { offscreenStyles } from '../../components/offscreen/offscreen.js';
8
9
  import { RtlMixin } from '../rtl/rtl-mixin.js';
9
10
 
10
- const keyCodes = {
11
- ENTER: 13,
12
- ESCAPE: 27
13
- };
14
-
15
11
  export function isInteractiveDescendant(node) {
16
12
  if (!node) return false;
17
13
  return !!findComposedAncestor(node, node => {
@@ -41,6 +37,7 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
41
37
 
42
38
  constructor() {
43
39
  super();
40
+ this._dismissibleId = null;
44
41
  this._focusingToggle = false;
45
42
  this._hasInteractiveAncestor = false;
46
43
  this._interactive = false;
@@ -55,6 +52,14 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
55
52
  this._hasInteractiveAncestor = (parentGrid !== null);
56
53
  }
57
54
 
55
+ disconnectedCallback() {
56
+ super.disconnectedCallback();
57
+
58
+ if (!this._dismissibleId) return;
59
+ clearDismissible(this._dismissibleId);
60
+ this._dismissibleId = null;
61
+ }
62
+
58
63
  focus() {
59
64
  if (!this.shadowRoot) return;
60
65
  if (this._hasInteractiveAncestor && !this._interactive) this.shadowRoot.querySelector('.interactive-toggle').focus();
@@ -97,20 +102,29 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
97
102
 
98
103
  _handleInteractiveContentFocusIn() {
99
104
  this._interactive = true;
105
+ this._dismissibleId = setDismissible(async() => {
106
+ await this._handleInteractiveExit();
107
+ });
100
108
  }
101
109
 
102
110
  _handleInteractiveContentFocusOut(e) {
103
111
  if (isComposedAncestor(this.shadowRoot.querySelector('.interactive-container-content'), e.relatedTarget)) return;
104
112
  // focus moved out of the interactive content
105
113
  this._interactive = false;
114
+ if (this._dismissibleId) {
115
+ clearDismissible(this._dismissibleId);
116
+ this._dismissibleId = null;
117
+ }
118
+ }
119
+
120
+ async _handleInteractiveExit() {
121
+ this._interactive = false;
122
+ await this.updateComplete;
123
+ this.shadowRoot.querySelector('.interactive-toggle').focus();
106
124
  }
107
125
 
108
126
  async _handleInteractiveKeyDown(e) {
109
- if (this._interactive && e.keyCode === keyCodes.ESCAPE) {
110
- this._interactive = false;
111
- await this.updateComplete;
112
- this.shadowRoot.querySelector('.interactive-toggle').focus();
113
- }
127
+ if (this._interactive && e.keyCode === 9) e.stopPropagation(); // tab
114
128
  }
115
129
 
116
130
  _handleInteractiveToggleBlur() {
@@ -129,9 +143,7 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
129
143
 
130
144
  async _handleInteractiveTrapEndFocus() {
131
145
  // focus moved to trap-end either forwards from contents or backwards from outside - focus interactive toggle
132
- this._interactive = false;
133
- await this.updateComplete;
134
- this.shadowRoot.querySelector('.interactive-toggle').focus();
146
+ await this._handleInteractiveExit();
135
147
  }
136
148
 
137
149
  async _handleInteractiveTrapStartFocus(e) {
@@ -141,9 +153,7 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
141
153
  if (nextFocusable) nextFocusable.focus();
142
154
  } else {
143
155
  // focus moved to trap-start backwards from within contents - toggle to non-interactive and apply focus
144
- this._interactive = false;
145
- await this.updateComplete;
146
- this.shadowRoot.querySelector('.interactive-toggle').focus();
156
+ await this._handleInteractiveExit();
147
157
  }
148
158
  }
149
159
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.12.0",
3
+ "version": "3.14.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",