lightning-base-components 1.18.5-alpha → 1.18.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.
Files changed (31) hide show
  1. package/package.json +3 -2
  2. package/src/lightning/button/button.js +3 -2
  3. package/src/lightning/f6Controller/f6Controller.js +49 -3
  4. package/src/lightning/formattedRichText/formatted-rich-text.slds.css +1 -1
  5. package/src/lightning/formattedRichText/formattedRichText.css +1 -0
  6. package/src/lightning/formattedRichText/formattedRichText.html +1 -1
  7. package/src/lightning/formattedRichText/formattedRichText.js +1 -0
  8. package/src/lightning/layout/layout.js +2 -0
  9. package/src/lightning/layoutItem/layoutItem.js +2 -0
  10. package/src/lightning/primitiveButton/primitiveButton.js +8 -8
  11. package/src/lightning/sldsCommon/sldsCommon.css +14 -6
  12. package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +4 -4
  13. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +50 -19
  14. package/src/lightning/spinner/spinner.js +7 -3
  15. package/src/lightning/tab/tab.js +14 -22
  16. package/src/lightning/tabset/tabset.js +10 -28
  17. package/src/lightning/toast/button-icon.slds.css +909 -0
  18. package/src/lightning/toast/formatted-rich-text.slds.css +230 -0
  19. package/src/lightning/toast/icon.slds.css +209 -0
  20. package/src/lightning/toast/toast.css +22 -6
  21. package/src/lightning/toast/toast.html +1 -1
  22. package/src/lightning/toast/toast.js +9 -7
  23. package/src/lightning/toast/toast.slds.css +97 -0
  24. package/src/lightning/toastContainer/toast.slds.css +97 -0
  25. package/src/lightning/toastContainer/toastContainer.css +17 -6
  26. package/src/lightning/toastContainer/toastContainer.js +4 -0
  27. package/src/lightning/utilsPrivate/url.js +4 -1
  28. package/src/lightning/utilsPrivate/utilsPrivate.js +8 -4
  29. package/src/lightning/tab/tab.css +0 -2
  30. package/src/lightning/tab/tab.slds.css +0 -47
  31. package/src/lightning/tabset/tabset.css +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.18.5-alpha",
3
+ "version": "1.18.6-alpha",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "external",
@@ -1306,8 +1306,9 @@
1306
1306
  "lightning-radio-group",
1307
1307
  "lightning-select",
1308
1308
  "lightning-spinner",
1309
- "lightning-tab",
1310
1309
  "lightning-tab-bar",
1310
+ "lightning-toast",
1311
+ "lightning-toast-container",
1311
1312
  "lightning-timepicker",
1312
1313
  "lightning-vertical-navigation",
1313
1314
  "lightning-vertical-navigation-section"
@@ -4,6 +4,7 @@ import {
4
4
  normalizeString as normalize,
5
5
  normalizeBoolean,
6
6
  reflectAttribute,
7
+ isCSR,
7
8
  } from 'lightning/utilsPrivate';
8
9
  import LightningPrimitiveButton from 'lightning/primitiveButton';
9
10
  import template from './button.html';
@@ -230,7 +231,7 @@ export default class LightningButton extends LightningPrimitiveButton {
230
231
  }
231
232
 
232
233
  get button() {
233
- return this.template.querySelector('button');
234
+ return isCSR ? this.template.querySelector('button') : null;
234
235
  }
235
236
 
236
237
  /**
@@ -240,7 +241,7 @@ export default class LightningButton extends LightningPrimitiveButton {
240
241
  connectedCallback() {
241
242
  // Set `data-render-mode` attribute in native shadow mode
242
243
  if (!this.template.synthetic) {
243
- this.template.host.setAttribute('data-render-mode', 'shadow');
244
+ this.setAttribute('data-render-mode', 'shadow');
244
245
  }
245
246
  if (!this._connected) {
246
247
  reflectAttribute(this, 'variant', this._normalizedVariant);
@@ -5,6 +5,7 @@ const DEBOUNCE_KEY_DOWN = 300;
5
5
  export const DEFAULT_CONFIG = {
6
6
  navKey: 'F6',
7
7
  f6RegionAttribute: 'data-f6-region',
8
+ f6RegionHighlightClass: 'f6-highlight',
8
9
  };
9
10
 
10
11
  /**
@@ -33,7 +34,7 @@ export const getActiveElement = (element) => {
33
34
  * quickly move to designated regions in a page.
34
35
  * It handles logic for:
35
36
  * - Globally detecting F6 regions (i.e. registered components must have the data attribute stored in config - f6RegionAttribute
36
- * in their tag, by default, 'data-f6-region')
37
+ * in their tag, by default, 'data-f6-region')
37
38
  * - Handling F6 keypresses by focusing and highlighting F6 regions
38
39
  * Supported keyboard shortcuts:
39
40
  * - Ctrl/Cmd + F6 to move focus to the next available registered region.
@@ -71,10 +72,32 @@ export class F6Controller {
71
72
  appendStyleElement() {
72
73
  // all F6 regions must be position relative.
73
74
  this._styleElement = document.createElement('style');
74
- this._styleElement.innerText = `[${this.config.f6RegionAttribute}]:focus-within { position: relative; outline: rgb(94, 158, 214) 3px solid; outline-offset: 3px; z-index: 9999;}`;
75
+ const selector = `[${this.config.f6RegionAttribute}].${this.config.f6RegionHighlightClass}`;
76
+ this._styleElement.innerText = `${selector} { position: relative; } ${selector}::after { width: 100%; height: 100%; content: ''; outline: rgb(94, 158, 214) 3px solid; outline-offset: -3px; position: absolute; top: 0; left: 0; z-index: 9999; }`;
75
77
  this._styleElement.setAttribute('type', 'text/css');
76
78
  document.head.appendChild(this._styleElement);
77
79
  }
80
+
81
+ /**
82
+ * Clears all regions of outlines.
83
+ */
84
+ clearRegionHighlights() {
85
+ if (!this.regions || !this.regions.length) {
86
+ return;
87
+ }
88
+ this.regions.forEach((region) => {
89
+ region.classList.remove(this.config.f6RegionHighlightClass);
90
+ });
91
+ }
92
+
93
+ /**
94
+ * Outlines the given element with a dashed line.
95
+ * @param {Element} element, element to highlight
96
+ */
97
+ addRegionHighlight(element) {
98
+ element.classList.add(this.config.f6RegionHighlightClass);
99
+ }
100
+
78
101
  /**
79
102
  * Find the first focusable element inside of the input element.
80
103
  * If no focusable element, set the input element to be focusable.
@@ -130,7 +153,9 @@ export class F6Controller {
130
153
  if (adjacentRegionIndex === -1) {
131
154
  return;
132
155
  }
133
- this.focusIn(this.regions[adjacentRegionIndex]);
156
+ const regionToFocus = this.regions[adjacentRegionIndex];
157
+ this.focusIn(regionToFocus);
158
+ this.addRegionHighlight(regionToFocus);
134
159
  }
135
160
 
136
161
  /**
@@ -320,6 +345,7 @@ export class F6Controller {
320
345
  */
321
346
  initialize(config = {}) {
322
347
  document.addEventListener('keydown', this._debounceKeyDownHandler);
348
+ document.addEventListener('click', this.handleClick);
323
349
  this.regions = [];
324
350
  this.config = {
325
351
  ...this.config,
@@ -331,6 +357,7 @@ export class F6Controller {
331
357
  /** Removes the event listeners bound in initialize(). */
332
358
  cleanUp() {
333
359
  document.removeEventListener('keydown', this._debounceKeyDownHandler);
360
+ document.removeEventListener('click', this.handleClick);
334
361
  this._regions = [];
335
362
  this._config = DEFAULT_CONFIG;
336
363
  this._debounceKeyDownHandler = null;
@@ -340,12 +367,17 @@ export class F6Controller {
340
367
  }
341
368
  }
342
369
 
370
+ handleClick = () => {
371
+ this.clearRegionHighlights();
372
+ };
373
+
343
374
  /**
344
375
  * handle document keydown event, move focus to the adjacent region if it detects CTRL/CMD + F6
345
376
  * @param {KeyDown} event
346
377
  */
347
378
 
348
379
  handleKeyDown = (event) => {
380
+ this.clearRegionHighlights();
349
381
  const { key, ctrlKey, metaKey } = event;
350
382
  if (key === this.config.navKey && (ctrlKey || metaKey)) {
351
383
  this.populateRegions();
@@ -371,6 +403,10 @@ export class F6Controller {
371
403
 
372
404
  return NodeFilter.FILTER_SKIP;
373
405
  };
406
+
407
+ getConfig() {
408
+ return Object.freeze(this.config);
409
+ }
374
410
  }
375
411
 
376
412
  let f6Controller;
@@ -380,3 +416,13 @@ export const createF6Controller = (config) => {
380
416
  }
381
417
  return f6Controller;
382
418
  };
419
+
420
+ export const getCurrentRegionAttributeName = () => {
421
+ if (f6Controller) {
422
+ const config = f6Controller.getConfig();
423
+ if (config) {
424
+ return config.f6RegionAttribute;
425
+ }
426
+ }
427
+ return undefined;
428
+ };
@@ -1,6 +1,6 @@
1
1
 
2
2
  :host([data-render-mode="shadow"].slds-rich-text-editor__output) {
3
- line-height: var(--sds-g-line-height);
3
+ line-height: var(--sds-g-font-lineheight, 1.5);
4
4
  overflow-wrap: break-word;
5
5
  word-wrap: break-word;
6
6
  -webkit-hyphens: manual;
@@ -1,2 +1,3 @@
1
1
  @import 'lightning/sldsCommon';
2
2
  @import './formatted-rich-text.slds.css';
3
+ @import 'lightning/sldsUtilsThemes';
@@ -1,4 +1,4 @@
1
1
  <template>
2
2
  <!-- Container for rich text -->
3
- <span lwc:dom="manual"></span>
3
+ <span lwc:dom="manual" part="formatted-rich-text"></span>
4
4
  </template>
@@ -14,6 +14,7 @@ import {
14
14
  * Other tags and attributes are removed and only their text content is displayed.
15
15
  */
16
16
  export default class LightningFormattedRichText extends LightningShadowBaseClass {
17
+ static validationOptOut = ['class'];
17
18
  /**
18
19
  * If present, the component does not create links in the rich text.
19
20
  * @type {boolean}
@@ -13,6 +13,8 @@ import { normalizeBoolean } from 'lightning/utilsPrivate';
13
13
  * Represents a responsive grid system for arranging containers on a page.
14
14
  */
15
15
  export default class LightningLayout extends LightningShadowBaseClass {
16
+ static validationOptOut = ['class'];
17
+
16
18
  /**
17
19
  * Determines how to spread the layout items horizontally.
18
20
  * The alignment options are center, space, spread, and end.
@@ -15,6 +15,8 @@ import {
15
15
  * @slot default Placeholder for your content in lightning-layout-item.
16
16
  */
17
17
  export default class LightningLayoutItem extends LightningShadowBaseClass {
18
+ static validationOptOut = ['class'];
19
+
18
20
  /**
19
21
  * Make the item fluid so that it absorbs any extra space in its
20
22
  * container or shrinks when there is less space. Allowed values are:
@@ -2,6 +2,7 @@ import { api, track } from 'lwc';
2
2
  import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
3
3
  import {
4
4
  isIE11,
5
+ isCSR,
5
6
  normalizeBoolean,
6
7
  normalizeString,
7
8
  buttonGroupOrderClass,
@@ -149,7 +150,7 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
149
150
  @api
150
151
  set ariaControls(value) {
151
152
  this.originalAriaControls = value;
152
- this.template.host.setAttribute('aria-controls', value);
153
+ this.setAttribute('aria-controls', value);
153
154
  this.setHostRoleAttribute(BUTTON);
154
155
  }
155
156
 
@@ -165,7 +166,7 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
165
166
  @api
166
167
  set ariaOwns(value) {
167
168
  this.originalAriaOwns = value;
168
- this.template.host.setAttribute('aria-owns', value);
169
+ this.setAttribute('aria-owns', value);
169
170
  this.setHostRoleAttribute(BUTTON);
170
171
  }
171
172
 
@@ -181,7 +182,7 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
181
182
  @api
182
183
  set ariaDetails(value) {
183
184
  this.originalAriaDetails = value;
184
- this.template.host.setAttribute('aria-details', value);
185
+ this.setAttribute('aria-details', value);
185
186
  this.setHostRoleAttribute(BUTTON);
186
187
  }
187
188
 
@@ -197,7 +198,7 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
197
198
  @api
198
199
  set ariaFlowTo(value) {
199
200
  this.originalAriaFlowTo = value;
200
- this.template.host.setAttribute('aria-flowto', value);
201
+ this.setAttribute('aria-flowto', value);
201
202
  this.setHostRoleAttribute(BUTTON);
202
203
  }
203
204
 
@@ -453,7 +454,7 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
453
454
  // Workaround for an IE11 bug where click handlers on button ancestors
454
455
  // receive the click event even if the button element has the `disabled`
455
456
  // attribute set.
456
- if (isIE11) {
457
+ if (isIE11 && isCSR) {
457
458
  this.template.addEventListener('click', (event) => {
458
459
  if (this.disabled) {
459
460
  event.stopImmediatePropagation();
@@ -487,9 +488,8 @@ export default class LightningPrimitiveButton extends LightningShadowBaseClass {
487
488
  * @default undefined
488
489
  */
489
490
  setHostRoleAttribute(value) {
490
- const hostElement = this.template.host;
491
- let ariaRoleValue = hostElement.getAttribute(ROLE) || value;
491
+ let ariaRoleValue = this.getAttribute(ROLE) || value;
492
492
 
493
- hostElement.setAttribute(ROLE, ariaRoleValue);
493
+ this.setAttribute(ROLE, ariaRoleValue);
494
494
  }
495
495
  }
@@ -24,8 +24,8 @@ h6 {
24
24
  }
25
25
 
26
26
  a {
27
- color: var(--slds-g-color-brand-base-50, #0176d3);
28
- text-decoration: none;
27
+ color: var(--slds-g-link-color, var(--slds-g-color-brand-base-50, #0176d3));
28
+ text-decoration: var(--_slds-g-font-decoration, none);
29
29
  transition: color 0.1s linear;
30
30
  background-color: transparent;
31
31
  }
@@ -37,16 +37,24 @@ a:hover {
37
37
 
38
38
  a:hover,
39
39
  a:focus {
40
- text-decoration: underline;
41
- color: var(--slds-g-color-brand-base-30, #014486);
40
+ text-decoration: var(--_slds-g-font-decoration-hover, underline);
41
+ color: var(--slds-g-link-color-hover, var(--slds-g-color-brand-base-30, #014486));
42
42
  }
43
43
 
44
44
  a:active {
45
- color: var(--slds-g-color-brand-base-30, #014486);
45
+ color: var(--slds-g-link-color-active, var(--slds-g-color-brand-base-30, #014486));
46
46
  }
47
47
 
48
48
  a:focus-visible {
49
- outline-color: var(--slds-g-color-brand-base-50, #0176d3);
49
+ outline-color: var(--_slds-g-color-outline, var(--slds-g-color-brand-base-50, #0176d3));
50
+ }
51
+
52
+ a:focus {
53
+ box-shadow: var(--_slds-g-shadow);
54
+ border-color: var(--_slds-g-color-border);
55
+ border-width: var(--_slds-g-sizing-border);
56
+ border-style: var(--_slds-g-style-border);
57
+ outline: var(--_slds-g-font-decoration-hover);
50
58
  }
51
59
 
52
60
  a,
@@ -1,18 +1,18 @@
1
1
  /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
2
2
  Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
3
3
 
4
- .slds-is-static {
4
+ :host([data-render-mode="shadow"]) .slds-is-static {
5
5
  position: static;
6
6
  }
7
7
 
8
- .slds-is-relative {
8
+ :host([data-render-mode="shadow"]) .slds-is-relative {
9
9
  position: relative;
10
10
  }
11
11
 
12
- .slds-is-fixed {
12
+ :host([data-render-mode="shadow"]) .slds-is-fixed {
13
13
  position: fixed;
14
14
  }
15
15
 
16
- .slds-is-absolute {
16
+ :host([data-render-mode="shadow"]) .slds-is-absolute {
17
17
  position: absolute;
18
18
  }
@@ -16,16 +16,16 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
16
16
 
17
17
  /* .slds-theme {} */
18
18
 
19
- .slds-theme_default {
19
+ :host([data-render-mode="shadow"]) .slds-theme_default {
20
20
  background-color: var(--slds-g-color-neutral-base-100, #fff);
21
21
  color: var(--slds-g-color-neutral-base-10, #181818);
22
22
  }
23
23
 
24
- .slds-theme_shade {
24
+ :host([data-render-mode="shadow"]) .slds-theme_shade {
25
25
  background-color: var(--slds-g-color-neutral-base-95, #f3f3f3);
26
26
  }
27
27
 
28
- .slds-theme_inverse {
28
+ :host([data-render-mode="shadow"]) .slds-theme_inverse {
29
29
  color: var(--slds-g-color-neutral-base-100, #fff);
30
30
  background-color: var(--slds-g-color-brand-base-10, #001639);
31
31
  border-color: var(--slds-g-color-brand-base-10, #001639);
@@ -54,7 +54,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
54
54
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
55
55
  } */
56
56
 
57
- .slds-theme_alt-inverse {
57
+ :host([data-render-mode="shadow"]) .slds-theme_alt-inverse {
58
58
  color: var(--slds-g-color-neutral-base-100, #fff);
59
59
  background-color: var(--slds-g-color-brand-base-20, #032d60);
60
60
  border-color: var(--slds-g-color-brand-base-20, #032d60);
@@ -83,9 +83,15 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
83
83
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
84
84
  } */
85
85
 
86
- .slds-theme_success {
86
+ :host([data-render-mode="shadow"]) .slds-theme_success {
87
87
  color: var(--slds-g-color-neutral-base-100, #fff);
88
88
  background-color: var(--slds-g-color-success-base-50, #2e844a);
89
+
90
+ --slds-g-link-color: var(--slds-g-color-neutral-base-100, #fff);
91
+ --slds-g-link-color-active: var(--slds-g-color-neutral-100-opacity-50, rgb(255 255 255 / 50%));
92
+ --slds-g-link-color-hover: var(--slds-g-color-neutral-base-100, #fff);
93
+ --_slds-g-font-decoration: underline;
94
+ --_slds-g-font-decoration-hover: none;
89
95
  }
90
96
 
91
97
  /* .slds-theme_success a:not(.slds-button--neutral) {
@@ -111,9 +117,15 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
111
117
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
112
118
  } */
113
119
 
114
- .slds-theme_info {
120
+ :host([data-render-mode="shadow"]) .slds-theme_info {
115
121
  color: var(--slds-g-color-neutral-base-100, #fff);
116
122
  background-color: var(--slds-g-color-neutral-base-50, #747474);
123
+
124
+ --slds-g-link-color: var(--slds-g-color-neutral-base-100, #fff);
125
+ --slds-g-link-color-active: var(--slds-g-color-neutral-100-opacity-50, rgb(255 255 255 / 50%));
126
+ --slds-g-link-color-hover: var(--slds-g-color-neutral-base-100, #fff);
127
+ --_slds-g-font-decoration: underline;
128
+ --_slds-g-font-decoration-hover: none;
117
129
  }
118
130
 
119
131
  /* .slds-theme_info a:not(.slds-button--neutral) {
@@ -139,9 +151,20 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
139
151
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
140
152
  } */
141
153
 
142
- .slds-theme_warning {
154
+ :host([data-render-mode="shadow"]) .slds-theme_warning {
143
155
  background-color: var(--slds-g-color-warning-base-60, #fe9339);
144
156
  color: var(--slds-g-color-neutral-base-10, #181818);
157
+
158
+ --slds-g-link-color: var(--slds-g-color-neutral-base-10, #181818);
159
+ --slds-g-link-color-active: var(--slds-g-color-neutral-base-30, #514f4d);
160
+ --slds-g-link-color-hover: var(--slds-g-color-neutral-base-10, #181818);
161
+ --_slds-g-font-decoration: underline;
162
+ --_slds-g-font-decoration-hover: none;
163
+ --_slds-g-shadow: 0 0 3px var(--slds--g-color-neutral-base-30, #514f4d);
164
+ --_slds-g-style-border: solid;
165
+ --_slds-g-sizing-border: var(--sds-g-sizing-border-1);
166
+ --_slds-g-color-border: var(--slds-g-color-neutral-base-30, #514f4d);
167
+ --_slds-g-color-outline: transparent;
145
168
  }
146
169
 
147
170
  /**
@@ -181,34 +204,42 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
181
204
  .slds-theme_warning a[disabled] {
182
205
  color: var(--slds-g-color-neutral-base-30, #514f4d);
183
206
  }
207
+ */
184
208
 
185
- .slds-theme_warning button {
209
+ :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button) {
186
210
  color: var(--slds-g-color-neutral-base-30, #514f4d);
187
211
  text-decoration: underline;
212
+
213
+ --slds-c-icon-color-foreground: var(--slds-g-color-neutral-base-30, #514f4d);
188
214
  }
189
215
 
190
- .slds-theme_warning button:hover {
216
+ .slds-theme_warning ::part(button):hover {
191
217
  color: var(--slds-g-color-neutral-base-50, #706e6b);
192
218
  }
193
219
 
194
- .slds-theme_warning button:focus {
220
+ :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button):focus {
195
221
  color: var(--slds-g-color-neutral-base-30, #514f4d);
196
222
  box-shadow: 0 0 3px var(--slds-g-color-neutral-base-30, #514f4d);
197
223
  border: 1px solid var(--slds-g-color-neutral-base-30, #514f4d);
198
224
  }
199
225
 
200
- .slds-theme_warning button:active {
226
+ :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button):active {
201
227
  color: var(--slds-g-color-neutral-base-50, #706e6b);
202
228
  }
203
229
 
204
- .slds-theme_warning .slds-icon,
205
- .slds-theme_warning .slds-button__icon {
206
- fill: var(--slds-g-color-neutral-base-30, #514f4d);
207
- } */
230
+ :host([data-render-mode="shadow"]) .slds-theme_warning ::part(boundary) {
231
+ --slds-c-icon-color-foreground: var(--slds-g-color-neutral-base-30, #514f4d);
232
+ }
208
233
 
209
- .slds-theme_error {
234
+ :host([data-render-mode="shadow"]) .slds-theme_error {
210
235
  color: var(--slds-g-color-neutral-base-100, #fff);
211
236
  background-color: var(--slds-g-color-error-base-40, #ea001e);
237
+
238
+ --slds-g-link-color: var(--slds-g-color-neutral-base-100, #fff);
239
+ --slds-g-link-color-active: var(--slds-g-color-neutral-100-opacity-50, rgb(255 255 255 / 50%));
240
+ --slds-g-link-color-hover: var(--slds-g-color-neutral-base-100, #fff);
241
+ --_slds-g-font-decoration: underline;
242
+ --_slds-g-font-decoration-hover: none;
212
243
  }
213
244
 
214
245
  /* .slds-theme_error a:not(.slds-button--neutral) {
@@ -234,7 +265,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
234
265
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
235
266
  } */
236
267
 
237
- .slds-theme_offline {
268
+ :host([data-render-mode="shadow"]) .slds-theme_offline {
238
269
  color: var(--slds-g-color-neutral-base-100, #fff);
239
270
  background-color: var(--slds-g-color-neutral-base-30, #444);
240
271
  }
@@ -262,12 +293,12 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
262
293
  color: var(--slds-g-color-neutral-100-opacity-10, rgb(255 255 255 / 15%));
263
294
  } */
264
295
 
265
- .slds-theme_alert-texture {
296
+ :host([data-render-mode="shadow"]) .slds-theme_alert-texture {
266
297
  background-image: linear-gradient(45deg, rgb(0 0 0 / 2.5%) 25%, transparent 25%, transparent 50%, rgb(0 0 0 / 2.5%) 50%, rgb(0 0 0 / 2.5%) 75%, transparent 75%, transparent);
267
298
  background-size: 64px 64px;
268
299
  }
269
300
 
270
- .slds-theme_inverse-text {
301
+ :host([data-render-mode="shadow"]) .slds-theme_inverse-text {
271
302
  color: var(--slds-g-color-neutral-base-100, #fff);
272
303
  }
273
304
 
@@ -1,7 +1,7 @@
1
1
  import { api } from 'lwc';
2
2
  import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
3
3
  import { classSet } from 'lightning/utils';
4
- import { normalizeString as normalize } from 'lightning/utilsPrivate';
4
+ import { normalizeString as normalize, isCSR } from 'lightning/utilsPrivate';
5
5
 
6
6
  const DEFAULT_SIZE = 'medium';
7
7
  const DEFAULT_VARIANT = 'base';
@@ -10,6 +10,8 @@ const DEFAULT_VARIANT = 'base';
10
10
  * Displays an animated spinner.
11
11
  */
12
12
  export default class LightningSpinner extends LightningShadowBaseClass {
13
+ static validationOptOut = ['class'];
14
+
13
15
  /**
14
16
  * The alternative text used to describe the reason for the wait and need for a spinner.
15
17
  * @type {string}
@@ -61,8 +63,10 @@ export default class LightningSpinner extends LightningShadowBaseClass {
61
63
  connectedCallback() {
62
64
  super.connectedCallback();
63
65
  this.classList.add('slds-spinner_container');
64
- this.template.addEventListener('mousewheel', this.stopScrolling);
65
- this.template.addEventListener('touchmove', this.stopScrolling);
66
+ if (isCSR) {
67
+ this.template.addEventListener('mousewheel', this.stopScrolling);
68
+ this.template.addEventListener('touchmove', this.stopScrolling);
69
+ }
66
70
  }
67
71
 
68
72
  renderedCallback() {
@@ -1,36 +1,28 @@
1
- import { api, track } from 'lwc';
1
+ import { LightningElement, api, track } from 'lwc';
2
2
  import { normalizeBoolean } from 'lightning/utilsPrivate';
3
- import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
3
+
4
4
  /**
5
5
  * A single tab in a tabset component.
6
6
  * @slot default Placeholder for your content in lightning-tab.
7
7
  */
8
- export default class LightningTab extends LightningShadowBaseClass {
8
+ export default class LightningTab extends LightningElement {
9
9
  @track _loadContent = false;
10
- _registered = false;
11
10
 
12
11
  connectedCallback() {
13
- super.connectedCallback();
14
12
  this._connected = true;
15
- }
16
13
 
17
- renderedCallback() {
18
- if (!this._registered) {
19
- this._registered = true;
20
- this.dispatchEvent(
21
- new CustomEvent('privatetabregister', {
22
- cancelable: true,
23
- bubbles: true,
24
- composed: true,
25
- detail: {
26
- setDeRegistrationCallback: (deRegistrationCallback) => {
27
- this._deRegistrationCallback =
28
- deRegistrationCallback;
29
- },
14
+ this.dispatchEvent(
15
+ new CustomEvent('privatetabregister', {
16
+ cancelable: true,
17
+ bubbles: true,
18
+ composed: true,
19
+ detail: {
20
+ setDeRegistrationCallback: (deRegistrationCallback) => {
21
+ this._deRegistrationCallback = deRegistrationCallback;
30
22
  },
31
- })
32
- );
33
- }
23
+ },
24
+ })
25
+ );
34
26
  }
35
27
 
36
28
  /**
@@ -23,8 +23,6 @@ export default class LightningTabset extends LightningElement {
23
23
 
24
24
  @track _tabHeaders = [];
25
25
 
26
- _rerender = false;
27
-
28
26
  connectedCallback() {
29
27
  this._tabByValue = {};
30
28
  this._connected = true;
@@ -38,19 +36,6 @@ export default class LightningTabset extends LightningElement {
38
36
  );
39
37
  }
40
38
 
41
- // must wait for this entire `tab-set` component to be rendered in order to
42
- // successfully querySelect `tab-bar` from it, in methods such as _updateTabBarHeaders
43
- // or _selectTab.
44
- // using _rerender to trigger renderedCallback and execute these methods in here
45
- // instead of the handleTabRegister method, where `tab-bar` is not querySelectable.
46
- renderedCallback() {
47
- if (this._rerender) {
48
- this._rerender = false;
49
- this._updateTabBarHeaders(this._tabHeaders);
50
- this._selectTab(this._activeTabValue);
51
- }
52
- }
53
-
54
39
  disconnectedCallback() {
55
40
  this._connected = false;
56
41
  }
@@ -99,8 +84,7 @@ export default class LightningTabset extends LightningElement {
99
84
 
100
85
  handleTabRegister(event) {
101
86
  event.stopPropagation();
102
- // setting this to true, will trigger _updateTabBarHeaders and _selectTab in renderedCallback
103
- this._rerender = true;
87
+
104
88
  const tab = event.target;
105
89
 
106
90
  tab.role = 'tabpanel';
@@ -165,11 +149,6 @@ export default class LightningTabset extends LightningElement {
165
149
  endIconAlternativeText: tab.endIconAlternativeText,
166
150
  showErrorIndicator: tab.showErrorIndicator,
167
151
  });
168
-
169
- // need to leave this _updateTabBarHeaders here so that `tab-bar` can be updated
170
- // in the case of a "conditional tab". the _updateTabBarHeaders in the renderedCallback
171
- // has no knowledge of the new tab being added.
172
- // this call works here in the "conditional tab" case, as `tab-set` is already rendered.
173
152
  this._updateTabBarHeaders(this._tabHeaders);
174
153
 
175
154
  this._tabByValue[tabValue] = tab;
@@ -178,6 +157,10 @@ export default class LightningTabset extends LightningElement {
178
157
  if (!this._activeTabValue) {
179
158
  this._activeTabValue = tab.value;
180
159
  }
160
+
161
+ if (this._activeTabValue === tab.value) {
162
+ this._selectTab(tabValue);
163
+ }
181
164
  }
182
165
 
183
166
  _selectTab(value) {
@@ -259,17 +242,16 @@ export default class LightningTabset extends LightningElement {
259
242
  * @param {Array} headers
260
243
  */
261
244
  _updateTabBarHeaders(headers) {
262
- if (this.template.querySelector('lightning-tab-bar')) {
263
- this.template.querySelector('lightning-tab-bar').tabHeaders =
264
- headers.slice();
265
- }
245
+ this.template.querySelector('lightning-tab-bar').tabHeaders =
246
+ headers.slice();
266
247
  }
267
248
 
268
249
  _selectTabHeaderByTabValue(value) {
269
- const tabBar = this.template.querySelector('lightning-tab-bar');
270
- if (!this._connected || !tabBar) {
250
+ if (!this._connected) {
271
251
  return;
272
252
  }
253
+
254
+ const tabBar = this.template.querySelector('lightning-tab-bar');
273
255
  tabBar.selectTabByValue(value);
274
256
  }
275
257