lightning-base-components 1.21.3-alpha → 1.21.5-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 (233) hide show
  1. package/metadata/raptor.json +49 -0
  2. package/package.json +96 -21
  3. package/scopedImports/@salesforce-label-LightningDatatable.showActions.js +1 -1
  4. package/scopedImports/@salesforce-label-LightningForm.controllerFieldsMessage.js +1 -0
  5. package/scopedImports/@salesforce-label-LightningForm.dependentFieldsHeader.js +1 -0
  6. package/scopedImports/@salesforce-label-LightningForm.dependentFieldsListHeading.js +1 -0
  7. package/scopedImports/@salesforce-label-LightningForm.generalDependentFieldsMessage.js +1 -0
  8. package/scopedImports/@salesforce-label-LightningForm.learnMore.js +1 -0
  9. package/scopedImports/@salesforce-label-LightningForm.okButton.js +1 -0
  10. package/scopedImports/@salesforce-label-LightningLookup.messageWhenSearchTermTooShort.js +1 -0
  11. package/scopedImports/@salesforce-label-LightningLookup.modalCancel.js +1 -0
  12. package/scopedImports/@salesforce-label-LightningLookup.modalSelect.js +1 -0
  13. package/scopedImports/@salesforce-label-LightningProgressIndicator.currentStage.js +1 -1
  14. package/scopedImports/@salesforce-label-LightningProgressIndicator.errorStage.js +1 -0
  15. package/scopedImports/@salesforce-label-LightningProgressIndicator.stageComplete.js +1 -1
  16. package/scopedImports/@salesforce-label-LightningProgressIndicator.stageNotStarted.js +1 -1
  17. package/src/lightning/accordion/__docs__/accordion.md +0 -4
  18. package/src/lightning/accordionSection/__docs__/accordionSection.md +0 -4
  19. package/src/lightning/avatar/__docs__/avatar.md +0 -4
  20. package/src/lightning/avatar/avatar.html +1 -0
  21. package/src/lightning/badge/__docs__/badge.md +0 -4
  22. package/src/lightning/badge/badge.html +3 -3
  23. package/src/lightning/barcodeScanner/__docs__/barcodeScanner.md +0 -4
  24. package/src/lightning/baseCombobox/baseCombobox.html +4 -1
  25. package/src/lightning/baseCombobox/baseCombobox.js +5 -18
  26. package/src/lightning/baseComboboxItem/baseComboboxItem.js +6 -10
  27. package/src/lightning/button/__docs__/button.md +5 -8
  28. package/src/lightning/button/button.js +3 -4
  29. package/src/lightning/buttonGroup/__docs__/buttonGroup.md +0 -4
  30. package/src/lightning/buttonIcon/__docs__/buttonIcon.md +1 -4
  31. package/src/lightning/buttonIcon/buttonIcon.html +1 -1
  32. package/src/lightning/buttonIcon/buttonIcon.js +18 -17
  33. package/src/lightning/buttonIconStateful/__docs__/buttonIconStateful.md +0 -4
  34. package/src/lightning/buttonMenu/__docs__/buttonMenu.md +0 -4
  35. package/src/lightning/buttonMenu/buttonMenu.css +5 -0
  36. package/src/lightning/buttonMenu/buttonMenu.js +2 -0
  37. package/src/lightning/buttonStateful/__docs__/buttonStateful.md +0 -4
  38. package/src/lightning/buttonStateful/buttonStateful.html +5 -3
  39. package/src/lightning/buttonStateful/buttonStateful.js +4 -0
  40. package/src/lightning/card/__docs__/card.md +0 -4
  41. package/src/lightning/card/card.js-meta.xml +3 -0
  42. package/src/lightning/carousel/__docs__/carousel.md +0 -4
  43. package/src/lightning/checkboxGroup/__docs__/checkboxGroup.md +0 -4
  44. package/src/lightning/colorPickerCustom/colorPickerCustom.js +12 -0
  45. package/src/lightning/colorPickerPanel/colorPickerPanel.js +11 -1
  46. package/src/lightning/combobox/__docs__/combobox.md +0 -4
  47. package/src/lightning/combobox/combobox.html +1 -0
  48. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.html +11 -0
  49. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.js +25 -0
  50. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/generateData.js +15 -0
  51. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/customInput.html +4 -0
  52. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/myCustomTypeDatatable.js +17 -0
  53. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/nestedSimpleComponentParent.html +7 -0
  54. package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.html +9 -0
  55. package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.js +6 -0
  56. package/src/lightning/datatable/autoWidthStrategy.js +8 -36
  57. package/src/lightning/datatable/columnResizer.js +51 -161
  58. package/src/lightning/datatable/columnWidthManager.js +25 -81
  59. package/src/lightning/datatable/columns.js +180 -302
  60. package/src/lightning/datatable/datatable.js +454 -441
  61. package/src/lightning/datatable/errors.js +17 -29
  62. package/src/lightning/datatable/fixedWidthStrategy.js +7 -22
  63. package/src/lightning/datatable/headerActions.js +8 -38
  64. package/src/lightning/datatable/indexes.js +42 -0
  65. package/src/lightning/datatable/infiniteLoading.js +16 -35
  66. package/src/lightning/datatable/inlineEdit.js +126 -156
  67. package/src/lightning/datatable/keyboard.js +226 -282
  68. package/src/lightning/datatable/renderManager.js +0 -4
  69. package/src/lightning/datatable/resizeObserver.js +4 -13
  70. package/src/lightning/datatable/rowLevelActions.js +2 -2
  71. package/src/lightning/datatable/rowNumber.js +21 -59
  72. package/src/lightning/datatable/rowSelection.js +95 -178
  73. package/src/lightning/datatable/rowSelectionShared.js +13 -27
  74. package/src/lightning/datatable/rows.js +171 -418
  75. package/src/lightning/datatable/sort.js +16 -75
  76. package/src/lightning/datatable/templates/div/div.html +12 -4
  77. package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +10 -16
  78. package/src/lightning/datatable/templates/table/table.html +15 -5
  79. package/src/lightning/datatable/tree.js +17 -35
  80. package/src/lightning/datatable/types.js +10 -31
  81. package/src/lightning/datatable/utils.js +48 -24
  82. package/src/lightning/datatable/virtualization.js +2 -5
  83. package/src/lightning/datatable/widthManagerShared.js +0 -20
  84. package/src/lightning/datatable/wrapText.js +29 -60
  85. package/src/lightning/dualListbox/__docs__/dualListbox.md +0 -4
  86. package/src/lightning/dualListbox/dualListbox.js +7 -8
  87. package/src/lightning/dynamicIcon/__docs__/dynamicIcon.md +0 -4
  88. package/src/lightning/formattedDateTime/__docs__/formattedDateTime.md +0 -4
  89. package/src/lightning/formattedLocation/__docs__/formattedLocation.md +0 -4
  90. package/src/lightning/formattedName/__docs__/formattedName.md +0 -4
  91. package/src/lightning/formattedName/formattedName.js +3 -2
  92. package/src/lightning/formattedName/formattedName.js-meta.xml +3 -0
  93. package/src/lightning/formattedNumber/__docs__/formattedNumber.md +0 -4
  94. package/src/lightning/formattedNumber/formattedNumber.js +3 -2
  95. package/src/lightning/formattedNumber/formattedNumber.js-meta.xml +3 -0
  96. package/src/lightning/formattedPhone/__docs__/formattedPhone.md +0 -4
  97. package/src/lightning/formattedRichText/richTextConfig.js +1 -0
  98. package/src/lightning/formattedText/__docs__/formattedText.md +0 -4
  99. package/src/lightning/formattedTime/__docs__/formattedTime.md +0 -4
  100. package/src/lightning/formattedUrl/__docs__/formattedUrl.md +0 -4
  101. package/src/lightning/helptext/helptext.css +7 -0
  102. package/src/lightning/helptext/helptext.js +3 -4
  103. package/src/lightning/icon/__docs__/icon.md +0 -4
  104. package/src/lightning/icon/icon.html +1 -1
  105. package/src/lightning/input/input.html +5 -0
  106. package/src/lightning/inputAddress/addressFormat.js +31 -4
  107. package/src/lightning/inputAddress/fieldsLayout.js +6 -0
  108. package/src/lightning/inputAddress/inputAddress.html +19 -1
  109. package/src/lightning/inputAddress/inputAddress.js +80 -3
  110. package/src/lightning/inputLocation/__docs__/inputLocation.md +0 -4
  111. package/src/lightning/internationalizationLibrary/address/AddressFormat.js +553 -610
  112. package/src/lightning/layout/__docs__/layout.md +0 -4
  113. package/src/lightning/layoutItem/__docs__/layoutItem.md +0 -4
  114. package/src/lightning/lookupAddress/lookupAddress.html +6 -1
  115. package/src/lightning/lookupAddress/lookupAddress.js +25 -0
  116. package/src/lightning/menuItem/__docs__/menuItem.md +0 -4
  117. package/src/lightning/menuSubheader/menu-subheader.slds.css +1 -1
  118. package/src/lightning/modal/__docs__/modal.md +10 -1
  119. package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +3 -7
  120. package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +39 -133
  121. package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
  122. package/src/lightning/modal/modal.js +1 -1
  123. package/src/lightning/modalBase/modalBase.html +15 -10
  124. package/src/lightning/modalBase/modalBase.js +132 -147
  125. package/src/lightning/modalBody/modalBody.css +6 -0
  126. package/src/lightning/modalHeader/modalHeader.html +16 -4
  127. package/src/lightning/modalHeader/modalHeader.js +61 -14
  128. package/src/lightning/pill/__docs__/pill.md +0 -4
  129. package/src/lightning/pill/link.html +1 -0
  130. package/src/lightning/pill/plain.html +1 -0
  131. package/src/lightning/pill/plainLink.html +1 -0
  132. package/src/lightning/pillContainer/__docs__/pillContainer.md +0 -4
  133. package/src/lightning/primitiveBubble/primitiveBubble.js +42 -0
  134. package/src/lightning/primitiveDatatableCell/primitiveDatatableCell.js +1 -1
  135. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.html +1 -1
  136. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.js +13 -0
  137. package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +19 -6
  138. package/src/lightning/primitiveHeaderFactory/sortableHeader.html +3 -1
  139. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.css +11 -0
  140. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.html +2 -1
  141. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.js +1 -0
  142. package/src/lightning/progressStep/base.html +5 -6
  143. package/src/lightning/progressStep/progressStep.js +14 -9
  144. package/src/lightning/prompt/__docs__/prompt.md +1 -1
  145. package/src/lightning/radioGroup/__docs__/radioGroup.md +0 -4
  146. package/src/lightning/relativeDateTime/__docs__/relativeDateTime.md +0 -4
  147. package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +0 -2
  148. package/src/lightning/sldsCommon/sldsCommon.css +134 -98
  149. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +1 -1
  150. package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +14 -13
  151. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +95 -92
  152. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +1 -1
  153. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +77 -75
  154. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +73 -73
  155. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +552 -558
  156. package/src/lightning/sldsUtilsVisibility/sldsUtilsVisibility.css +2 -2
  157. package/src/lightning/slider/__docs__/slider.md +0 -4
  158. package/src/lightning/spinner/__docs__/spinner.md +0 -4
  159. package/src/lightning/staticMap/staticMap.js +3 -2
  160. package/src/lightning/tab/__docs__/tab.md +0 -4
  161. package/src/lightning/tab/tab.js +6 -3
  162. package/src/lightning/tab/tab.js-meta.xml +3 -0
  163. package/src/lightning/tabBar/tabBar.js +10 -5
  164. package/src/lightning/tabset/__docs__/tabset.md +0 -4
  165. package/src/lightning/tabset/tabset.html +2 -0
  166. package/src/lightning/tabset/tabset.js-meta.xml +3 -0
  167. package/src/lightning/textarea/__docs__/textarea.md +0 -4
  168. package/src/lightning/textarea/textarea.js +6 -1
  169. package/src/lightning/tile/__docs__/tile.md +0 -4
  170. package/src/lightning/toastContainer/__docs__/toastContainer.md +3 -2
  171. package/src/lightning/tooltipLibrary/tooltipLibrary.js +24 -15
  172. package/src/lightning/tree/__docs__/tree.md +0 -4
  173. package/src/lightning/tree/tree.js +5 -1
  174. package/src/lightning/verticalNavigation/__docs__/verticalNavigation.md +0 -4
  175. package/src/lightning/verticalNavigation/vertical-navigation.slds.css +14 -0
  176. package/src/lightning/verticalNavigation/verticalNavigation.css +1 -1
  177. package/src/lightning/verticalNavigation/verticalNavigation.html +1 -1
  178. package/src/lightning/verticalNavigation/verticalNavigation.js +66 -28
  179. package/src/lightning/verticalNavigation/verticalNavigation.js-meta.xml +3 -0
  180. package/src/lightning/verticalNavigationItem/__docs__/verticalNavigationItem.md +0 -4
  181. package/src/lightning/verticalNavigationItem/vertical-navigation-item.slds.css +63 -0
  182. package/src/lightning/verticalNavigationItem/verticalNavigationItem.css +2 -3
  183. package/src/lightning/verticalNavigationItem/verticalNavigationItem.js +29 -15
  184. package/src/lightning/verticalNavigationItem/verticalNavigationItem.js-meta.xml +3 -0
  185. package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.native.css +2 -0
  186. package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.synthetic.css +3 -0
  187. package/src/lightning/verticalNavigationItemBadge/__docs__/verticalNavigationItemBadge.md +0 -4
  188. package/src/lightning/verticalNavigationItemBadge/badge.slds.css +76 -0
  189. package/src/lightning/verticalNavigationItemBadge/vertical-navigation-item.slds.css +63 -0
  190. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.css +2 -3
  191. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.html +1 -1
  192. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js +28 -15
  193. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js-meta.xml +3 -0
  194. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.native.css +5 -0
  195. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.synthetic.css +3 -0
  196. package/src/lightning/verticalNavigationItemIcon/__docs__/verticalNavigationItemIcon.md +0 -4
  197. package/src/lightning/verticalNavigationItemIcon/vertical-navigation-item.slds.css +63 -0
  198. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.css +2 -3
  199. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js +29 -15
  200. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js-meta.xml +3 -0
  201. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.native.css +3 -0
  202. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.synthetic.css +3 -0
  203. package/src/lightning/verticalNavigationOverflow/button.slds.css +503 -0
  204. package/src/lightning/verticalNavigationOverflow/vertical-navigation-item.slds.css +63 -0
  205. package/src/lightning/verticalNavigationOverflow/vertical-navigation-section.slds.css +17 -0
  206. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.css +2 -1
  207. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.html +2 -0
  208. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js +18 -13
  209. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js-meta.xml +3 -0
  210. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.lbc.native.css +5 -0
  211. package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +14 -14
  212. package/src/lightning/verticalNavigationSection/verticalNavigationSection.js-meta.xml +3 -0
  213. package/src/lightning/datatable/inlineEditShared.js +0 -26
  214. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatableWrapper/customDatatableWrapper.html +0 -0
  215. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatableWrapper/customDatatableWrapper.js +0 -0
  216. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +0 -0
  217. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.js +0 -0
  218. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeLink/customDatatypeLink.html +0 -0
  219. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeLink/customDatatypeLink.js +0 -0
  220. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.html +0 -0
  221. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.js +0 -0
  222. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html +0 -0
  223. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +0 -0
  224. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customDatatypeTable.js +0 -0
  225. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customLink.html +0 -0
  226. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customName.html +0 -0
  227. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customNumber.html +0 -0
  228. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customNumberEdit.html +0 -0
  229. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/deleteRow.html +0 -0
  230. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/iconPill.html +0 -0
  231. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/orderingButtons.html +0 -0
  232. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customNestedComponent/customNestedComponent.html +0 -0
  233. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customNestedComponent/customNestedComponent.js +0 -0
@@ -1,19 +1,18 @@
1
1
  import labelClipText from '@salesforce/label/LightningDatatable.clipText';
2
2
  import labelWrapText from '@salesforce/label/LightningDatatable.wrapText';
3
3
  import { normalizeBoolean } from 'lightning/utilsPrivate';
4
- import { getStateColumnIndex, getColumns } from './columns';
4
+ import { getStateColumnIndex } from './columns';
5
5
  import { normalizeNumberAttribute } from './utils';
6
6
  import { getDefaultState } from './state';
7
7
 
8
- const WRAP_TEXT_DEFAULT = false;
9
- const NON_WRAPPABLE_TYPES = [
8
+ const NON_WRAPPABLE_TYPES = new Set([
10
9
  'action',
11
10
  'boolean',
12
11
  'button',
13
12
  'button-icon',
14
13
  'date-local',
15
14
  'rowNumber',
16
- ];
15
+ ]);
17
16
 
18
17
  const i18n = {
19
18
  clipText: labelClipText,
@@ -22,39 +21,23 @@ const i18n = {
22
21
 
23
22
  /************************** WRAP TEXT STATE **************************/
24
23
 
25
- /**
26
- * Returns a boolean representing whether or not the column should be text wrapped
27
- *
28
- * NOTE: Wrap text is not supported in IE, so default parameters are fine here.
29
- *
30
- * @param {Object} state Datatable's state object
31
- * @param {String} colKeyValue The column key value to look up wrap text configuration
32
- * @returns {Boolean} Whether the text is currently wrapped
33
- */
34
- export function getWrapTextState(state = getDefaultState(), colKeyValue) {
35
- return state.wrapText[colKeyValue] || WRAP_TEXT_DEFAULT;
36
- }
37
-
38
24
  /**
39
25
  * Sets a boolean value in state's wrapText object against the column key value
40
26
  * representing whether or not the column is text wrapped.
41
27
  *
42
- * NOTE: Wrap text is not supported in IE, so default parameters are fine here.
43
- *
44
28
  * @param {Object} state The datatable state
45
- * @param {Object} col The datatable column definitions
29
+ * @param {Object} col The datatable column definition
46
30
  */
47
31
  export function setWrapTextState(state = getDefaultState(), col) {
48
- if (isWrappableType(col.type)) {
49
- state.wrapText[col.colKeyValue] =
50
- normalizeBoolean(col.wrapText) || WRAP_TEXT_DEFAULT;
32
+ if (!NON_WRAPPABLE_TYPES.has(col.type)) {
33
+ state.wrapText[col.colKeyValue] = normalizeBoolean(col.wrapText);
51
34
  }
52
35
  }
53
36
 
54
37
  /************************** WRAP TEXT MAX LINES **************************/
55
38
 
56
39
  /**
57
- * Normalizes and sets wrapTextMaxLines in datatable's state object.
40
+ * Normalizes and sets wrapTextMaxLines in datatable state object.
58
41
  * The normalized value should be a positive integer or it'll fall back to undefined.
59
42
  *
60
43
  * @param {Object} state The datatable state
@@ -100,33 +83,30 @@ function updateWrapTextAndMaxLinesValuesInCells(state, colIndex, colKeyValue) {
100
83
  * @param {Object} col The datatable column definition
101
84
  * @returns {Array} An array of wrap text actions
102
85
  */
103
- export function getActions(state, col) {
104
- const wrapTextActions = [];
105
- const { type, colKeyValue } = col;
106
-
107
- // Must be done first, so getWrapTextState correctly resolves.
86
+ export function getInternalActions(state, col) {
87
+ // Untracked state change.
88
+ // Must be done first, so isTextWrapped correctly resolves.
108
89
  setWrapTextState(state, col);
109
-
110
90
  // If not hidden and isWrapable, sets the internal actions.
111
- if (!col.hideDefaultActions && isWrappableType(type)) {
112
- const isTextWrapped = getWrapTextState(state, colKeyValue);
113
-
114
- wrapTextActions.push({
115
- label: `${i18n.wrapText}`,
116
- title: `${i18n.wrapText}`,
91
+ if (col.hideDefaultActions || NON_WRAPPABLE_TYPES.has(col.type)) {
92
+ return [];
93
+ }
94
+ const isTextWrapped = state.wrapText[col.colKeyValue] || false;
95
+ const { clipText, wrapText } = i18n;
96
+ return [
97
+ {
98
+ label: wrapText,
99
+ title: wrapText,
117
100
  checked: isTextWrapped,
118
101
  name: 'wrapText',
119
- });
120
-
121
- wrapTextActions.push({
122
- label: `${i18n.clipText}`,
123
- title: `${i18n.clipText}`,
102
+ },
103
+ {
104
+ label: clipText,
105
+ title: clipText,
124
106
  checked: !isTextWrapped,
125
107
  name: 'clipText',
126
- });
127
- }
128
-
129
- return wrapTextActions;
108
+ },
109
+ ];
130
110
  }
131
111
 
132
112
  /**
@@ -134,14 +114,15 @@ export function getActions(state, col) {
134
114
  * needs to be changed in the state, change it to the new value and update
135
115
  * the check mark to represent the currently selected action
136
116
  *
137
- * @param {Object} state The datatable state
117
+ * @param {Object} dt The datatable
138
118
  * @param {String} action Action that was selected/triggered
139
119
  * @param {String} colKeyValue Column key value
140
120
  */
141
- export function handleTriggeredAction(state, action, colKeyValue) {
121
+ export function handleTriggeredAction(dt, action, colKeyValue) {
142
122
  const { name } = action;
143
123
  const isWrapText = name === 'wrapText';
144
124
  if (isWrapText || name === 'clipText') {
125
+ const { state } = dt;
145
126
  // If state should be changed
146
127
  if (state.wrapText[colKeyValue] !== isWrapText) {
147
128
  state.shouldResetHeights = true;
@@ -164,7 +145,7 @@ function updateSelectedOptionInHeaderActions(state, colKeyValue) {
164
145
  if (colIndex === -1) {
165
146
  return;
166
147
  }
167
- const columns = getColumns(state);
148
+ const { columns } = state;
168
149
  const col = columns[colIndex];
169
150
  const { internalActions } = col.actions;
170
151
 
@@ -183,15 +164,3 @@ function updateSelectedOptionInHeaderActions(state, colKeyValue) {
183
164
  // Force a refresh on this column, because the wrapText checked value changed.
184
165
  col.actions = Object.assign({}, col.actions);
185
166
  }
186
-
187
- /************************** HELPER FUNCTIONS **************************/
188
-
189
- /**
190
- * Determines if a given column type is wrappable.
191
- *
192
- * @param {String} type The type to check.
193
- * @returns {Boolean} Whether the given type is wrappable.
194
- */
195
- function isWrappableType(type) {
196
- return NON_WRAPPABLE_TYPES.indexOf(type) < 0;
197
- }
@@ -176,7 +176,3 @@ The event properties are as follows.
176
176
  | bubbles | true | This event bubbles up through the DOM. |
177
177
  | cancelable | false | This event has no default behavior that can be canceled. You can't call `preventDefault()` on this event. |
178
178
  | composed | true | This event propagates outside of the component in which it was dispatched. |
179
-
180
- #### Source Code
181
-
182
- `lightning-dual-listbox` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -249,10 +249,6 @@ export default class LightningDualListbox extends LightningShadowBaseClass {
249
249
  reflectAttribute(this, 'variant', this._variant);
250
250
  }
251
251
 
252
- set size(value) {
253
- this._size = value;
254
- }
255
-
256
252
  /**
257
253
  * Number of items that display in the listboxes before vertical scrollbars are displayed. Determines the vertical size of the listbox.
258
254
  * @type {number}
@@ -262,6 +258,9 @@ export default class LightningDualListbox extends LightningShadowBaseClass {
262
258
  get size() {
263
259
  return this._size;
264
260
  }
261
+ set size(value) {
262
+ this._size = value;
263
+ }
265
264
 
266
265
  /**
267
266
  * Help text detailing the purpose and function of the dual listbox.
@@ -269,10 +268,6 @@ export default class LightningDualListbox extends LightningShadowBaseClass {
269
268
  */
270
269
  @api fieldLevelHelp;
271
270
 
272
- set disableReordering(value) {
273
- this._disableReordering = normalizeBoolean(value);
274
- }
275
-
276
271
  /**
277
272
  * If present, the Up and Down buttons used for reordering the selected list items are hidden.
278
273
  * @type {boolean}
@@ -283,6 +278,10 @@ export default class LightningDualListbox extends LightningShadowBaseClass {
283
278
  return this._disableReordering;
284
279
  }
285
280
 
281
+ set disableReordering(value) {
282
+ this._disableReordering = normalizeBoolean(value);
283
+ }
284
+
286
285
  /**
287
286
  * If present, a spinner is displayed in the first listbox to indicate loading activity.
288
287
  * @type {boolean}
@@ -60,7 +60,3 @@ However, on smaller screens and windows the `lightning-dynamic-icon` can also be
60
60
  informational. In this case, include `alternative-text`. If you don't include
61
61
  `alternative-text`, check smaller screens and windows to ensure that the
62
62
  `lightning-dynamic-icon` is only decorative on all formats.
63
-
64
- #### Source Code
65
-
66
- `lightning-dynamic-icon` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -219,10 +219,6 @@ Displays: December 03, 2017, 12:00 PM
219
219
 
220
220
  This component has usage differences from its Aura counterpart. See [Base Components: Aura Vs Lightning Web Components](https://developer.salesforce.com/docs/platform/lwc/guide/migrate-map-aura-lwc-components) in the Lightning Web Components Developer Guide.
221
221
 
222
- #### Source Code
223
-
224
- `lightning-formatted-date-time` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
225
-
226
222
  #### LWC Recipes
227
223
 
228
224
  The [LWC Recipes GitHub repository](https://github.com/trailheadapps/lwc-recipes) contains code examples for Lightning Web Components that you can test in an org.
@@ -27,7 +27,3 @@ longitude of -122.3948370.
27
27
  </lightning-formatted-location>
28
28
  </template>
29
29
  ```
30
-
31
- #### Source Code
32
-
33
- `lightning-formatted-location` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -47,7 +47,3 @@ in the Salesforce Help.
47
47
  To create a form that takes in user input for names, you can use the
48
48
  `lightning-input-name` component, which displays a name compound field that
49
49
  supports user input for salutation, suffix, and so on.
50
-
51
- #### Source Code
52
-
53
- `lightning-formatted-name` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -1,14 +1,15 @@
1
1
  import locale from '@salesforce/i18n/locale';
2
- import { LightningElement, api, track } from 'lwc';
2
+ import { api, track } from 'lwc';
3
3
  import { normalizeString as normalize } from 'lightning/utilsPrivate';
4
4
  import { nameFormat } from 'lightning/internationalizationLibrary';
5
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
5
6
 
6
7
  const DEFAULT_FORMAT = 'long';
7
8
 
8
9
  /**
9
10
  * Displays a formatted name that can include a salutation and suffix.
10
11
  */
11
- export default class LightningFormattedName extends LightningElement {
12
+ export default class LightningFormattedName extends LightningShadowBaseClass {
12
13
  /**
13
14
  * The format to use to display the name. Valid values include short, medium, and long. This value defaults to long.
14
15
  * @type {string}
@@ -3,4 +3,7 @@
3
3
  <isExposed>true</isExposed>
4
4
  <minApiVersion>42.0</minApiVersion>
5
5
  <support>GA</support>
6
+ <capabilities>
7
+ <capability>lightning__ServerRenderableWithHydration</capability>
8
+ </capabilities>
6
9
  </LightningComponentBundle>
@@ -166,10 +166,6 @@ The locale set in your Salesforce user preferences determines how numbers are fo
166
166
  The `format-style` attribute is called the `style` attribute in the Aura version of this component.
167
167
  See [Base Components: Aura Vs Lightning Web Components](https://developer.salesforce.com/docs/platform/lwc/guide/migrate-map-aura-lwc-components).
168
168
 
169
- #### Source Code
170
-
171
- `lightning-formatted-number` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
172
-
173
169
  #### LWC Recipes
174
170
 
175
171
  The [LWC Recipes GitHub repository](https://github.com/trailheadapps/lwc-recipes) contains code examples for Lightning Web Components that you can test in an org.
@@ -1,11 +1,12 @@
1
- import { LightningElement, api } from 'lwc';
1
+ import { api } from 'lwc';
2
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
2
3
  import { numberFormat } from 'lightning/internationalizationLibrary';
3
4
  import { toFormattedNumber } from 'lightning/utilsPrivate';
4
5
 
5
6
  /**
6
7
  * Displays formatted numbers for decimals, currency, and percentages.
7
8
  */
8
- export default class LightningFormattedNumber extends LightningElement {
9
+ export default class LightningFormattedNumber extends LightningShadowBaseClass {
9
10
  /**
10
11
  * The value to be formatted.
11
12
  * @type {number}
@@ -3,4 +3,7 @@
3
3
  <isExposed>true</isExposed>
4
4
  <minApiVersion>0.0</minApiVersion>
5
5
  <support>GA</support>
6
+ <capabilities>
7
+ <capability>lightning__ServerRenderableWithHydration</capability>
8
+ </capabilities>
6
9
  </LightningComponentBundle>
@@ -67,10 +67,6 @@ To display the phone number in plain text without a hyperlink, include the
67
67
  </template>
68
68
  ```
69
69
 
70
- #### Source Code
71
-
72
- `lightning-formatted-phone` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
73
-
74
70
  #### LWC Recipes
75
71
 
76
72
  The [LWC Recipes GitHub repository](https://github.com/trailheadapps/lwc-recipes) contains code examples for Lightning Web Components that you can test in an org.
@@ -110,6 +110,7 @@ const attrWhitelist = Object.freeze([
110
110
  'nowrap',
111
111
  'open',
112
112
  'optimum',
113
+ 'part',
113
114
  'pattern',
114
115
  'placeholder',
115
116
  'poster',
@@ -52,7 +52,3 @@ use `lightning-formatted-email`.
52
52
 
53
53
  For rich text that uses tags beyond anchor tags, use
54
54
  `lightning-formatted-rich-text` instead.
55
-
56
- #### Source Code
57
-
58
- `lightning-formatted-text` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -33,7 +33,3 @@ The following example returns `10:12:30 PM`.
33
33
  Salesforce uses the format HH:mm:ss.SSSZ for time fields. The time field is a
34
34
  timestamp without the date included. Time values in Salesforce are not
35
35
  localized or associated with a time zone.
36
-
37
- #### Source Code
38
-
39
- `lightning-formatted-time` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -113,7 +113,3 @@ behavior with `lightning-formatted-url`.
113
113
  To create a link with a
114
114
  custom `onclick` event handler, use the HTML anchor tag `<a>` instead. To create a URL that navigates to another page in Salesforce, use
115
115
  [`lightning-navigation`](bundle/lightning-navigation/documentation).
116
-
117
- #### Source Code
118
-
119
- `lightning-formatted-url` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -1 +1,8 @@
1
1
  @import './helptext.lbc.native.css';
2
+
3
+ /* TODO: check if this style can be removed once W-14915319 is closed */
4
+ /* Styles required for Multi-Column Sorting Modal in datatable */
5
+ :host(.modal_header) .slds-form-element__icon {
6
+ padding-top: unset;
7
+ padding-left: var(--slds-g-sizing-2);
8
+ }
@@ -30,10 +30,9 @@ export default class LightningHelptext extends LightningShadowBaseClass {
30
30
  content;
31
31
 
32
32
  /**
33
- * Reserved for internal use only.
34
- * Should be set to -1 if button should not
35
- * be focused during tab navigation and should
36
- * be set to 0 if button should be focused.
33
+ * Reserved for internal use only. Use the global tabindex attribute instead.
34
+ * Set tab index to -1 to prevent focus on the button during tab navigation.
35
+ * The default value is 0, which makes the button focusable during tab navigation.
37
36
  * @type {number}
38
37
  */
39
38
  @api tabIndex;
@@ -176,7 +176,3 @@ screens and windows to ensure that the icon is decorative on all formats.
176
176
  Icons are not available in Lightning Out, but they are available in Lightning Components for Visualforce and other experiences.
177
177
 
178
178
  For IE11, the custom icon feature is disabled for now due to performance issues.
179
-
180
- #### Source Code
181
-
182
- `lightning-icon` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -2,7 +2,7 @@
2
2
  <span
3
3
  style={iconBgColorStyle}
4
4
  part="boundary">
5
- <lightning-primitive-icon
5
+ <lightning-primitive-icon exportparts="icon"
6
6
  icon-name={_iconName}
7
7
  size={size}
8
8
  variant={variant}
@@ -15,6 +15,7 @@
15
15
  autocomplete={autocomplete}
16
16
  computed-label-class={computedLabelClass}
17
17
  disabled={disabled}
18
+ exportparts="input-text, input-container, input"
18
19
  field-level-help={fieldLevelHelp}
19
20
  formatter={formatter}
20
21
  format-fraction-digits={formatFractionDigits}
@@ -56,6 +57,7 @@
56
57
  aria-invalid={computedAriaInvalid}
57
58
  checked={checked}
58
59
  disabled={disabled}
60
+ exportparts="indicator"
59
61
  help-message={_helpMessage}
60
62
  label={label}
61
63
  message-toggle-active={messageToggleActive}
@@ -81,6 +83,7 @@
81
83
  aria-invalid={computedAriaInvalid}
82
84
  checked={checked}
83
85
  disabled={disabled}
86
+ exportparts="indicator"
84
87
  field-level-help={fieldLevelHelp}
85
88
  help-message={_helpMessage}
86
89
  helptext-alternative-text={helptextAlternativeText}
@@ -126,6 +129,7 @@
126
129
  aria-roledescription={ariaRoleDescription}
127
130
  aria-label={ariaLabel}
128
131
  disabled={disabled}
132
+ exportparts="indicator"
129
133
  help-message={_helpMessage}
130
134
  label={label}
131
135
  name={name}
@@ -148,6 +152,7 @@
148
152
  aria-roledescription={ariaRoleDescription}
149
153
  aria-label={computedAriaLabel}
150
154
  disabled={disabled}
155
+ exportparts="button"
151
156
  help-message={_helpMessage}
152
157
  label={label}
153
158
  label-class={computedLabelClass}
@@ -18,7 +18,12 @@ export const parseLocaleFormat = function (format) {
18
18
  return [];
19
19
  };
20
20
 
21
- export function getInputOrder(langCode, countryCode, hasCountryPicklist) {
21
+ export function getInputOrder(
22
+ langCode,
23
+ countryCode,
24
+ hasCountryPicklist,
25
+ renderSubpremise
26
+ ) {
22
27
  let inputOrder = addressFormat.getAddressInputOrderAllField(
23
28
  langCode,
24
29
  countryCode
@@ -28,15 +33,37 @@ export function getInputOrder(langCode, countryCode, hasCountryPicklist) {
28
33
  if (hasCountryPicklist) {
29
34
  inputOrder = 'K' + inputOrder.replace('K', '');
30
35
  }
31
- return parseLocaleFormat(inputOrder);
36
+
37
+ const parsed = parseLocaleFormat(inputOrder);
38
+
39
+ // TD-0120510 Render single textarea as two separate inputs
40
+ if (renderSubpremise) {
41
+ const index = parsed.indexOf('street');
42
+ if (index !== -1) {
43
+ parsed.splice(index, 1, 'addressLine1', 'addressLine2');
44
+ }
45
+ }
46
+
47
+ return parsed;
32
48
  }
33
49
 
34
- export function getRequiredFields(langCode, countryCode) {
50
+ export function getRequiredFields(langCode, countryCode, renderSubpremise) {
35
51
  const requireFields = addressFormat.getAddressRequireFields(
36
52
  langCode,
37
53
  countryCode
38
54
  );
39
- return parseLocaleFormat(requireFields);
55
+
56
+ const parsed = parseLocaleFormat(requireFields);
57
+
58
+ // TD-0120510 Subpremise is never required
59
+ if (renderSubpremise) {
60
+ const index = parsed.indexOf('street');
61
+ if (index !== -1) {
62
+ parsed.splice(index, 1, 'addressLine1');
63
+ }
64
+ }
65
+
66
+ return parsed;
40
67
  }
41
68
 
42
69
  function isValidFieldFormat(value) {
@@ -6,6 +6,12 @@ const FIELD_WIDTHS = {
6
6
  street: {
7
7
  width: 6,
8
8
  },
9
+ addressLine1: {
10
+ width: 6,
11
+ },
12
+ addressLine2: {
13
+ width: 6,
14
+ },
9
15
  city: {
10
16
  width: 4,
11
17
  },
@@ -4,7 +4,7 @@
4
4
  part="input-address"
5
5
  >
6
6
  <legend class={computedLegendClass}>
7
- <template if:true={required}>
7
+ <template if:true={addressLabelRequired}>
8
8
  <abbr class="slds-required" title={i18n.required}>*</abbr>
9
9
  </template>
10
10
  {addressLabel}
@@ -36,6 +36,24 @@
36
36
  <template for:each={domFieldsMeta} for:item="row" for:index="index">
37
37
  <div class="slds-form-element__row" key={row.name}>
38
38
  <template for:each={row} for:item="field">
39
+ <template if:true={field.isLookupAddress}>
40
+ <lightning-lookup-address
41
+ always-render
42
+ key={field.name}
43
+ data-field={field.name}
44
+ class={field.classnames}
45
+ label={field.label}
46
+ name={field.name}
47
+ autocomplete={field.autocomplete}
48
+ input-text={field.value}
49
+ placeholder={field.placeholder}
50
+ required={field.required}
51
+ disabled={field.disabled}
52
+ onfocus={handleFocus}
53
+ onblur={handleBlur}
54
+ onchange={handleAddress}
55
+ ></lightning-lookup-address>
56
+ </template>
39
57
  <template if:true={field.isInput}>
40
58
  <lightning-input
41
59
  key={field.name}