@brightspace-ui/core 3.62.4 → 3.63.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.
@@ -19,8 +19,7 @@ window.D2L.DialogMixin = window.D2L.DialogMixin || {};
19
19
  // https://bugs.webkit.org/show_bug.cgi?id=233320
20
20
  // starting in Chrome 102, all elements inside <dialog>s that are inside shadow roots have null offsetParent
21
21
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1331803
22
- window.D2L.DialogMixin.hasNative = false && (window.HTMLDialogElement !== undefined)
23
- && (navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple') === -1);
22
+ window.D2L.DialogMixin.hasNative = false;
24
23
  if (window.D2L.DialogMixin.preferNative === undefined) {
25
24
  window.D2L.DialogMixin.preferNative = true;
26
25
  }
@@ -77,14 +77,12 @@
77
77
  coreFilter.addEventListener('d2l-filter-change', (e) => {
78
78
  logEvent(e, 'Filter value(s) changed!');
79
79
  });
80
- /* eslint-disable no-console */
81
80
  function logEvent(e, text) {
82
81
  console.group(text);
83
82
  console.log('event', e);
84
83
  if (e.detail) console.log('detail', e.detail);
85
84
  console.groupEnd();
86
85
  }
87
- /* eslint-enable no-console */
88
86
  </script>
89
87
 
90
88
  <h2>Registered to both filters</h2>
@@ -191,14 +191,14 @@
191
191
  <script type="module">
192
192
  document.addEventListener('d2l-filter-change', e => {
193
193
  if (e.detail.dimensions.length === 1) {
194
- console.log(`Filter selection(s) changed for dimension "${e.detail.dimensions[0].dimensionKey}":`, e.detail.dimensions[0].changes); // eslint-disable-line no-console
195
- if (e.detail.dimensions[0].cleared) console.log(`(Dimension "${e.detail.dimensions[0].dimensionKey}" cleared)`); // eslint-disable-line no-console
194
+ console.log(`Filter selection(s) changed for dimension "${e.detail.dimensions[0].dimensionKey}":`, e.detail.dimensions[0].changes);
195
+ if (e.detail.dimensions[0].cleared) console.log(`(Dimension "${e.detail.dimensions[0].dimensionKey}" cleared)`);
196
196
  } else {
197
- console.log('Multiple dimension selections changed:', e.detail.dimensions); // eslint-disable-line no-console
197
+ console.log('Multiple dimension selections changed:', e.detail.dimensions);
198
198
  }
199
199
 
200
200
  if (e.detail.allCleared) {
201
- console.log('(All dimensions cleared)'); // eslint-disable-line no-console
201
+ console.log('(All dimensions cleared)');
202
202
  }
203
203
  });
204
204
 
@@ -66,7 +66,6 @@
66
66
 
67
67
  <script>
68
68
  document.body.addEventListener('d2l-input-search-searched', (e) => {
69
- // eslint-disable-next-line no-console
70
69
  console.log(e);
71
70
  });
72
71
  </script>
@@ -143,7 +143,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
143
143
  const dateObj = parseISODateTime(val);
144
144
  const localDateTime = convertUTCToLocalDateTime(dateObj);
145
145
  this._maxValueLocalized = formatDateInISO(localDateTime);
146
- } catch (e) {
146
+ } catch {
147
147
  this._maxValueLocalized = undefined;
148
148
  }
149
149
  }
@@ -160,7 +160,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
160
160
  const dateObj = parseISODateTime(val);
161
161
  const localDateTime = convertUTCToLocalDateTime(dateObj);
162
162
  this._minValueLocalized = formatDateInISO(localDateTime);
163
- } catch (e) {
163
+ } catch {
164
164
  this._minValueLocalized = undefined;
165
165
  }
166
166
  }
@@ -176,7 +176,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
176
176
  try {
177
177
  getLocalDateTimeFromUTCDateTime(val);
178
178
  this._value = val;
179
- } catch (e) {
179
+ } catch {
180
180
  this._value = '';
181
181
  }
182
182
  }
@@ -371,7 +371,7 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
371
371
  try {
372
372
  const date = parseDate(value);
373
373
  await this._updateValueDispatchEvent(formatDateInISO({ year: date.getFullYear(), month: (parseInt(date.getMonth()) + 1), date: date.getDate() }));
374
- } catch (err) {
374
+ } catch {
375
375
  // leave value the same when invalid input
376
376
  }
377
377
  this._setFormattedValue(); // keep out here in case parseDate is same date, e.g., user adds invalid text to end of parseable date
@@ -205,7 +205,6 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
205
205
  const slot = (event.path || event.composedPath()).find((node) =>
206
206
  node.nodeName === 'SLOT' && ['content'].includes(node.name)
207
207
  );
208
- // eslint-disable-next-line no-console
209
208
  console.warn(`${slot.name} area should not have focusable items in it. Consider using href or creating a custom list-item.`);
210
209
  },
211
210
  capture: true
package/helpers/focus.js CHANGED
@@ -202,7 +202,7 @@ export function isFocusVisibleSupported() {
202
202
  document.head.appendChild(style);
203
203
  style.sheet.insertRule(':focus-visible { color: inherit; }');
204
204
  _isFocusVisibleSupported = true;
205
- } catch (error) {
205
+ } catch {
206
206
  _isFocusVisibleSupported = false;
207
207
  } finally {
208
208
  style.remove();
package/helpers/framed.js CHANGED
@@ -13,7 +13,7 @@ export async function isFramed() {
13
13
  framed = false;
14
14
  return framed;
15
15
  }
16
- } catch (e) {
16
+ } catch {
17
17
  framed = false;
18
18
  return framed;
19
19
  }
@@ -59,7 +59,7 @@ export const AsyncContainerMixin = superclass => class extends superclass {
59
59
  try {
60
60
  await promise;
61
61
  if (this._asyncPromises.indexOf(promise) !== -1) this._asyncCounts.fulfilled++;
62
- } catch (error) {
62
+ } catch {
63
63
  if (this._asyncPromises.indexOf(promise) !== -1) this._asyncCounts.rejected++;
64
64
  } finally {
65
65
  if (this._asyncPromises.indexOf(promise) !== -1) {
@@ -1,7 +1,6 @@
1
1
  import { dedupeMixin } from '@open-wc/dedupe-mixin';
2
2
 
3
3
  export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends superclass {
4
-
5
4
  get loadingComplete() {
6
5
  return this.getLoadingComplete();
7
6
  }
@@ -22,7 +21,6 @@ export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends su
22
21
 
23
22
  #loadingCompleteResolve;
24
23
 
25
- // eslint-disable-next-line sort-class-members/sort-class-members
26
24
  #loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
27
25
  ? new Promise(resolve => this.#loadingCompleteResolve = resolve)
28
26
  : Promise.resolve();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.62.4",
3
+ "version": "3.63.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",
@@ -16,7 +16,7 @@
16
16
  "build": "npm run build:clean && npm run build:icons && npm run build:illustrations && npm run build:sass && npm run build:wca",
17
17
  "build-static": "rollup -c ./rollup/rollup.config.js",
18
18
  "lint": "npm run lint:eslint && npm run lint:style",
19
- "lint:eslint": "eslint . --ext .js,.html --ignore-path .gitignore",
19
+ "lint:eslint": "eslint .",
20
20
  "lint:style": "stylelint \"**/*.{js,html}\" --ignore-path .gitignore",
21
21
  "start": "web-dev-server --node-resolve --watch --open",
22
22
  "test": "npm run lint && npm run test:translations && npm run test:unit && npm run test:axe",
@@ -47,13 +47,16 @@
47
47
  "devDependencies": {
48
48
  "@brightspace-ui/stylelint-config": "^1",
49
49
  "@brightspace-ui/testing": "^1",
50
+ "@eslint/compat": "^1",
51
+ "@eslint/eslintrc": "^3",
52
+ "@eslint/js": "^9",
50
53
  "@rollup/plugin-dynamic-import-vars": "^2",
51
54
  "@rollup/plugin-node-resolve": "^15",
52
55
  "@rollup/plugin-replace": "^6",
53
56
  "@web/dev-server": "^0.4",
54
57
  "chalk": "^5",
55
- "eslint": "^8",
56
- "eslint-config-brightspace": "^1",
58
+ "eslint": "^9",
59
+ "eslint-config-brightspace": "^1.2.1",
57
60
  "glob-all": "^3",
58
61
  "messageformat-validator": "^2",
59
62
  "node-sass": "^9",
@@ -1066,7 +1066,7 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
1066
1066
  const key = computeSizeKey(this.storageKey);
1067
1067
  try {
1068
1068
  localStorage.setItem(key, this._size);
1069
- } catch (ex) {
1069
+ } catch {
1070
1070
  // throws if storage is full or in private mode in mobile Safari
1071
1071
  }
1072
1072
  }
@@ -1146,7 +1146,7 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
1146
1146
  const key = computeSizeKey(this.storageKey);
1147
1147
  try {
1148
1148
  size = parseFloat(localStorage.getItem(key));
1149
- } catch (ex) {
1149
+ } catch {
1150
1150
  // may throw SecurityError if localStorage isn't allowed to be accessed
1151
1151
  }
1152
1152
  }