@brightspace-ui/core 3.98.2 → 3.99.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.
@@ -40,6 +40,13 @@
|
|
40
40
|
</template>
|
41
41
|
</d2l-demo-snippet>
|
42
42
|
|
43
|
+
<h2>Hidden Timezone</h2>
|
44
|
+
<d2l-demo-snippet>
|
45
|
+
<template>
|
46
|
+
<d2l-input-time label="Start Time" timezone-hidden></d2l-input-time>
|
47
|
+
</template>
|
48
|
+
</d2l-demo-snippet>
|
49
|
+
|
43
50
|
<h2>Custom Interval</h2>
|
44
51
|
<d2l-demo-snippet>
|
45
52
|
<template>
|
@@ -137,6 +137,7 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
137
137
|
| `labelled-by` | String | HTML id of an element in the same shadow root which acts as the input's label |
|
138
138
|
| `opened` | Boolean | Indicates if the dropdown is open |
|
139
139
|
| `required` | Boolean | Indicates that a value is required |
|
140
|
+
| `timezone-hidden` | Boolean | Hides the timezone inside the selection dropdown. Should only be used when the input uses a different timezone than the document's settings |
|
140
141
|
| `time-interval` | String, default: `thirty` | Number of minutes between times shown in dropdown. Valid values include `five`, `ten`, `fifteen`, `twenty`, `thirty`, and `sixty`. |
|
141
142
|
| `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 timezone](#timezone) (if applicable). |
|
142
143
|
|
@@ -276,7 +277,7 @@ Note: All `*value` properties should be in ISO 8601 combined date and time forma
|
|
276
277
|
|
277
278
|
## Accessibility
|
278
279
|
|
279
|
-
The date and time components generally follow the W3C's best practice recommendations for a [Date picker dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/). For details on the accessibility of the calendar within the date input components, see [Calendar Accessibility](../calendar#accessibility).
|
280
|
+
The date and time components generally follow the W3C's best practice recommendations for a [Date picker dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/). For details on the accessibility of the calendar within the date input components, see [Calendar Accessibility](../calendar#accessibility).
|
280
281
|
|
281
282
|
A few notable accessibility-related features of these components are:
|
282
283
|
|
@@ -3,7 +3,7 @@ import '../dropdown/dropdown-menu.js';
|
|
3
3
|
import '../menu/menu.js';
|
4
4
|
import '../menu/menu-item-radio.js';
|
5
5
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
6
|
+
import { css, html, LitElement, nothing } from 'lit';
|
7
7
|
import { formatDateInISOTime, getDateFromISOTime, getToday } from '../../helpers/dateTime.js';
|
8
8
|
import { formatTime, parseTime } from '@brightspace-ui/intl/lib/dateTime.js';
|
9
9
|
import { bodySmallStyles } from '../typography/styles.js';
|
@@ -164,6 +164,11 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
164
164
|
* @type {'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'}
|
165
165
|
*/
|
166
166
|
timeInterval: { type: String, attribute: 'time-interval' },
|
167
|
+
/**
|
168
|
+
* Hides the timezone inside the selection dropdown. Should only be used when the input uses a different timezone than the document's settings
|
169
|
+
* @type {Boolean}
|
170
|
+
*/
|
171
|
+
timezoneHidden: { type: Boolean, attribute: 'timezone-hidden' },
|
167
172
|
/**
|
168
173
|
* Value of the input
|
169
174
|
* @type {string}
|
@@ -226,6 +231,7 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
226
231
|
this.opened = false;
|
227
232
|
this.required = false;
|
228
233
|
this.timeInterval = 'thirty';
|
234
|
+
this.timezoneHidden = false;
|
229
235
|
this._dropdownFirstOpened = false;
|
230
236
|
this._dropdownId = getUniqueId();
|
231
237
|
this._hiddenContentWidth = '6rem';
|
@@ -371,7 +377,9 @@ class InputTime extends InputInlineHelpMixin(FocusMixin(LabelledMixin(SkeletonMi
|
|
371
377
|
root-view>
|
372
378
|
${menuItems}
|
373
379
|
</d2l-menu>
|
374
|
-
|
380
|
+
${!this.timezoneHidden ? html`
|
381
|
+
<div class="d2l-input-time-timezone d2l-body-small" id="${dropdownIdTimezone}" slot="footer">${this._timezone}</div>
|
382
|
+
` : nothing}
|
375
383
|
</d2l-dropdown-menu>
|
376
384
|
</d2l-dropdown>
|
377
385
|
${this._renderInlineHelp(this._inlineHelpId)}
|
package/custom-elements.json
CHANGED
@@ -7724,6 +7724,12 @@
|
|
7724
7724
|
"type": "'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'",
|
7725
7725
|
"default": "\"thirty\""
|
7726
7726
|
},
|
7727
|
+
{
|
7728
|
+
"name": "timezone-hidden",
|
7729
|
+
"description": "Hides the timezone inside the selection dropdown. Should only be used when the input uses a different timezone than the document's settings",
|
7730
|
+
"type": "Boolean",
|
7731
|
+
"default": "false"
|
7732
|
+
},
|
7727
7733
|
{
|
7728
7734
|
"name": "labelled-by",
|
7729
7735
|
"description": "ACCESSIBILITY: The id of element that provides the label for this element. Use when another visible element should act as the label.",
|
@@ -7806,6 +7812,13 @@
|
|
7806
7812
|
"type": "'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'",
|
7807
7813
|
"default": "\"thirty\""
|
7808
7814
|
},
|
7815
|
+
{
|
7816
|
+
"name": "timezoneHidden",
|
7817
|
+
"attribute": "timezone-hidden",
|
7818
|
+
"description": "Hides the timezone inside the selection dropdown. Should only be used when the input uses a different timezone than the document's settings",
|
7819
|
+
"type": "Boolean",
|
7820
|
+
"default": "false"
|
7821
|
+
},
|
7809
7822
|
{
|
7810
7823
|
"name": "labelledBy",
|
7811
7824
|
"attribute": "labelled-by",
|
package/helpers/mathjax.js
CHANGED
@@ -61,6 +61,16 @@ class HtmlBlockMathRenderer {
|
|
61
61
|
elm.style.height = '0.5rem';
|
62
62
|
});
|
63
63
|
|
64
|
+
// WIRIS outputs bad syntax for empty sub/superscripts, but changing these on write
|
65
|
+
// can be risky. Instead, change them on render to minimize potential damage if this
|
66
|
+
// impacts legitimate usages.
|
67
|
+
if (context.replaceNoneSubSuperScripts) {
|
68
|
+
elem.querySelectorAll('math mmultiscripts > none').forEach(elm => {
|
69
|
+
const mrow = document.createElementNS('http://www.w3.org/1998/Math/MathML', 'mrow');
|
70
|
+
elm.replaceWith(mrow);
|
71
|
+
});
|
72
|
+
}
|
73
|
+
|
64
74
|
// If we're using deferred rendering, we need to create a document structure
|
65
75
|
// within the element so MathJax can appropriately process math.
|
66
76
|
if (!options.noDeferredRendering) elem.innerHTML = `<mjx-doc><mjx-head></mjx-head><mjx-body>${elem.innerHTML}</mjx-body></mjx-doc>`;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.99.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",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"rollup-plugin-copy": "^3",
|
61
61
|
"rollup-plugin-delete": "^3",
|
62
62
|
"sass": "^1",
|
63
|
-
"sinon": "^
|
63
|
+
"sinon": "^20",
|
64
64
|
"stylelint": "^16",
|
65
65
|
"web-component-analyzer": "^2"
|
66
66
|
},
|