@brightspace-ui/core 2.19.1 → 2.21.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.
@@ -422,7 +422,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
422
422
 
423
423
  this.addEventListener('blur', () => this._isInitialFocusDate = true);
424
424
 
425
- this.addEventListener('d2l-localize-behavior-language-changed', () => {
425
+ this.addEventListener('d2l-localize-resources-change', () => {
426
426
  calendarData = null;
427
427
  getCalendarData(true);
428
428
  this.requestUpdate();
@@ -200,7 +200,7 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
200
200
  this._textInput = this.shadowRoot.querySelector('d2l-input-text');
201
201
 
202
202
  this.addEventListener('blur', this._handleBlur);
203
- this.addEventListener('d2l-localize-behavior-language-changed', () => {
203
+ this.addEventListener('d2l-localize-resources-change', () => {
204
204
  this._dateTimeDescriptor = getDateTimeDescriptorShared(true);
205
205
  this.requestUpdate();
206
206
  this.updateComplete.then(() => {
@@ -308,7 +308,7 @@ class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixi
308
308
 
309
309
  firstUpdated(changedProperties) {
310
310
  super.firstUpdated(changedProperties);
311
- this.addEventListener('d2l-localize-behavior-language-changed', () => {
311
+ this.addEventListener('d2l-localize-resources-change', () => {
312
312
  this._descriptor = getNumberDescriptor();
313
313
  if (this._formattedValue.length > 0) {
314
314
  this._updateFormattedValue();
@@ -123,6 +123,7 @@ class InputTextArea extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMi
123
123
  /* mirror dimensions must match textarea - match border + padding */
124
124
  .d2l-input-textarea-mirror {
125
125
  line-height: 1rem;
126
+ overflow: hidden;
126
127
  padding-bottom: 0.5rem;
127
128
  padding-top: 0.5rem;
128
129
  visibility: hidden;
@@ -271,7 +271,7 @@ class InputTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
271
271
  }
272
272
 
273
273
  const hiddenContent = this.shadowRoot.querySelector('.d2l-input-time-hidden-content');
274
- this.addEventListener('d2l-localize-behavior-language-changed', async() => {
274
+ this.addEventListener('d2l-localize-resources-change', async() => {
275
275
  await this.updateComplete;
276
276
  this._formattedValue = formatTime(getDateFromISOTime(this.value));
277
277
  INTERVALS.clear();
@@ -49,7 +49,6 @@ The `d2l-switch` element is a generic switch with on/off semantics.
49
49
  | `disabled` | Boolean | Disables the switch |
50
50
  | `on` | Boolean | Whether the switch is "on" or "off" |
51
51
  | `text-position` | String | Valid values are: `start`, `end` (default), and `hidden` |
52
- | `tooltip` | String | Text to display in a tooltip for the switch |
53
52
  ### Events
54
53
 
55
54
  - `change`: dispatched when the `on` property is updated
@@ -88,7 +87,6 @@ The `d2l-switch-visibility` element is a variant of the generic switch configure
88
87
  | `disabled` | Boolean | Disabled the switch |
89
88
  | `on` | Boolean | Whether the switch is "on" or "off" |
90
89
  | `text-position` | String | Valid values are: `start`, `end` (default), and `hidden` |
91
- | `tooltip` | String | Text to display in a tooltip for the switch |
92
90
 
93
91
  ### Events
94
92
 
@@ -45,14 +45,6 @@
45
45
  </template>
46
46
  </d2l-demo-snippet>
47
47
 
48
- <h2>On/Off (with tooltip)</h2>
49
-
50
- <d2l-demo-snippet>
51
- <template>
52
- <d2l-switch text="Dark Mode" tooltip="Whether dark mode is turned on or off." on></d2l-switch>
53
- </template>
54
- </d2l-demo-snippet>
55
-
56
48
  <h2>Visibility</h2>
57
49
 
58
50
  <d2l-demo-snippet>
@@ -1,5 +1,4 @@
1
1
  import '../colors/colors.js';
2
- import '../tooltip/tooltip.js';
3
2
  import { css, html } from 'lit';
4
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
5
4
  import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
@@ -31,12 +30,7 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
31
30
  * @type {'start'|'end'|'hidden'}
32
31
  * @default end
33
32
  */
34
- textPosition: { type: String, attribute: 'text-position', reflect: true },
35
- /**
36
- * The text that is displayed in a tooltip when the switch is hovered over.
37
- * @type {string}
38
- */
39
- tooltip: { type: String, reflect: true }
33
+ textPosition: { type: String, attribute: 'text-position', reflect: true }
40
34
  };
41
35
  }
42
36
 
@@ -172,7 +166,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
172
166
  this.labelHidden = false;
173
167
  this.on = false;
174
168
  this.textPosition = 'end';
175
- this._switchId = getUniqueId();
176
169
  this._textId = getUniqueId();
177
170
  }
178
171
 
@@ -192,7 +185,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
192
185
  const text = html`<span id="${this._textId}" class="d2l-switch-text">${this.text}</span>`;
193
186
  const textPosition = (this.textPosition === 'start' || this.textPosition === 'hidden'
194
187
  ? this.textPosition : 'end');
195
- const tooltip = (this.tooltip ? html`<d2l-tooltip for="${this._switchId}">${this.tooltip}</d2l-tooltip>` : '');
196
188
  return html`
197
189
  ${textPosition === 'start' ? text : ''}
198
190
  <div
@@ -201,7 +193,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
201
193
  aria-labelledby="${ifDefined(textPosition !== 'hidden' ? this._textId : undefined)}"
202
194
  class="d2l-switch-container"
203
195
  @click="${this._handleClick}"
204
- id="${this._switchId}"
205
196
  @keydown="${this._handleKeyDown}"
206
197
  @keyup="${this._handleKeyUp}"
207
198
  role="switch"
@@ -212,7 +203,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
212
203
  <div class="d2l-switch-icon-off">${this.offIcon}</div>
213
204
  </div>
214
205
  </div>
215
- ${tooltip}
216
206
  ${textPosition === 'end' ? text : ''}
217
207
  `;
218
208
  }
@@ -9358,11 +9358,6 @@
9358
9358
  "type": "string",
9359
9359
  "default": "\"\\\"Visibility\\\"\""
9360
9360
  },
9361
- {
9362
- "name": "tooltip",
9363
- "description": "The text that is displayed in a tooltip when the switch is hovered over.",
9364
- "type": "string"
9365
- },
9366
9361
  {
9367
9362
  "name": "disabled",
9368
9363
  "description": "Disables the switch from being toggled.",
@@ -9398,12 +9393,6 @@
9398
9393
  "type": "string",
9399
9394
  "default": "\"\\\"Visibility\\\"\""
9400
9395
  },
9401
- {
9402
- "name": "tooltip",
9403
- "attribute": "tooltip",
9404
- "description": "The text that is displayed in a tooltip when the switch is hovered over.",
9405
- "type": "string"
9406
- },
9407
9396
  {
9408
9397
  "name": "disabled",
9409
9398
  "attribute": "disabled",
@@ -9448,11 +9437,6 @@
9448
9437
  "description": "REQUIRED: The text that is displayed for the switch label.",
9449
9438
  "type": "string"
9450
9439
  },
9451
- {
9452
- "name": "tooltip",
9453
- "description": "The text that is displayed in a tooltip when the switch is hovered over.",
9454
- "type": "string"
9455
- },
9456
9440
  {
9457
9441
  "name": "disabled",
9458
9442
  "description": "Disables the switch from being toggled.",
@@ -9487,12 +9471,6 @@
9487
9471
  "description": "REQUIRED: The text that is displayed for the switch label.",
9488
9472
  "type": "string"
9489
9473
  },
9490
- {
9491
- "name": "tooltip",
9492
- "attribute": "tooltip",
9493
- "description": "The text that is displayed in a tooltip when the switch is hovered over.",
9494
- "type": "string"
9495
- },
9496
9474
  {
9497
9475
  "name": "disabled",
9498
9476
  "attribute": "disabled",
@@ -35,11 +35,10 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
35
35
  }
36
36
  }
37
37
  this.__resources = resources;
38
+ this._onResourcesChange();
38
39
  if (first) {
39
40
  resolve();
40
41
  first = false;
41
- } else {
42
- this._languageChange();
43
42
  }
44
43
  });
45
44
  };
@@ -183,11 +182,9 @@ export const LocalizeMixin = dedupeMixin(superclass => class extends superclass
183
182
  return this.constructor['getLocalizeResources'] !== undefined;
184
183
  }
185
184
 
186
- _languageChange() {
185
+ _onResourcesChange() {
187
186
  /** @ignore */
188
- this.dispatchEvent(new CustomEvent(
189
- 'd2l-localize-behavior-language-changed', { bubbles: true, composed: true }
190
- ));
187
+ this.dispatchEvent(new CustomEvent('d2l-localize-resources-change'));
191
188
  }
192
189
 
193
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.19.1",
3
+ "version": "2.21.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",