@brightspace-ui/core 3.314.1 → 3.314.3
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.
|
@@ -168,9 +168,9 @@ class DemoSnippet extends LitElement {
|
|
|
168
168
|
|
|
169
169
|
// fix script whitespace
|
|
170
170
|
text = setIndent(text.replace(/\t/g, ' '))
|
|
171
|
-
.replace(/( *)<script( type="module")?>([^\n]+?)<\/script>/
|
|
172
|
-
.replace(/( *)<\/script>/
|
|
173
|
-
.replace(/<script( type="module")?>/
|
|
171
|
+
.replace(/( *)<script( type="module")?>([^\n]+?)<\/script>/gi, '$1<script$2>\n$1 $3\n$1</script>') // convert single line scripts to multi-line
|
|
172
|
+
.replace(/( *)<\/script>/gi, '\n$1</script>')
|
|
173
|
+
.replace(/<script( type="module")?>/gi, '<script$1>\n')
|
|
174
174
|
.replace(/(\n *)?<script data-demo-hide(.+?)<\/script>/gis, '');
|
|
175
175
|
|
|
176
176
|
const startTags = new Set([...text.matchAll(/<[^/](.*?)>/g)].map(m => m[0]));
|
|
@@ -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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.314.
|
|
3
|
+
"version": "3.314.3",
|
|
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",
|