lightning-base-components 1.22.1-alpha → 1.22.3-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 (127) hide show
  1. package/README.md +2 -0
  2. package/metadata/raptor.json +38 -2
  3. package/package.json +12 -1
  4. package/scopedImports/@salesforce-label-LightningRecordPicker.actionIconAlternativeText.js +1 -0
  5. package/src/lightning/accordionSection/button.slds.css +8 -0
  6. package/src/lightning/ariaObserver/ariaObserver.js +1 -1
  7. package/src/lightning/baseCombobox/baseCombobox.html +1 -1
  8. package/src/lightning/baseCombobox/baseCombobox.js +1 -0
  9. package/src/lightning/baseCombobox/dropdown.slds.css +7 -7
  10. package/src/lightning/baseComboboxItem/card.lbc.native.css +1 -0
  11. package/src/lightning/baseComboboxItem/inline.lbc.native.css +1 -0
  12. package/src/lightning/button/button.slds.css +8 -0
  13. package/src/lightning/buttonIcon/button-icon.slds.css +8 -0
  14. package/src/lightning/buttonIcon/buttonIcon.js +29 -26
  15. package/src/lightning/buttonIconStateful/button-icon.slds.css +8 -0
  16. package/src/lightning/buttonIconStateful/button.slds.css +8 -0
  17. package/src/lightning/buttonMenu/button-icon.slds.css +8 -0
  18. package/src/lightning/buttonMenu/button.slds.css +8 -0
  19. package/src/lightning/buttonMenu/dropdown.slds.css +7 -7
  20. package/src/lightning/buttonStateful/button.slds.css +8 -0
  21. package/src/lightning/calendar/calendar.lbc.native.css +1 -0
  22. package/src/lightning/calendar/dropdown.slds.css +7 -7
  23. package/src/lightning/checkboxGroup/checkboxGroup.js +21 -10
  24. package/src/lightning/checkboxGroup/checkboxGroup.js-meta.xml +3 -0
  25. package/src/lightning/colorPickerPanel/colorPickerPanel.js +1 -11
  26. package/src/lightning/combobox/combobox.html +1 -1
  27. package/src/lightning/datatable/__docs__/datatable.md +10 -5
  28. package/src/lightning/datatable/autoWidthStrategy.js +32 -44
  29. package/src/lightning/datatable/columnResizer.js +3 -2
  30. package/src/lightning/datatable/columnWidthManager.js +16 -10
  31. package/src/lightning/datatable/columns.js +4 -1
  32. package/src/lightning/datatable/datatable.js +108 -46
  33. package/src/lightning/datatable/infiniteLoading.js +8 -20
  34. package/src/lightning/datatable/inlineEdit.js +11 -6
  35. package/src/lightning/datatable/keyboard.js +58 -55
  36. package/src/lightning/datatable/resizeObserver.js +10 -5
  37. package/src/lightning/datatable/rows.js +3 -3
  38. package/src/lightning/datatable/rowsInlining.js +5 -4
  39. package/src/lightning/datatable/state.js +1 -2
  40. package/src/lightning/datatable/templates/div/div.html +150 -43
  41. package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +8 -7
  42. package/src/lightning/datatable/templates/table/table.html +153 -46
  43. package/src/lightning/datatable/utils.js +10 -4
  44. package/src/lightning/datatable/virtualization.js +6 -4
  45. package/src/lightning/datatable/wrapText.js +16 -15
  46. package/src/lightning/groupedCombobox/groupedCombobox.js +21 -28
  47. package/src/lightning/helptext/button-icon.slds.css +8 -0
  48. package/src/lightning/helptext/helptext.html +2 -1
  49. package/src/lightning/helptext/helptext.js +0 -12
  50. package/src/lightning/input/input.html +0 -1
  51. package/src/lightning/interactiveDialogBase/button.slds.css +8 -0
  52. package/src/lightning/modal/__docs__/modal.md +2 -0
  53. package/src/lightning/modalBase/modalBase.html +2 -0
  54. package/src/lightning/modalBase/modalBase.js +30 -31
  55. package/src/lightning/modalBody/modalBody.html +1 -0
  56. package/src/lightning/modalBody/modalBody.js +3 -0
  57. package/src/lightning/modalFooter/modalFooter.html +5 -1
  58. package/src/lightning/modalFooter/modalFooter.js +3 -0
  59. package/src/lightning/modalHeader/modalHeader.html +4 -1
  60. package/src/lightning/modalHeader/modalHeader.js +3 -0
  61. package/src/lightning/overlayManager/overlayManager.js +1 -1
  62. package/src/lightning/pillContainer/button.slds.css +8 -0
  63. package/src/lightning/positionLibrary/elementProxy.js +13 -6
  64. package/src/lightning/positionLibrary/util.js +20 -2
  65. package/src/lightning/primitiveBubble/primitiveBubble.js +9 -4
  66. package/src/lightning/primitiveCellActions/primitiveCellActions.html +1 -0
  67. package/src/lightning/primitiveCellActions/primitiveCellActions.js +3 -5
  68. package/src/lightning/primitiveCellButton/primitiveCellButton.html +2 -0
  69. package/src/lightning/primitiveCellButton/primitiveCellButton.js +3 -5
  70. package/src/lightning/primitiveCellCheckbox/checkbox.html +3 -2
  71. package/src/lightning/primitiveCellCheckbox/primitiveCellCheckbox.js +6 -3
  72. package/src/lightning/primitiveCellCheckbox/radio.html +5 -4
  73. package/src/lightning/primitiveCellEditableButton/primitiveCellEditableButton.html +1 -1
  74. package/src/lightning/primitiveCellEditableButton/primitiveCellEditableButton.js +1 -1
  75. package/src/lightning/primitiveCellFactory/bareCustomCell.html +1 -0
  76. package/src/lightning/primitiveCellFactory/cellWithStandardLayout.html +1 -0
  77. package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -6
  78. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.html +1 -0
  79. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.js +1 -1
  80. package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.html +3 -1
  81. package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.js +3 -3
  82. package/src/lightning/primitiveDatatableStatusBar/primitiveDatatableStatusBar.html +1 -0
  83. package/src/lightning/primitiveDatatableStatusBar/primitiveDatatableStatusBar.js +1 -3
  84. package/src/lightning/primitiveDatatableTooltip/primitiveDatatableTooltip.html +1 -0
  85. package/src/lightning/primitiveDatatableTooltip/primitiveDatatableTooltip.js +1 -1
  86. package/src/lightning/primitiveDatatableTooltipBubble/primitiveDatatableTooltipBubble.html +1 -1
  87. package/src/lightning/primitiveDatatableTooltipBubble/primitiveDatatableTooltipBubble.js +1 -1
  88. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.html +2 -0
  89. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.js +2 -4
  90. package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +8 -3
  91. package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +43 -13
  92. package/src/lightning/primitiveHeaderFactory/selectableHeader.html +3 -2
  93. package/src/lightning/primitiveHeaderFactory/sortableHeader.html +8 -3
  94. package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.html +1 -1
  95. package/src/lightning/primitiveIcon/primitiveIcon.css +0 -1
  96. package/src/lightning/primitiveInputFile/button.slds.css +8 -0
  97. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.html +4 -2
  98. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.js +2 -2
  99. package/src/lightning/primitiveTreegridCellToggle/primitiveTreegridCellToggle.html +1 -1
  100. package/src/lightning/primitiveTreegridCellToggle/primitiveTreegridCellToggle.js +1 -1
  101. package/src/lightning/progressIndicator/progressIndicator.css +1 -1
  102. package/src/lightning/progressIndicator/progressIndicator.js +14 -6
  103. package/src/lightning/progressIndicator/progressIndicator.js-meta.xml +3 -0
  104. package/src/lightning/progressIndicator/progressIndicator.lbc.native.css +2 -0
  105. package/src/lightning/progressStep/__examples__/basic/basic.html +11 -0
  106. package/src/lightning/progressStep/__examples__/basic/basic.js +3 -0
  107. package/src/lightning/progressStep/__examples__/shaded/shaded.html +11 -0
  108. package/src/lightning/progressStep/__examples__/shaded/shaded.js +3 -0
  109. package/src/lightning/progressStep/base.html +2 -1
  110. package/src/lightning/progressStep/progressStep.css +1 -0
  111. package/src/lightning/progressStep/progressStep.js +40 -29
  112. package/src/lightning/progressStep/progressStep.js-meta.xml +3 -0
  113. package/src/lightning/progressStep/progressStep.lbc.native.css +3 -0
  114. package/src/lightning/sldsCommon/sldsCommon.css +1 -1
  115. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +6 -4
  116. package/src/lightning/tabBar/tab-bar.slds.css +17 -3
  117. package/src/lightning/tile/mediaTile.css +2 -0
  118. package/src/lightning/tile/standardTile.css +2 -1
  119. package/src/lightning/tile/tile.js +5 -2
  120. package/src/lightning/tile/tile.js-meta.xml +3 -0
  121. package/src/lightning/tile/tile.lbc.native.css +4 -0
  122. package/src/lightning/toast/button-icon.slds.css +8 -0
  123. package/src/lightning/tooltipLibrary/tooltipLibrary.js +15 -4
  124. package/src/lightning/utilsPrivate/utilsPrivate.js +4 -4
  125. package/src/lightning/verticalNavigationOverflow/button.slds.css +8 -0
  126. package/src/lightning/primitiveIcon/primitiveIcon.lbc.synthetic.css +0 -9
  127. /package/src/lightning/tile/{standardTile.lbc.synthetic.css → tile.lbc.synthetic.css} +0 -0
@@ -95,9 +95,7 @@ export default class LightningPrimitiveDatatableStatusBar extends LightningEleme
95
95
  */
96
96
  handleShowError() {
97
97
  Promise.resolve().then(() => {
98
- const trigger = this.template.querySelector(
99
- 'lightning-primitive-datatable-tooltip'
100
- );
98
+ const trigger = this.refs.tooltip;
101
99
 
102
100
  if (trigger) {
103
101
  if (this.showErrorBubble) {
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <button
3
+ lwc:ref="trigger"
3
4
  data-trigger="true"
4
5
  class={computedButtonClass}
5
6
  onmouseover={handleMouseOver}
@@ -104,7 +104,7 @@ export default class LightningPrimitiveDatatableTooltip extends LightningElement
104
104
  }
105
105
 
106
106
  get triggerElement() {
107
- return this.template.querySelector('[data-trigger="true"]');
107
+ return this.refs.trigger;
108
108
  }
109
109
 
110
110
  handleMouseOver() {
@@ -16,7 +16,7 @@
16
16
  alternative-text={i18n.closeButtonAssistiveText}
17
17
  onclick={handleCloseButtonClick}
18
18
  onkeydown={handleCloseButtonKey}
19
- data-close="true"
19
+ lwc:ref="closeBtn"
20
20
  ></lightning-button-icon>
21
21
  </template>
22
22
 
@@ -82,7 +82,7 @@ export default class LightningPrimitiveDatatableTooltipBubble extends LightningE
82
82
  }
83
83
 
84
84
  get closeButton() {
85
- return this.template.querySelector('[data-close="true"]');
85
+ return this.refs.closeBtn;
86
86
  }
87
87
 
88
88
  handleBlur = (evt) => {
@@ -1,9 +1,11 @@
1
1
  <template>
2
2
  <template if:true={hasActions}>
3
3
  <lightning-button-menu
4
+ lwc:ref="buttonMenu"
4
5
  id="primitive-header-action-button-menu-id"
5
6
  icon-size="x-small"
6
7
  menu-alignment={_actionMenuAlignment}
8
+ title={alternativeText}
7
9
  alternative-text={alternativeText}
8
10
  variant="bare"
9
11
  onopen={handleMenuOpen}
@@ -58,7 +58,7 @@ export default class PrimitiveHeaderActions extends LightningElement {
58
58
  */
59
59
  @api
60
60
  focus() {
61
- const btnMenu = this.template.querySelector('lightning-button-menu');
61
+ const btnMenu = this.refs.buttonMenu;
62
62
 
63
63
  if (btnMenu) {
64
64
  btnMenu.focus();
@@ -109,9 +109,7 @@ export default class PrimitiveHeaderActions extends LightningElement {
109
109
  event.preventDefault();
110
110
  event.stopPropagation();
111
111
 
112
- this.elementRect = this.template
113
- .querySelector('lightning-button-menu')
114
- .getBoundingClientRect();
112
+ this.elementRect = this.refs.buttonMenu.getBoundingClientRect();
115
113
 
116
114
  this.dispatchEvent(
117
115
  new CustomEvent('privatecellheaderactionmenuopening', {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class={computedClass} style={columnStyles}>
2
+ <div lwc:ref="child" class={computedClass} style={columnStyles}>
3
3
 
4
4
  <!-- Header Content -->
5
5
  <span class="slds-th__action" style={thActionStyles}>
@@ -7,12 +7,17 @@
7
7
  <div class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate">
8
8
  <lightning-icon icon-name={def.iconName} size="x-small" class="slds-icon_container slds-m-right_xx-small" alternative-text={def.label} title={def.label}></lightning-icon>
9
9
  <template if:false={def.hideLabel} class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate">
10
- <span class={getHeaderLabelStyle}>{def.label}</span>
10
+ <span class={getHeaderLabelClass} style={getHeaderLabelStyle}>{def.label}</span>
11
11
  </template>
12
12
  </div>
13
13
  </template>
14
14
  <template if:false={def.iconName}>
15
- <span class={getHeaderLabelStyle} if:true={def.label} title={def.label}>{def.label}</span>
15
+ <span if:true={def.label}
16
+ class={getHeaderLabelClass}
17
+ style={getHeaderLabelStyle}
18
+ title={def.label}>
19
+ {def.label}
20
+ </span>
16
21
  <span class="slds-truncate" if:false={def.label} title={def.ariaLabel}></span>
17
22
  </template>
18
23
 
@@ -58,11 +58,13 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
58
58
  @api colIndex;
59
59
  @api columnWidth;
60
60
  @api dtContextId;
61
+ @api headerHeight;
61
62
  @api resizestep;
62
63
  @api showCheckbox = false;
63
64
  @api sorted;
64
65
  @api sortedDirection;
65
66
  @api showActionsMenu;
67
+ @api wrapTextMaxLines;
66
68
 
67
69
  /**
68
70
  * Retrieves the computed header DOM `id`
@@ -71,7 +73,7 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
71
73
  */
72
74
  @api
73
75
  get computedColumnHeaderId() {
74
- const el = this.template.querySelector('[data-column-header]');
76
+ const el = this.refs.columnHeader;
75
77
  return getRealDOMId(el);
76
78
  }
77
79
 
@@ -152,6 +154,20 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
152
154
 
153
155
  /************************** PUBLIC METHODS ***************************/
154
156
 
157
+ /**
158
+ * Retrieves the header cell's height
159
+ *
160
+ * @return {string} The height of the cell
161
+ */
162
+ @api
163
+ getDomHeight() {
164
+ const child = this.template.querySelector('.slds-hyphenate');
165
+ if (child) {
166
+ return child.offsetHeight;
167
+ }
168
+ return '';
169
+ }
170
+
155
171
  /**
156
172
  * Retrieves the header cell's width
157
173
  *
@@ -159,7 +175,7 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
159
175
  */
160
176
  @api
161
177
  getDomWidth() {
162
- const child = this.template.querySelector('.slds-cell-fixed');
178
+ const { child } = this.refs;
163
179
  if (child) {
164
180
  return child.offsetWidth;
165
181
  }
@@ -168,6 +184,14 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
168
184
 
169
185
  /************************** PRIVATE GETTERS **************************/
170
186
 
187
+ get shouldWrapText() {
188
+ const { _wrapTableHeader } = this;
189
+ return (
190
+ _wrapTableHeader === 'all' ||
191
+ (_wrapTableHeader === 'by-column' && this._def.wrapText)
192
+ );
193
+ }
194
+
171
195
  /**
172
196
  * Computes the styles for the column
173
197
  *
@@ -182,7 +206,9 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
182
206
  const offsetStyle =
183
207
  document.dir === 'rtl' ? `right: ${this._def.offset}px;` : '';
184
208
  const widthStyle = columnWidth ? `width: ${columnWidth}px;` : '';
185
- const heightStyle = this._wrapTableHeader ? 'min-height: 3rem' : '';
209
+ const heightStyle = this.headerHeight
210
+ ? `height: ${this.headerHeight}`
211
+ : '';
186
212
 
187
213
  return `
188
214
  ${widthStyle}
@@ -226,22 +252,28 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
226
252
  /**
227
253
  * Computes styling for header label
228
254
  */
229
- get getHeaderLabelStyle() {
230
- return this._wrapTableHeader
231
- ? 'slds-line-clamp_small '
255
+ get getHeaderLabelClass() {
256
+ return this.shouldWrapText
257
+ ? 'slds-line-clamp slds-hyphenate'
232
258
  : 'slds-truncate';
233
259
  }
234
260
 
261
+ /**
262
+ * Computes styling for header label
263
+ */
264
+ get getHeaderLabelStyle() {
265
+ return this.shouldWrapText
266
+ ? `--lwc-lineClamp: ${this.wrapTextMaxLines || 'none'}`
267
+ : '';
268
+ }
269
+
235
270
  /**
236
271
  * Get th Action styles (needed for wrapping headers)
237
272
  *
238
273
  * @return {string} The computed classes
239
274
  */
240
275
  get thActionStyles() {
241
- const heightStyle = this._wrapTableHeader ? 'min-height: 3rem' : '';
242
- return `
243
- ${heightStyle}
244
- `;
276
+ return this.headerHeight ? `height: ${this.headerHeight}` : '';
245
277
  }
246
278
 
247
279
  /**
@@ -494,9 +526,7 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
494
526
  */
495
527
  updateBulkSelectionCheckbox() {
496
528
  const { bulkSelection } = this._def;
497
- const allCheckbox = this.template.querySelector(
498
- '.datatable-select-all'
499
- );
529
+ const allCheckbox = this.refs.selectAll;
500
530
  allCheckbox.indeterminate = bulkSelection === 'some';
501
531
 
502
532
  // Note: since we have to handle the indeterminate state,
@@ -1,13 +1,14 @@
1
1
  <template>
2
- <span id="column-group-header" class="slds-assistive-text" data-column-header>
2
+ <span lwc:ref="columnHeader" id="column-group-header" class="slds-assistive-text" data-column-header>
3
3
  {computedColumnHeaderLabel}
4
4
  </span>
5
5
  <!-- Header Content -->
6
- <div class="slds-th__action slds-th__action_form slds-cell-fixed" style={columnStyles}>
6
+ <div lwc:ref="child" class="slds-th__action slds-th__action_form slds-cell-fixed" style={columnStyles}>
7
7
  <template if:true={showCheckbox}>
8
8
  <span class="slds-checkbox">
9
9
  <!-- Selectable Checkbox -->
10
10
  <input
11
+ lwc:ref="selectAll"
11
12
  type="checkbox"
12
13
  class="datatable-select-all"
13
14
  name={computedOptionName}
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- Header Content -->
3
- <span class={computedClass} tabindex={internalTabIndex} style={columnStyles}>
3
+ <span lwc:ref="child" class={computedClass} tabindex={internalTabIndex} style={columnStyles}>
4
4
 
5
5
  <a href="javascript:void(0);"
6
6
  class={computedSortClass}
@@ -18,7 +18,7 @@
18
18
  <div class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate">
19
19
  <lightning-icon icon-name={def.iconName} size="x-small" class="slds-icon_container slds-m-right_xx-small" alternative-text={def.label} title={def.label}></lightning-icon>
20
20
  <template if:false={def.hideLabel} class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate">
21
- <span class={getHeaderLabelStyle}>{def.label}</span>
21
+ <span class={getHeaderLabelClass} style={getHeaderLabelStyle}>{def.label}</span>
22
22
  </template>
23
23
 
24
24
  <!-- Arrow Icon - Rotates based on sorting direction -->
@@ -31,7 +31,12 @@
31
31
  </div>
32
32
  </template>
33
33
  <template if:false={def.iconName}>
34
- <span class={getHeaderLabelStyle} title={def.label}>{def.label}</span>
34
+ <span
35
+ class={getHeaderLabelClass}
36
+ style={getHeaderLabelStyle}
37
+ title={def.label}>
38
+ {def.label}
39
+ </span>
35
40
  <!-- Arrow Icon - Rotates based on sorting direction -->
36
41
  <lightning-primitive-icon
37
42
  class="slds-icon_container"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="slds-th__action slds-th__action_form slds-cell-fixed" style={columnStyles}>
2
+ <div lwc:ref="child" class="slds-th__action slds-th__action_form slds-cell-fixed" style={columnStyles}>
3
3
  <lightning-button-menu alternative-text="Show menu" internal-datatable-actions-menu icon-name="utility:threedots" variant="border-filled" menu-alignment="right" icon-size="x-small" tooltip={i18n.sortingMenuTooltip} onselect={handleSortingMenuSelection}>
4
4
  <lightning-menu-item value="MultiColumnSorting" label={i18n.sortingMenuMultiColumnSort}></lightning-menu-item>
5
5
  <lightning-menu-item value="ReorderRow" label={i18n.sortingMenuRows}></lightning-menu-item>
@@ -1,2 +1 @@
1
- @import './primitiveIcon.lbc.synthetic.css';
2
1
  @import './primitiveIcon.lbc.native.css';
@@ -296,6 +296,14 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
296
296
  --sds-c-button-color-border-disabled: var(--slds-g-color-border-disabled-1);
297
297
  --sds-c-button-text-color-disabled: var(--slds-g-color-on-disabled-1);
298
298
  --sds-c-button-color-background-disabled: var(--slds-g-color-disabled-container-1);
299
+
300
+ /**
301
+ * Needed to override
302
+ * `pointer-event: none` coming from sds
303
+ * that prevent tooltip from showing
304
+ */
305
+ pointer-events: auto;
306
+ cursor: default;
299
307
  }
300
308
  /**
301
309
  * A note about fallbacks on the default variant:
@@ -7,7 +7,8 @@
7
7
  get initial focus when first tabbing into datatable
8
8
  JS in primitiveDatatableCell will focus input when appropriate
9
9
  -->
10
- <input type="range"
10
+ <input lwc:ref="input"
11
+ type="range"
11
12
  value={value}
12
13
  min={minWidth}
13
14
  max={maxWidth}
@@ -19,7 +20,8 @@
19
20
  onkeydown={handleKeydown}
20
21
  tabindex="-1"
21
22
  >
22
- <span class="slds-resizable__handle"
23
+ <span lwc:ref="resizeHandle"
24
+ class="slds-resizable__handle"
23
25
  data-is-last-col={isLastCol}
24
26
  onmousedown={onMouseDown}
25
27
  ontouchstart={onTouchStart}
@@ -33,7 +33,7 @@ export default class PrimitiveResizeHandler extends LightningElement {
33
33
  }
34
34
 
35
35
  get resizeElement() {
36
- return this.template.querySelector('.slds-resizable__handle');
36
+ return this.refs.resizeHandle;
37
37
  }
38
38
 
39
39
  /* Need this label only in Safari because VO doesn't announce the change when resized */
@@ -43,7 +43,7 @@ export default class PrimitiveResizeHandler extends LightningElement {
43
43
 
44
44
  @api
45
45
  focus() {
46
- const inputEle = this.template.querySelector('input');
46
+ const inputEle = this.refs.input;
47
47
 
48
48
  if (inputEle) {
49
49
  inputEle.focus();
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button type="button" class={computedButtonClass} tabindex={buttonTabIndex} title={buttonTitle} onclick={handleChevronClick}>
2
+ <button lwc:ref="button" type="button" class={computedButtonClass} tabindex={buttonTabIndex} title={buttonTitle} onclick={handleChevronClick}>
3
3
  <lightning-primitive-icon
4
4
  icon-name="utility:chevronright"
5
5
  variant="bare"
@@ -86,6 +86,6 @@ export default class PrivateTreeGridCellToggle extends LightningElement {
86
86
 
87
87
  @api
88
88
  focus() {
89
- this.template.querySelector('button').focus();
89
+ this.refs.button.focus();
90
90
  }
91
91
  }
@@ -1 +1 @@
1
- @import './progressIndicator.lbc.synthetic.css'
1
+ @import './progressIndicator.lbc.native.css';
@@ -1,5 +1,7 @@
1
- import { LightningElement, api, track } from 'lwc';
1
+ import { api, track } from 'lwc';
2
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
2
3
  import { classSet, formatLabel } from 'lightning/utils';
4
+ import { isCSR } from 'lightning/utilsPrivate';
3
5
  import pathCurrentStage from '@salesforce/label/LightningProgressIndicator.pathCurrentStage';
4
6
  import {
5
7
  getStepIndex,
@@ -8,6 +10,7 @@ import {
8
10
  } from './utils';
9
11
  import base from './base.html';
10
12
  import path from './path.html';
13
+ import progressIndicatorStylesheets from './progressIndicator.css';
11
14
 
12
15
  const i18n = {
13
16
  currentStageLabel: pathCurrentStage,
@@ -27,7 +30,9 @@ const DOWN = 40;
27
30
  * Provides a visual indication on the progress of a particular process.
28
31
  * @slot default Placeholder for lightning-progress-step.
29
32
  */
30
- export default class LightningProgressIndicator extends LightningElement {
33
+ export default class LightningProgressIndicator extends LightningShadowBaseClass {
34
+ static stylesheets = [progressIndicatorStylesheets]; // stylesheets that apply to every rendered template
35
+
31
36
  /**
32
37
  * Changes the visual pattern of the indicator. Valid values are base and path.
33
38
  * The default is base.
@@ -95,10 +100,13 @@ export default class LightningProgressIndicator extends LightningElement {
95
100
  _currentStepLabel = '';
96
101
 
97
102
  connectedCallback() {
98
- this.addEventListener(
99
- 'privateregisterstep',
100
- this.handlePrivateRegisterStep.bind(this)
101
- );
103
+ super.connectedCallback();
104
+ if (isCSR) {
105
+ this.addEventListener(
106
+ 'privateregisterstep',
107
+ this.handlePrivateRegisterStep.bind(this)
108
+ );
109
+ }
102
110
  }
103
111
 
104
112
  renderedCallback() {
@@ -3,4 +3,7 @@
3
3
  <isExposed>true</isExposed>
4
4
  <minApiVersion>41.0</minApiVersion>
5
5
  <support>BETA</support>
6
+ <capabilities>
7
+ <capability>lightning__ServerRenderableWithHydration</capability>
8
+ </capabilities>
6
9
  </LightningComponentBundle>
@@ -0,0 +1,2 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import './progress-indicator.slds.css';
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <p>
3
+ The steps are shown within a lightning-progress-indicator here.
4
+ </p>
5
+ <lightning-progress-indicator current-step="3" type="base" has-error="true" variant="base">
6
+ <lightning-progress-step label="Step 1" value="1"></lightning-progress-step>
7
+ <lightning-progress-step label="Step 2" value="2"></lightning-progress-step>
8
+ <lightning-progress-step label="Step 3" value="3"></lightning-progress-step>
9
+ <lightning-progress-step label="Step 4" value="4"></lightning-progress-step>
10
+ </lightning-progress-indicator>
11
+ </template>
@@ -0,0 +1,3 @@
1
+ import { LightningElement } from 'lwc';
2
+
3
+ export default class ProgressStepBasic extends LightningElement {}
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <p>
3
+ The shaded steps are shown within a lightning-progress-indicator here.
4
+ </p>
5
+ <lightning-progress-indicator current-step="3" type="base" has-error="true" variant="shade">
6
+ <lightning-progress-step label="Step 1" value="1"></lightning-progress-step>
7
+ <lightning-progress-step label="Step 2" value="2"></lightning-progress-step>
8
+ <lightning-progress-step label="Step 3" value="3"></lightning-progress-step>
9
+ <lightning-progress-step label="Step 4" value="4"></lightning-progress-step>
10
+ </lightning-progress-indicator>
11
+ </template>
@@ -0,0 +1,3 @@
1
+ import { LightningElement } from 'lwc';
2
+
3
+ export default class ProgressStepShaded extends LightningElement {}
@@ -9,7 +9,8 @@
9
9
  <template if:true={hasIcon}>
10
10
  <lightning-primitive-icon
11
11
  icon-name={baseIconName}
12
- svg-class="slds-icon slds-icon_xx-small"
12
+ svg-class="slds-icon"
13
+ size="xx-small"
13
14
  variant="bare"></lightning-primitive-icon>
14
15
  </template>
15
16
  <span if:true={assistiveText} class="slds-assistive-text">{assistiveText}</span>
@@ -0,0 +1 @@
1
+ @import './progressStep.lbc.native.css';
@@ -2,12 +2,14 @@ import labelCurrentStage from '@salesforce/label/LightningProgressIndicator.curr
2
2
  import labelStageComplete from '@salesforce/label/LightningProgressIndicator.stageComplete';
3
3
  import labelNotStartedStage from '@salesforce/label/LightningProgressIndicator.stageNotStarted';
4
4
  import labelErrorStage from '@salesforce/label/LightningProgressIndicator.errorStage';
5
- import { LightningElement, api, track } from 'lwc';
5
+ import { api, track } from 'lwc';
6
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
6
7
  import { classSet, formatLabel } from 'lightning/utils';
7
- import { classListMutation } from 'lightning/utilsPrivate';
8
+ import { classListMutation, isCSR } from 'lightning/utilsPrivate';
8
9
  import { Tooltip, TooltipType, Direction } from 'lightning/tooltipLibrary';
9
10
  import path from './path.html';
10
11
  import base from './base.html';
12
+ import progressStepStylesheets from './progressStep.css';
11
13
 
12
14
  // Temporary workaround until we get real label support. New label entries must
13
15
  // also be added to the static `labels` prop inside the class.
@@ -28,7 +30,10 @@ const baseIconNameMap = {
28
30
  /**
29
31
  * Defines a step in the lightning-progress-indicator.
30
32
  */
31
- export default class LightningProgressStep extends LightningElement {
33
+ export default class LightningProgressStep extends LightningShadowBaseClass {
34
+ static stylesheets = [progressStepStylesheets]; // stylesheets that apply to every rendered template
35
+ static validationOptOut = ['class'];
36
+
32
37
  /**
33
38
  * Text string to reference the step of the progress indicator.
34
39
  * @type {string}
@@ -97,18 +102,22 @@ export default class LightningProgressStep extends LightningElement {
97
102
  }
98
103
 
99
104
  connectedCallback() {
100
- this.dispatchEvent(
101
- new CustomEvent('privateregisterstep', {
102
- bubbles: true,
103
- detail: {
104
- callback: this.updateInternal.bind(this),
105
- stepName: this.value,
106
- setDeRegistrationCallback: (deRegistrationCallback) => {
107
- this._deRegistrationCallback = deRegistrationCallback;
105
+ super.connectedCallback();
106
+ if (isCSR) {
107
+ this.dispatchEvent(
108
+ new CustomEvent('privateregisterstep', {
109
+ bubbles: true,
110
+ detail: {
111
+ callback: this.updateInternal.bind(this),
112
+ stepName: this.value,
113
+ setDeRegistrationCallback: (deRegistrationCallback) => {
114
+ this._deRegistrationCallback =
115
+ deRegistrationCallback;
116
+ },
108
117
  },
109
- },
110
- })
111
- );
118
+ })
119
+ );
120
+ }
112
121
  }
113
122
 
114
123
  disconnectedCallback() {
@@ -232,21 +241,23 @@ export default class LightningProgressStep extends LightningElement {
232
241
  } else if (this._privateLabel && this.state.type && !this.isPath) {
233
242
  // Note that because the tooltip target is a child element it may not be present in the
234
243
  // dom during initial rendering.
235
- this._tooltip = new Tooltip(this._privateLabel, {
236
- root: this,
237
- target: () => this.template.querySelector('div'),
238
- type: TooltipType.Toggle,
239
- align: {
240
- horizontal: Direction.Center,
241
- vertical: Direction.Bottom,
242
- },
243
- targetAlign: {
244
- horizontal: Direction.Center,
245
- vertical: Direction.Top,
246
- },
247
- disableAriaDescribedBy: true,
248
- });
249
- this._tooltip.initialize();
244
+ if (isCSR) {
245
+ this._tooltip = new Tooltip(this._privateLabel, {
246
+ root: this,
247
+ target: () => this.template.querySelector('div'),
248
+ type: TooltipType.Toggle,
249
+ align: {
250
+ horizontal: Direction.Center,
251
+ vertical: Direction.Bottom,
252
+ },
253
+ targetAlign: {
254
+ horizontal: Direction.Center,
255
+ vertical: Direction.Top,
256
+ },
257
+ disableAriaDescribedBy: true,
258
+ });
259
+ this._tooltip.initialize();
260
+ }
250
261
  }
251
262
  }
252
263
  }
@@ -3,4 +3,7 @@
3
3
  <isExposed>true</isExposed>
4
4
  <minApiVersion>41.0</minApiVersion>
5
5
  <support>BETA</support>
6
+ <capabilities>
7
+ <capability>lightning__ServerRenderableWithHydration</capability>
8
+ </capabilities>
6
9
  </LightningComponentBundle>
@@ -0,0 +1,3 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import 'lightning/sldsUtilsVisibility';
3
+ @import './progress-step.slds.css';
@@ -30,7 +30,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
30
30
  }
31
31
 
32
32
  :host([data-render-mode='shadow']) a {
33
- color: var(--slds-g-link-color, var(--slds-g-color-brand-base-50, #0176d3));
33
+ color: var(--slds-s-link-color);
34
34
  text-decoration: var(--_slds-g-font-decoration, none);
35
35
  transition: color 0.1s linear;
36
36
  background-color: transparent;
@@ -219,14 +219,16 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
219
219
  */
220
220
 
221
221
  :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button) {
222
- color: var(--slds-g-color-neutral-base-30, #514f4d);
222
+ color: var(--slds-g-color-on-warning-1);
223
223
  text-decoration: underline;
224
224
 
225
- --slds-c-icon-color-foreground: var(--slds-g-color-neutral-base-30, #514f4d);
225
+ --slds-c-icon-color-foreground: var(--slds-g-color-on-warning-1);
226
226
  }
227
227
 
228
- .slds-theme_warning ::part(button):hover {
229
- color: var(--slds-g-color-neutral-base-50, #706e6b);
228
+ :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button):hover {
229
+ color: color-mix(in oklab, currentColor, transparent 25%);
230
+
231
+ --slds-c-icon-color-foreground: color-mix(in oklab, var(--slds-g-color-on-warning-1), transparent 25%);
230
232
  }
231
233
 
232
234
  :host([data-render-mode="shadow"]) .slds-theme_warning ::part(button):focus {