lightning-base-components 1.17.5-alpha → 1.17.6-alpha

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.17.5-alpha",
3
+ "version": "1.17.6-alpha",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "external",
@@ -1,7 +1,6 @@
1
1
  import { LightningElement } from 'lwc';
2
2
 
3
3
  export default class AriaObserverConnect extends LightningElement {
4
-
5
4
  connectIds = 'foo bar';
6
5
 
7
6
  handleUpdateIds() {
@@ -3,7 +3,6 @@ import { LightningElement, api } from 'lwc';
3
3
  import AriaObserver from 'lightning/ariaObserver';
4
4
 
5
5
  export default class AriaObserverConnectChild extends LightningElement {
6
-
7
6
  constructor() {
8
7
  super();
9
8
  this.ariaObserver = new AriaObserver(this);
@@ -38,8 +37,7 @@ export default class AriaObserverConnectChild extends LightningElement {
38
37
  this.ariaObserver.connect({
39
38
  targetSelector: 'input',
40
39
  attribute: 'aria-labelledby',
41
- id: refs
40
+ id: refs,
42
41
  });
43
42
  }
44
-
45
43
  }
@@ -38,7 +38,7 @@
38
38
  data-container
39
39
  >
40
40
  <lightning-button-icon
41
- class="slds-modal__close"
41
+ class={computedCloseButtonCssClass}
42
42
  icon-name="utility:close"
43
43
  variant={computedCloseButtonVariant}
44
44
  alternative-text={closeButtonAltText}
@@ -332,6 +332,25 @@ export default class LightningModalBase extends LightningElement {
332
332
  return classes.toString();
333
333
  }
334
334
 
335
+ /**
336
+ * Compute the correct lightning-button-icon CSS class to use
337
+ * for the size="full" behaviors, based upon the screen size
338
+ * threshold. Two classes are added for full screen behavior
339
+ * to handle edge cases where customers change background of the
340
+ * modal header so the close button maintains visibility for a11y
341
+ * @private
342
+ */
343
+ get computedCloseButtonCssClass() {
344
+ let classes = classSet('slds-modal__close');
345
+ const fullScreenActive =
346
+ this.isSmallScreenSize && this.size === SIZE_FULL;
347
+ classes.add({
348
+ 'slds-button_icon-border-filled': fullScreenActive,
349
+ 'slds-modal_full-close-button': fullScreenActive,
350
+ });
351
+ return classes.toString();
352
+ }
353
+
335
354
  /**
336
355
  * Compute the correct lightning-button-icon variant to use
337
356
  * for the size="full" behaviors, based upon the screen size
@@ -16,16 +16,6 @@ function isResizeObserverSupported() {
16
16
  return window.ResizeObserver != null;
17
17
  }
18
18
 
19
- function buildResizeObserver(callback) {
20
- if (isResizeObserverSupported()) {
21
- return new ResizeObserver(callback);
22
- }
23
- return {
24
- observe() {},
25
-
26
- unobserve() {},
27
- };
28
- }
29
19
  /**
30
20
  * Shared instance of a primitive bubble used as a tooltip by most components. This was originally
31
21
  * defined in the helptext component which is where the minWidth style came from.
@@ -255,7 +245,7 @@ export class Tooltip {
255
245
 
256
246
  get resizeObserver() {
257
247
  if (!this._resizeObserver) {
258
- this._resizeObserver = buildResizeObserver(() => {
248
+ this._resizeObserver = this._buildResizeObserver(() => {
259
249
  if (this._visible && this._autoPosition) {
260
250
  const tooltip = this._element();
261
251
  /**
@@ -412,4 +402,15 @@ export class Tooltip {
412
402
  this._autoPosition.stop();
413
403
  }
414
404
  }
405
+
406
+ _buildResizeObserver(callback) {
407
+ if (isResizeObserverSupported()) {
408
+ return new ResizeObserver(callback);
409
+ }
410
+ return {
411
+ observe() {},
412
+
413
+ unobserve() {},
414
+ };
415
+ }
415
416
  }