@brightspace-ui/core 3.161.0 → 3.162.1
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/calendar/README.md +1 -1
- package/components/inputs/demo/input-time.html +7 -0
- package/components/inputs/docs/input-date-time.md +13 -13
- package/components/inputs/input-date-range.js +1 -1
- package/components/inputs/input-date-time.js +10 -0
- package/components/inputs/input-time-range.js +14 -2
- package/components/inputs/input-time.js +47 -11
- package/components/progress/progress.js +3 -2
- package/custom-elements.json +64 -7
- package/package.json +1 -1
@@ -16,7 +16,7 @@ The `d2l-calendar` component can be used to display a responsively sized calenda
|
|
16
16
|
<!-- docs: start hidden content -->
|
17
17
|
### Properties
|
18
18
|
|
19
|
-
Note: All `*-value` properties should be in ISO 8601 calendar date format (`YYYY-MM-DD`) and should be localized to the user's
|
19
|
+
Note: All `*-value` properties should be in ISO 8601 calendar date format (`YYYY-MM-DD`) and should be localized to the user's time zone (if applicable).
|
20
20
|
|
21
21
|
| Property | Type | Description |
|
22
22
|
|--|--|--|
|
@@ -47,6 +47,13 @@
|
|
47
47
|
</template>
|
48
48
|
</d2l-demo-snippet>
|
49
49
|
|
50
|
+
<h2>Custom Timezone</h2>
|
51
|
+
<d2l-demo-snippet>
|
52
|
+
<template>
|
53
|
+
<d2l-input-time label="Start Time" time-zone-id="America/Vancouver"></d2l-input-time>
|
54
|
+
</template>
|
55
|
+
</d2l-demo-snippet>
|
56
|
+
|
50
57
|
<h2>Custom Interval</h2>
|
51
58
|
<d2l-demo-snippet>
|
52
59
|
<template>
|
@@ -17,7 +17,7 @@ Use date and time inputs to set dates and times in forms. They are available as
|
|
17
17
|
<!-- docs: start dos -->
|
18
18
|
* Use short but descriptive labels like "Start Date" or "Due Date"
|
19
19
|
* Offer reasonable defaults whenever possible
|
20
|
-
* Use date and time values relative to the user's [
|
20
|
+
* Use date and time values relative to the user's [time zone](#time-zone)
|
21
21
|
<!-- docs: end dos -->
|
22
22
|
|
23
23
|
<!-- docs: start donts -->
|
@@ -29,7 +29,7 @@ Use date and time inputs to set dates and times in forms. They are available as
|
|
29
29
|
|
30
30
|
Use the `<d2l-input-date>` component when users need to choose a single date. It consists of a text input field for typing a date and an attached calendar (`<d2l-calendar>`) dropdown. The dropdown opens on click of the text input, or on enter or down arrow press if the text input is focused. It displays the `value` if one is specified, or a placeholder if not, and reflects the selected value when one is selected in the `d2l-calendar` or entered in the text input.
|
31
31
|
|
32
|
-
Note: All `*value` properties should be in ISO 8601 calendar date format (`YYYY-MM-DD`) and should be [localized to the user's
|
32
|
+
Note: All `*value` properties should be in ISO 8601 calendar date format (`YYYY-MM-DD`) and should be [localized to the user's time zone](#time-zone) (if applicable).
|
33
33
|
|
34
34
|
<!-- docs: demo code properties name:d2l-input-date sandboxTitle:'Date Input' align:flex-start autoSize:false size:xlarge -->
|
35
35
|
```html
|
@@ -115,7 +115,7 @@ Note: All `*value` properties should be in ISO 8601 calendar date format (`YYYY-
|
|
115
115
|
|
116
116
|
Use the `<d2l-input-time>` component when users need to enter a time, without a date. The component consists of a text input field for typing a time and an attached dropdown for time selection. The dropdown opens on click of the text input, or on enter or down arrow press if the text input is focused. It displays the `value` if one is specified, or a fallback time if not, and reflects the selected value when one is selected in the dropdown or entered in the text input.
|
117
117
|
|
118
|
-
Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's
|
118
|
+
Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's time zone](#time-zone) (if applicable).
|
119
119
|
|
120
120
|
<!-- docs: demo code properties name:d2l-input-time sandboxTitle:'Time Input' align:flex-start autoSize:false size:large -->
|
121
121
|
```html
|
@@ -140,9 +140,9 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
140
140
|
| `name` | String | Name of the form control. Submitted with the form as part of a name/value pair. |
|
141
141
|
| `opened` | Boolean | Indicates if the dropdown is open |
|
142
142
|
| `required` | Boolean | Indicates that a value is required |
|
143
|
-
| `
|
143
|
+
| `time-zone-hidden` | Boolean | Hides the time zone inside the selection dropdown. Should only be used when the input value is not related to any one timezone |
|
144
144
|
| `time-interval` | String, default: `thirty` | Number of minutes between times shown in dropdown. Valid values include `five`, `ten`, `fifteen`, `twenty`, `thirty`, and `sixty`. |
|
145
|
-
| `value` | String, default `''` | Value of the input. This should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's
|
145
|
+
| `value` | String, default `''` | Value of the input. This should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's time zone](#time-zone) (if applicable). |
|
146
146
|
|
147
147
|
### Events
|
148
148
|
|
@@ -157,7 +157,7 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
157
157
|
|
158
158
|
Use the `<d2l-input-time-range>` component when users need to enter two times in a range, and the date is already known. The component consists of two input-time components - one for the start of a range and one for the end of a range. Values specified for these components (through the `start-value` and/or `end-value` attributes) are displayed if specified, and selected values are reflected.
|
159
159
|
|
160
|
-
Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's
|
160
|
+
Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and should be [localized to the user's time zone](#time-zone) (if applicable).
|
161
161
|
|
162
162
|
<!-- docs: demo code properties name:d2l-input-time-range sandboxTitle:'Time Range Input' align:flex-start autoSize:false size:large -->
|
163
163
|
```html
|
@@ -199,7 +199,7 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
199
199
|
|
200
200
|
Use the `<d2l-input-date-time>` component when users need to enter a single date and time, like a due date. The component consists of a `<d2l-input-date>` and a `<d2l-input-time>` component. The time input only appears once a date is selected. This component displays the `value` if one is specified, and reflects the selected value when one is selected or entered.
|
201
201
|
|
202
|
-
Note: All `*value` properties should be in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`) and in UTC time (i.e., do NOT localize to the user's
|
202
|
+
Note: All `*value` properties should be in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`) and in UTC time (i.e., do NOT localize to the user's time zone).
|
203
203
|
|
204
204
|
<!-- docs: demo code properties name:d2l-input-date-time sandboxTitle:'Date-Time Input' align:flex-start autoSize:false size:xlarge -->
|
205
205
|
```html
|
@@ -219,7 +219,7 @@ Note: All `*value` properties should be in ISO 8601 combined date and time forma
|
|
219
219
|
| `disabled` | Boolean | Disables the input |
|
220
220
|
| `label-hidden` | Boolean | Hides the fieldset label visually |
|
221
221
|
| `labelled-by` | String | HTML id of an element in the same shadow root which acts as the input's label |
|
222
|
-
| `localized` | Boolean | Indicates that any
|
222
|
+
| `localized` | Boolean | Indicates that any time zone localization will be handeld by the consumer and so any values will not be converted from/to UTC |
|
223
223
|
| `max-value` | String | Maximum valid date/time that could be selected by a user |
|
224
224
|
| `min-value` | String | Minimum valid date/time that could be selected by a user |
|
225
225
|
| `name` | String | Name of the form control. Submitted with the form as part of a name/value pair. |
|
@@ -241,7 +241,7 @@ Note: All `*value` properties should be in ISO 8601 combined date and time forma
|
|
241
241
|
|
242
242
|
Use the `<d2l-input-date-time-range>` component when users need to enter two dates and times in a range, like an assignment start and end date/time. The component consists of two input-date-time components - one for the start of a range and one for the end of a range. Values specified for these components (through the `start-value` and/or `end-value` attributes) are displayed if specified, and selected values are reflected.
|
243
243
|
|
244
|
-
Note: All `*value` properties should be in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`) and in UTC time (i.e., do NOT localize to the user's
|
244
|
+
Note: All `*value` properties should be in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`) and in UTC time (i.e., do NOT localize to the user's time zone).
|
245
245
|
|
246
246
|
<!-- docs: demo code properties name:d2l-input-date-time-range sandboxTitle:'Date-Time Range Input' align:flex-start autoSize:false size:xlarge -->
|
247
247
|
```html
|
@@ -294,8 +294,8 @@ A few notable accessibility-related features of these components are:
|
|
294
294
|
|
295
295
|
## Timezone
|
296
296
|
|
297
|
-
The `input-date-time` and `input-date-time-range` components expect input in UTC (`YYYY-MM-DDTHH:mm:ss.sssZ`). These components will convert values automatically to the user's
|
297
|
+
The `input-date-time` and `input-date-time-range` components expect input in UTC (`YYYY-MM-DDTHH:mm:ss.sssZ`). These components will convert values automatically to the user's time zone to display the date/time to them, and then will provide the value back in UTC. No time zone conversions are needed.
|
298
298
|
|
299
|
-
The `input-date`, `input-date-range`, `input-time`, and `input-time-range` components do not handle
|
300
|
-
* `getLocalDateTimeFromUTCDateTime(utcDateTime)` (where `utcDateTime` is the date/time in the format `YYYY-MM-DDTHH:mm:ss.sssZ`) returns the date/time in the format `YYYY-MM-DDTHH:mm:ss.sss` in the user's local
|
301
|
-
* `getUTCDateTimeFromLocalDateTime(localDate, localTime)` (where `localDate` and `localTime` are the date and time in the user's local
|
299
|
+
The `input-date`, `input-date-range`, `input-time`, and `input-time-range` components do not handle time zone and so require the input to be in the user's time zone (if applicable), which corresponds to the user's time zone as specified in their account settings. The consumer of the component will need to handle any necessary UTC to local to UTC conversions. The following methods can be used for these conversions:
|
300
|
+
* `getLocalDateTimeFromUTCDateTime(utcDateTime)` (where `utcDateTime` is the date/time in the format `YYYY-MM-DDTHH:mm:ss.sssZ`) returns the date/time in the format `YYYY-MM-DDTHH:mm:ss.sss` in the user's local time zone
|
301
|
+
* `getUTCDateTimeFromLocalDateTime(localDate, localTime)` (where `localDate` and `localTime` are the date and time in the user's local time zone) returns the date/time in the format `YYYY-MM-DDTHH:mm:ss.sssZ` in UTC
|
@@ -28,7 +28,7 @@ export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusiv
|
|
28
28
|
}
|
29
29
|
|
30
30
|
/**
|
31
|
-
* A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's
|
31
|
+
* A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's time zone if applicable and must be in ISO 8601 calendar date format ("YYYY-MM-DD").
|
32
32
|
* @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
33
|
* @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
34
|
*/
|
@@ -85,6 +85,16 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
|
|
85
85
|
* @type {string}
|
86
86
|
*/
|
87
87
|
timeDefaultValue: { attribute: 'time-default-value', reflect: true, type: String },
|
88
|
+
/**
|
89
|
+
* Timezone identifier for the time input to use.
|
90
|
+
* @type {string}
|
91
|
+
*/
|
92
|
+
timeZoneId: { type: String },
|
93
|
+
/**
|
94
|
+
* Hides the time zone inside the time selection dropdown. Should only be used when the time input value is not related to any one time zone
|
95
|
+
* @type {Boolean}
|
96
|
+
*/
|
97
|
+
timeZoneHidden: { type: Boolean, attribute: 'time-zone-hidden' },
|
88
98
|
/**
|
89
99
|
* Value of the input
|
90
100
|
* @type {string}
|
@@ -34,7 +34,7 @@ function getValidISOTimeAtInterval(val, timeInterval) {
|
|
34
34
|
}
|
35
35
|
|
36
36
|
/**
|
37
|
-
* A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's
|
37
|
+
* A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's time zone if applicable and must be in ISO 8601 time format ("hh:mm:ss").
|
38
38
|
* @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.
|
39
39
|
* @fires change - Dispatched when there is a change to selected start time or selected end time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar time format (`hh:mm:ss`).
|
40
40
|
*/
|
@@ -119,7 +119,17 @@ class InputTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(LocalizeC
|
|
119
119
|
* Number of minutes between times shown in dropdown menu
|
120
120
|
* @type {'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'}
|
121
121
|
*/
|
122
|
-
timeInterval: { attribute: 'time-interval', reflect: true, type: String }
|
122
|
+
timeInterval: { attribute: 'time-interval', reflect: true, type: String },
|
123
|
+
/**
|
124
|
+
* Timezone identifier for the inputs to use.
|
125
|
+
* @type {string}
|
126
|
+
*/
|
127
|
+
timeZoneId: { type: String },
|
128
|
+
/**
|
129
|
+
* Hides the time zone inside the selection dropdowns. Should only be used when the input values are not related to any one time zone
|
130
|
+
* @type {Boolean}
|
131
|
+
*/
|
132
|
+
timeZoneHidden: { type: Boolean, attribute: 'time-zone-hidden' },
|
123
133
|
};
|
124
134
|
}
|
125
135
|
|
@@ -251,6 +261,8 @@ class InputTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(LocalizeC
|
|
251
261
|
?skeleton="${this.skeleton}"
|
252
262
|
slot="left"
|
253
263
|
time-interval="${ifDefined(timeInterval)}"
|
264
|
+
time-zone-id="${ifDefined(this.timeZoneId)}"
|
265
|
+
?time-zone-hidden="${this.timeZoneHidden}"
|
254
266
|
value="${ifDefined(this.startValue)}">
|
255
267
|
</d2l-input-time>
|
256
268
|
<d2l-input-time
|
@@ -2,13 +2,17 @@ import '../dropdown/dropdown.js';
|
|
2
2
|
import '../dropdown/dropdown-menu.js';
|
3
3
|
import '../menu/menu.js';
|
4
4
|
import '../menu/menu-item-radio.js';
|
5
|
+
import '../icons/icon.js';
|
5
6
|
|
6
7
|
import { css, html, LitElement, nothing } from 'lit';
|
7
8
|
import { formatDateInISOTime, getDateFromISOTime, getToday } from '../../helpers/dateTime.js';
|
8
9
|
import { formatTime, parseTime } from '@brightspace-ui/intl/lib/dateTime.js';
|
10
|
+
import { getTimeZoneData, validateTimeZone } from '@brightspace-ui/intl/lib/timeZones.js';
|
9
11
|
import { bodySmallStyles } from '../typography/styles.js';
|
12
|
+
import { classMap } from 'lit/directives/class-map.js';
|
10
13
|
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
11
14
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
15
|
+
import { getDocumentLocaleSettings } from '@brightspace-ui/intl/lib/common.js';
|
12
16
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
13
17
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
14
18
|
import { InputInlineHelpMixin } from './input-inline-help.js';
|
@@ -24,6 +28,8 @@ const START_OF_DAY = new Date(2020, 0, 1, 0, 1, 0);
|
|
24
28
|
const END_OF_DAY = new Date(2020, 0, 1, 23, 59, 59);
|
25
29
|
const INTERVALS = new Map();
|
26
30
|
|
31
|
+
const defaultTimezone = getDocumentLocaleSettings().timezone.identifier || new Intl.DateTimeFormat().timeZone;
|
32
|
+
|
27
33
|
export function getIntervalNumber(size) {
|
28
34
|
switch (size) {
|
29
35
|
case 'five':
|
@@ -164,10 +170,15 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
164
170
|
*/
|
165
171
|
timeInterval: { type: String, attribute: 'time-interval' },
|
166
172
|
/**
|
167
|
-
*
|
173
|
+
* Time zone identifier for the input to use. e.g. America/Toronto. Defaults to the user's account or device time zone setting.
|
174
|
+
* @type {string}
|
175
|
+
*/
|
176
|
+
timeZoneId: { type: String, attribute: 'time-zone-id' },
|
177
|
+
/**
|
178
|
+
* Hides the time zone inside the selection dropdown. Should only be used when the input value is not related to any one timezone
|
168
179
|
* @type {Boolean}
|
169
180
|
*/
|
170
|
-
|
181
|
+
timeZoneHidden: { type: Boolean, attribute: 'time-zone-hidden' },
|
171
182
|
/**
|
172
183
|
* Value of the input
|
173
184
|
* @type {string}
|
@@ -175,7 +186,8 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
175
186
|
value: { type: String },
|
176
187
|
_dropdownFirstOpened: { type: Boolean },
|
177
188
|
_formattedValue: { type: String },
|
178
|
-
_hiddenContentWidth: { type: String }
|
189
|
+
_hiddenContentWidth: { type: String },
|
190
|
+
_timeZone: { state: true },
|
179
191
|
};
|
180
192
|
}
|
181
193
|
|
@@ -202,12 +214,20 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
202
214
|
display: inline-block;
|
203
215
|
vertical-align: top;
|
204
216
|
}
|
205
|
-
.d2l-input-time-
|
217
|
+
.d2l-input-time-time-zone {
|
206
218
|
line-height: 1.8rem;
|
207
219
|
text-align: center;
|
208
220
|
vertical-align: middle;
|
209
221
|
width: auto;
|
210
222
|
}
|
223
|
+
.d2l-input-time-time-zone.d2l-input-time-time-zone-custom {
|
224
|
+
align-items: center;
|
225
|
+
column-gap: 0.3rem;
|
226
|
+
display: flex;
|
227
|
+
font-weight: 700;
|
228
|
+
justify-content: center;
|
229
|
+
}
|
230
|
+
|
211
231
|
.d2l-input-time-hidden-content {
|
212
232
|
font-family: inherit;
|
213
233
|
font-size: 0.8rem;
|
@@ -230,11 +250,11 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
230
250
|
this.opened = false;
|
231
251
|
this.required = false;
|
232
252
|
this.timeInterval = 'thirty';
|
233
|
-
this.
|
253
|
+
this.timeZoneHidden = false;
|
234
254
|
this._dropdownFirstOpened = false;
|
235
255
|
this._dropdownId = getUniqueId();
|
236
256
|
this._hiddenContentWidth = '6rem';
|
237
|
-
this.
|
257
|
+
this.timeZoneId = defaultTimezone;
|
238
258
|
this._inlineHelpId = getUniqueId();
|
239
259
|
}
|
240
260
|
|
@@ -330,8 +350,14 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
330
350
|
const formattedWideTimeAM = formatTime(new Date(2020, 0, 1, 10, 23, 0));
|
331
351
|
const formattedWideTimePM = formatTime(new Date(2020, 0, 1, 23, 23, 0));
|
332
352
|
const opened = this.opened && !this.disabled && !this.skeleton;
|
333
|
-
const dropdownIdTimezone = `${this._dropdownId}-
|
353
|
+
const dropdownIdTimezone = `${this._dropdownId}-time-zone`;
|
334
354
|
const ariaDescribedByIds = `${this._dropdownId ? dropdownIdTimezone : ''} ${this._hasInlineHelp ? this._inlineHelpId : ''}`.trim();
|
355
|
+
const customTimezone = this.timeZoneId !== defaultTimezone;
|
356
|
+
const timeZoneClassMap = {
|
357
|
+
'd2l-input-time-time-zone': true,
|
358
|
+
'd2l-body-small': true,
|
359
|
+
'd2l-input-time-time-zone-custom': customTimezone
|
360
|
+
};
|
335
361
|
|
336
362
|
return html`
|
337
363
|
<div aria-hidden="true" class="d2l-input-time-hidden-content">
|
@@ -376,9 +402,10 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
376
402
|
root-view>
|
377
403
|
${menuItems}
|
378
404
|
</d2l-menu>
|
379
|
-
${!this.
|
380
|
-
|
381
|
-
|
405
|
+
${!this.timeZoneHidden && this._timeZone ? html`<div class=${classMap(timeZoneClassMap)} id="${dropdownIdTimezone}" slot="footer">
|
406
|
+
${customTimezone ? html`<d2l-icon icon="tier1:browser"></d2l-icon>` : nothing}
|
407
|
+
${this._timeZone}
|
408
|
+
</div>` : nothing}
|
382
409
|
</d2l-dropdown-menu>
|
383
410
|
</d2l-dropdown>
|
384
411
|
${this._renderInlineHelp(this._inlineHelpId)}
|
@@ -393,9 +420,18 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
393
420
|
});
|
394
421
|
}
|
395
422
|
|
396
|
-
willUpdate(changedProperties) {
|
423
|
+
async willUpdate(changedProperties) {
|
397
424
|
super.willUpdate(changedProperties);
|
398
425
|
this.style.maxWidth = `calc(${this._hiddenContentWidth} + 1.5rem + 3px)`; // text and icon width + left & right padding + border width + 1
|
426
|
+
|
427
|
+
if ((changedProperties.has('timeZoneId') || changedProperties.has('localize'))) {
|
428
|
+
if (validateTimeZone(this.timeZoneId)) {
|
429
|
+
const tzData = await getTimeZoneData(this.timeZoneId);
|
430
|
+
this._timeZone = tzData.friendlyName;
|
431
|
+
} else {
|
432
|
+
this._timeZone = null;
|
433
|
+
}
|
434
|
+
}
|
399
435
|
}
|
400
436
|
|
401
437
|
getTime() {
|
@@ -49,7 +49,8 @@ class Progress extends LitElement {
|
|
49
49
|
display: block;
|
50
50
|
min-width: 6rem;
|
51
51
|
}
|
52
|
-
:host([hidden])
|
52
|
+
:host([hidden]),
|
53
|
+
.text[hidden] {
|
53
54
|
display: none;
|
54
55
|
}
|
55
56
|
.text {
|
@@ -130,7 +131,7 @@ class Progress extends LitElement {
|
|
130
131
|
const perecentageText = formatPercent(percentage);
|
131
132
|
|
132
133
|
return html`
|
133
|
-
<div class=${classMap(textClasses)} >
|
134
|
+
<div class=${classMap(textClasses)} ?hidden=${(this.labelHidden || !this.label) && this.valueHidden}>
|
134
135
|
<span ?hidden=${this.labelHidden} id="label">${this.label}</span>
|
135
136
|
<span style="font-size: 0;">${getSeparator({ nonBreaking: true })}</span>
|
136
137
|
<span ?hidden=${this.valueHidden}>${perecentageText}</span>
|
package/custom-elements.json
CHANGED
@@ -5556,7 +5556,7 @@
|
|
5556
5556
|
{
|
5557
5557
|
"name": "d2l-input-date-range",
|
5558
5558
|
"path": "./components/inputs/input-date-range.js",
|
5559
|
-
"description": "A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's
|
5559
|
+
"description": "A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's time zone if applicable and must be in ISO 8601 calendar date format (\"YYYY-MM-DD\").",
|
5560
5560
|
"attributes": [
|
5561
5561
|
{
|
5562
5562
|
"name": "end-label",
|
@@ -6093,6 +6093,16 @@
|
|
6093
6093
|
"path": "./components/inputs/input-date-time.js",
|
6094
6094
|
"description": "A component that consists of a \"<d2l-input-date>\" and a \"<d2l-input-time>\" component. The time input only appears once a date is selected. This component displays the \"value\" if one is specified, and reflects the selected value when one is selected or entered.",
|
6095
6095
|
"attributes": [
|
6096
|
+
{
|
6097
|
+
"name": "timeZoneId",
|
6098
|
+
"description": "Timezone identifier for the time input to use.",
|
6099
|
+
"type": "string"
|
6100
|
+
},
|
6101
|
+
{
|
6102
|
+
"name": "time-zone-hidden",
|
6103
|
+
"description": "Hides the time zone inside the time selection dropdown. Should only be used when the time input value is not related to any one time zone",
|
6104
|
+
"type": "Boolean"
|
6105
|
+
},
|
6096
6106
|
{
|
6097
6107
|
"name": "max-value",
|
6098
6108
|
"description": "Maximum valid date/time that could be selected by a user",
|
@@ -6166,6 +6176,18 @@
|
|
6166
6176
|
}
|
6167
6177
|
],
|
6168
6178
|
"properties": [
|
6179
|
+
{
|
6180
|
+
"name": "timeZoneId",
|
6181
|
+
"attribute": "timeZoneId",
|
6182
|
+
"description": "Timezone identifier for the time input to use.",
|
6183
|
+
"type": "string"
|
6184
|
+
},
|
6185
|
+
{
|
6186
|
+
"name": "timeZoneHidden",
|
6187
|
+
"attribute": "time-zone-hidden",
|
6188
|
+
"description": "Hides the time zone inside the time selection dropdown. Should only be used when the time input value is not related to any one time zone",
|
6189
|
+
"type": "Boolean"
|
6190
|
+
},
|
6169
6191
|
{
|
6170
6192
|
"name": "maxValue",
|
6171
6193
|
"attribute": "max-value",
|
@@ -7894,7 +7916,7 @@
|
|
7894
7916
|
{
|
7895
7917
|
"name": "d2l-input-time-range",
|
7896
7918
|
"path": "./components/inputs/input-time-range.js",
|
7897
|
-
"description": "A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's
|
7919
|
+
"description": "A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's time zone if applicable and must be in ISO 8601 time format (\"hh:mm:ss\").",
|
7898
7920
|
"attributes": [
|
7899
7921
|
{
|
7900
7922
|
"name": "end-label",
|
@@ -7913,6 +7935,16 @@
|
|
7913
7935
|
"type": "string",
|
7914
7936
|
"default": "\"\\\"Start Time\\\"\""
|
7915
7937
|
},
|
7938
|
+
{
|
7939
|
+
"name": "timeZoneId",
|
7940
|
+
"description": "Timezone identifier for the inputs to use.",
|
7941
|
+
"type": "string"
|
7942
|
+
},
|
7943
|
+
{
|
7944
|
+
"name": "time-zone-hidden",
|
7945
|
+
"description": "Hides the time zone inside the selection dropdowns. Should only be used when the input values are not related to any one time zone",
|
7946
|
+
"type": "Boolean"
|
7947
|
+
},
|
7916
7948
|
{
|
7917
7949
|
"name": "end-value",
|
7918
7950
|
"description": "Value of the end time input",
|
@@ -8015,6 +8047,18 @@
|
|
8015
8047
|
"type": "string",
|
8016
8048
|
"default": "\"\\\"Start Time\\\"\""
|
8017
8049
|
},
|
8050
|
+
{
|
8051
|
+
"name": "timeZoneId",
|
8052
|
+
"attribute": "timeZoneId",
|
8053
|
+
"description": "Timezone identifier for the inputs to use.",
|
8054
|
+
"type": "string"
|
8055
|
+
},
|
8056
|
+
{
|
8057
|
+
"name": "timeZoneHidden",
|
8058
|
+
"attribute": "time-zone-hidden",
|
8059
|
+
"description": "Hides the time zone inside the selection dropdowns. Should only be used when the input values are not related to any one time zone",
|
8060
|
+
"type": "Boolean"
|
8061
|
+
},
|
8018
8062
|
{
|
8019
8063
|
"name": "endValue",
|
8020
8064
|
"attribute": "end-value",
|
@@ -8180,11 +8224,17 @@
|
|
8180
8224
|
"default": "\"thirty\""
|
8181
8225
|
},
|
8182
8226
|
{
|
8183
|
-
"name": "
|
8184
|
-
"description": "Hides the
|
8227
|
+
"name": "time-zone-hidden",
|
8228
|
+
"description": "Hides the time zone inside the selection dropdown. Should only be used when the input value is not related to any one timezone",
|
8185
8229
|
"type": "Boolean",
|
8186
8230
|
"default": "false"
|
8187
8231
|
},
|
8232
|
+
{
|
8233
|
+
"name": "time-zone-id",
|
8234
|
+
"description": "Time zone identifier for the input to use. e.g. America/Toronto. Defaults to the user's account or device time zone setting.",
|
8235
|
+
"type": "string",
|
8236
|
+
"default": "\"defaultTimezone\""
|
8237
|
+
},
|
8188
8238
|
{
|
8189
8239
|
"name": "labelled-by",
|
8190
8240
|
"description": "ACCESSIBILITY: The id of element that provides the label for this element. Use when another visible element should act as the label.",
|
@@ -8268,12 +8318,19 @@
|
|
8268
8318
|
"default": "\"thirty\""
|
8269
8319
|
},
|
8270
8320
|
{
|
8271
|
-
"name": "
|
8272
|
-
"attribute": "
|
8273
|
-
"description": "Hides the
|
8321
|
+
"name": "timeZoneHidden",
|
8322
|
+
"attribute": "time-zone-hidden",
|
8323
|
+
"description": "Hides the time zone inside the selection dropdown. Should only be used when the input value is not related to any one timezone",
|
8274
8324
|
"type": "Boolean",
|
8275
8325
|
"default": "false"
|
8276
8326
|
},
|
8327
|
+
{
|
8328
|
+
"name": "timeZoneId",
|
8329
|
+
"attribute": "time-zone-id",
|
8330
|
+
"description": "Time zone identifier for the input to use. e.g. America/Toronto. Defaults to the user's account or device time zone setting.",
|
8331
|
+
"type": "string",
|
8332
|
+
"default": "\"defaultTimezone\""
|
8333
|
+
},
|
8277
8334
|
{
|
8278
8335
|
"name": "labelledBy",
|
8279
8336
|
"attribute": "labelled-by",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.162.1",
|
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",
|