@brightspace-ui/core 2.145.2 → 2.146.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.
|
@@ -2,10 +2,10 @@ import '../button/button-icon.js';
|
|
|
2
2
|
import '../colors/colors.js';
|
|
3
3
|
import { bodySmallStyles, heading4Styles } from '../typography/styles.js';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import {
|
|
5
|
+
import { formatDate, getDateTimeDescriptor } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
6
|
+
import { formatDateInISO, getClosestValidDate, getDateFromDateObj, getDateFromISODate, getToday, isDateInRange } from '../../helpers/dateTime.js';
|
|
6
7
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
8
|
import { findComposedAncestor } from '../../helpers/dom.js';
|
|
8
|
-
import { formatDate } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
9
9
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
@@ -29,15 +29,13 @@ const keyCodes = {
|
|
|
29
29
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
30
30
|
|
|
31
31
|
let calendarData;
|
|
32
|
-
function getCalendarData(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
calendarData.daysOfWeekIndex.push(i % daysInWeek);
|
|
40
|
-
}
|
|
32
|
+
function getCalendarData() {
|
|
33
|
+
calendarData = {};
|
|
34
|
+
calendarData.descriptor = getDateTimeDescriptor();
|
|
35
|
+
calendarData.firstDayOfWeek = calendarData.descriptor.calendar.firstDayOfWeek;
|
|
36
|
+
calendarData.daysOfWeekIndex = [];
|
|
37
|
+
for (let i = calendarData.firstDayOfWeek; i < calendarData.firstDayOfWeek + daysInWeek; i++) {
|
|
38
|
+
calendarData.daysOfWeekIndex.push(i % daysInWeek);
|
|
41
39
|
}
|
|
42
40
|
return calendarData;
|
|
43
41
|
}
|
|
@@ -339,8 +337,8 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
339
337
|
background-color: var(--d2l-color-gypsum);
|
|
340
338
|
}
|
|
341
339
|
|
|
342
|
-
td:focus button:not(.d2l-calendar-date-selected):hover,
|
|
343
|
-
td:focus button:not(.d2l-calendar-date-selected).d2l-calendar-date-hover {
|
|
340
|
+
td:focus button:not(.d2l-calendar-date-selected):not(:disabled):hover,
|
|
341
|
+
td:focus button:not(.d2l-calendar-date-selected):not(:disabled).d2l-calendar-date-hover {
|
|
344
342
|
box-shadow: 0 0 0 2px var(--d2l-color-gypsum), 0 0 0 4px var(--d2l-color-celestine);
|
|
345
343
|
transition: none;
|
|
346
344
|
}
|
|
@@ -351,8 +349,11 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
351
349
|
|
|
352
350
|
td:focus .d2l-calendar-date {
|
|
353
351
|
border-radius: 0.16rem;
|
|
354
|
-
box-shadow: 0 0 0 2px white, 0 0 0 4px var(--d2l-color-celestine);
|
|
355
352
|
padding: 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
td:focus .d2l-calendar-date:not(:disabled) {
|
|
356
|
+
box-shadow: 0 0 0 2px white, 0 0 0 4px var(--d2l-color-celestine);
|
|
356
357
|
transition: none;
|
|
357
358
|
}
|
|
358
359
|
|
|
@@ -423,8 +424,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
423
424
|
this.addEventListener('blur', () => this._isInitialFocusDate = true);
|
|
424
425
|
|
|
425
426
|
this.addEventListener('d2l-localize-resources-change', () => {
|
|
426
|
-
|
|
427
|
-
getCalendarData(true);
|
|
427
|
+
getCalendarData();
|
|
428
428
|
this.requestUpdate();
|
|
429
429
|
});
|
|
430
430
|
|
|
@@ -6,8 +6,8 @@ import '../icons/icon.js';
|
|
|
6
6
|
import '../tooltip/tooltip.js';
|
|
7
7
|
import './input-text.js';
|
|
8
8
|
import { css, html, LitElement } from 'lit';
|
|
9
|
-
import { formatDate, parseDate } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
10
|
-
import { formatDateInISO, getDateFromISODate,
|
|
9
|
+
import { formatDate, getDateTimeDescriptor, parseDate } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
10
|
+
import { formatDateInISO, getDateFromISODate, getToday } from '../../helpers/dateTime.js';
|
|
11
11
|
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
12
12
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
13
13
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
@@ -165,7 +165,7 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
|
|
|
165
165
|
this._showInfoTooltip = true;
|
|
166
166
|
this._shownValue = '';
|
|
167
167
|
|
|
168
|
-
this._dateTimeDescriptor =
|
|
168
|
+
this._dateTimeDescriptor = getDateTimeDescriptor();
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
static get focusElementSelector() {
|
|
@@ -208,7 +208,7 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
|
|
|
208
208
|
|
|
209
209
|
this.addEventListener('blur', this._handleBlur);
|
|
210
210
|
this.addEventListener('d2l-localize-resources-change', () => {
|
|
211
|
-
this._dateTimeDescriptor =
|
|
211
|
+
this._dateTimeDescriptor = getDateTimeDescriptor();
|
|
212
212
|
this.requestUpdate();
|
|
213
213
|
this.updateComplete.then(() => tryUpdateHiddenContentWidth());
|
|
214
214
|
});
|
|
@@ -164,7 +164,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
164
164
|
border-top: 0;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
.d2l-list-item-content-extend-separators > [slot="control"] {
|
|
167
|
+
:host(:not([_render-expand-collapse-slot])) .d2l-list-item-content-extend-separators > [slot="control"] {
|
|
168
168
|
width: 3rem;
|
|
169
169
|
}
|
|
170
170
|
:host(:not([_has-color-slot])) .d2l-list-item-content-extend-separators > [slot="content"],
|
|
@@ -290,8 +290,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
290
290
|
d2l-selection-input {
|
|
291
291
|
margin: 0.55rem 0.55rem 0.55rem 0;
|
|
292
292
|
}
|
|
293
|
-
.d2l-list-item-content-extend-separators d2l-selection-input {
|
|
294
|
-
margin-
|
|
293
|
+
:host(:not([_render-expand-collapse-slot])) .d2l-list-item-content-extend-separators d2l-selection-input {
|
|
294
|
+
margin-inline-start: 0.9rem;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
d2l-list-item-drag-handle {
|
|
@@ -301,9 +301,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
301
301
|
margin-left: 0.9rem;
|
|
302
302
|
margin-right: 0;
|
|
303
303
|
}
|
|
304
|
-
:host([dir="rtl"]) .d2l-list-item-content-extend-separators d2l-selection-input {
|
|
305
|
-
margin-right: 0.9rem;
|
|
306
|
-
}
|
|
307
304
|
|
|
308
305
|
[slot="outside-control-container"] {
|
|
309
306
|
border: 1px solid transparent;
|
|
@@ -678,11 +675,12 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
678
675
|
backgroundColor: this._hasColorSlot ? this.color : undefined
|
|
679
676
|
};
|
|
680
677
|
|
|
678
|
+
const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color)) ? 'control' : undefined;
|
|
681
679
|
const primaryAction = ((!this.noPrimaryAction && this._renderPrimaryAction) ? this._renderPrimaryAction(this._contentId) : null);
|
|
682
680
|
const tooltipForId = (primaryAction ? this._primaryActionId : (this.selectable ? this._checkboxId : null));
|
|
683
681
|
const innerView = html`
|
|
684
682
|
<d2l-list-item-generic-layout
|
|
685
|
-
align-nested="${ifDefined(
|
|
683
|
+
align-nested="${ifDefined(alignNested)}"
|
|
686
684
|
@focusin="${this._onFocusIn}"
|
|
687
685
|
@focusout="${this._onFocusOut}"
|
|
688
686
|
class="${classMap(classes)}"
|
package/helpers/dateTime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { convertLocalToUTCDateTime, convertUTCToLocalDateTime
|
|
1
|
+
import { convertLocalToUTCDateTime, convertUTCToLocalDateTime } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
2
2
|
|
|
3
3
|
// val is an object containing year, month, date
|
|
4
4
|
export function formatDateInISO(val) {
|
|
@@ -139,12 +139,6 @@ export function getDateNoConversion(value) {
|
|
|
139
139
|
return new Date(parsed.year, parsed.month - 1, parsed.date, parsed.hours, parsed.minutes, parsed.seconds);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
let dateTimeDescriptor = null;
|
|
143
|
-
export function getDateTimeDescriptorShared(refresh) {
|
|
144
|
-
if (!dateTimeDescriptor || refresh) dateTimeDescriptor = getDateTimeDescriptor();
|
|
145
|
-
return dateTimeDescriptor;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
142
|
export function getLocalDateTimeFromUTCDateTime(dateTime) {
|
|
149
143
|
const dateObj = parseISODateTime(dateTime);
|
|
150
144
|
const localDateTime = convertUTCToLocalDateTime(dateObj);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.146.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",
|