@brightspace-ui/core 3.314.0 → 3.314.2

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.
@@ -10,6 +10,7 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { InteractiveMixin } from '../../mixins/interactive/interactive-mixin.js';
12
12
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
13
+ import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
13
14
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
14
15
 
15
16
  export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusive) {
@@ -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 InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
36
+ class InputDateRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(PropertyRequiredMixin(LocalizeCoreElement(LitElement)))))) {
36
37
 
37
38
  static properties = {
38
39
  /**
@@ -75,7 +76,7 @@ class InputDateRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormEleme
75
76
  * ACCESSIBILITY: REQUIRED: Label for the input fieldset that wraps the date inputs
76
77
  * @type {string}
77
78
  */
78
- label: { type: String, reflect: true },
79
+ label: { type: String, reflect: true, required: true },
79
80
  /**
80
81
  * Hides the fieldset label visually. Hidden labels are still read by screen readers so make sure to set an appropriate label.
81
82
  * @type {boolean}
@@ -156,10 +157,6 @@ class InputDateRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormEleme
156
157
 
157
158
  async firstUpdated(changedProperties) {
158
159
  super.firstUpdated(changedProperties);
159
-
160
- if (!this.label) {
161
- console.warn('d2l-input-date-range component requires label text');
162
- }
163
160
  this.shadowRoot.querySelector('d2l-input-date-time-range-to').setParentNode(this);
164
161
  }
165
162
 
@@ -11,6 +11,7 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
11
11
  import { ifDefined } from 'lit/directives/if-defined.js';
12
12
  import { InteractiveMixin } from '../../mixins/interactive/interactive-mixin.js';
13
13
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
14
+ import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
14
15
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
15
16
 
16
17
  function _isSameDate(date1, date2) {
@@ -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 InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
69
+ class InputDateTimeRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormElementMixin(PropertyRequiredMixin(LocalizeCoreElement(LitElement)))))) {
69
70
 
70
71
  static properties = {
71
72
  /**
@@ -108,7 +109,7 @@ class InputDateTimeRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormE
108
109
  * ACCESSIBILITY: REQUIRED: Label for the input fieldset that wraps the date-time inputs
109
110
  * @type {string}
110
111
  */
111
- label: { type: String, reflect: true },
112
+ label: { type: String, reflect: true, required: true },
112
113
  /**
113
114
  * Hides the fieldset label visually. Hidden labels are still read by screen readers so make sure to set an appropriate label.
114
115
  * @type {boolean}
@@ -211,11 +212,6 @@ class InputDateTimeRange extends InteractiveMixin(FocusMixin(SkeletonMixin(FormE
211
212
 
212
213
  async firstUpdated(changedProperties) {
213
214
  super.firstUpdated(changedProperties);
214
-
215
- if (!this.label) {
216
- console.warn('d2l-input-date-time-range component requires label text');
217
- }
218
-
219
215
  this.shadowRoot.querySelector('d2l-input-date-time-range-to').setParentNode(this);
220
216
  }
221
217
 
@@ -26,6 +26,7 @@ export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends su
26
26
  #loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
27
27
  ? new Promise(resolve => {
28
28
  const timeout = setTimeout(() => {
29
+ if (!this.isConnected) return;
29
30
  console.warn(`Failed to load ${this.localName} in ${timeoutMs}ms: resolveLoadingComplete was not called`);
30
31
  }, timeoutMs);
31
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.314.0",
3
+ "version": "3.314.2",
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",