@brightspace-ui/core 3.227.6 → 3.227.7

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.
@@ -457,9 +457,8 @@ class Calendar extends LocalizeCoreElement(LitElement) {
457
457
  this._tableInfoId = getUniqueId();
458
458
  getCalendarData();
459
459
  }
460
-
461
- firstUpdated(changedProperties) {
462
- super.firstUpdated(changedProperties);
460
+ connectedCallback() {
461
+ super.connectedCallback();
463
462
 
464
463
  if (this.minValue && this.maxValue && (getDateFromISODate(this.minValue).getTime() > getDateFromISODate(this.maxValue).getTime())) {
465
464
  throw new RangeError('d2l-calendar component expects min-value to be before max-value');
@@ -470,18 +469,15 @@ class Calendar extends LocalizeCoreElement(LitElement) {
470
469
  (node) => { return (node.tagName === 'D2L-DROPDOWN-CONTENT'); }
471
470
  );
472
471
  if (dropdownContent) this._dialog = true;
473
-
474
- this.addEventListener('blur', () => this._isInitialFocusDate = true);
475
-
476
- this.addEventListener('d2l-localize-resources-change', () => {
477
- getCalendarData();
478
- this.requestUpdate();
479
- });
480
-
481
472
  this._today = getDateFromDateObj(getToday());
482
473
  if (this.selectedValue) this._getInitialFocusDate();
483
474
  else this.reset();
475
+ }
484
476
 
477
+ firstUpdated() {
478
+ super.firstUpdated();
479
+ this.addEventListener('blur', this._onBlur.bind(this));
480
+ this.addEventListener('d2l-localize-resources-change', this._onLocalizeResourcesChange.bind(this));
485
481
  }
486
482
 
487
483
  render() {
@@ -686,6 +682,10 @@ class Calendar extends LocalizeCoreElement(LitElement) {
686
682
  this._shownMonth = getNextMonth(this._shownMonth);
687
683
  }
688
684
 
685
+ _onBlur() {
686
+ this._isInitialFocusDate = true;
687
+ }
688
+
689
689
  async _onDateSelected(e) {
690
690
  let selectedDate = e.composedPath()[0];
691
691
  if (selectedDate.tagName === 'BUTTON') selectedDate = selectedDate.parentNode;
@@ -866,6 +866,11 @@ class Calendar extends LocalizeCoreElement(LitElement) {
866
866
  await this._showFocusDateMonth(oldFocusDate, Math.abs(numDaysChange) !== 1);
867
867
  }
868
868
 
869
+ _onLocalizeResourcesChange() {
870
+ getCalendarData();
871
+ this.requestUpdate();
872
+ }
873
+
869
874
  async _onNextMonthButtonClick() {
870
875
  this._monthIncrease();
871
876
  this._triggerMonthChangeAnimations(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.227.6",
3
+ "version": "3.227.7",
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",