lightning-base-components 1.21.5-alpha → 1.21.7-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 (379) hide show
  1. package/metadata/raptor.json +46 -4
  2. package/package.json +125 -3
  3. package/scopedImports/@salesforce-label-LightningColorPicker.a11yDefaultText.js +1 -0
  4. package/scopedImports/@salesforce-label-LightningDatatable.multiColumnSortingToast.js +1 -0
  5. package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuColumns.js +1 -0
  6. package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuMultiColumnSort.js +1 -0
  7. package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuRows.js +1 -0
  8. package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuTooltip.js +1 -0
  9. package/scopedImports/@salesforce-label-LightningForm.dependentFieldsListHeading.js +1 -1
  10. package/scopedImports/@salesforce-label-LightningLookup.advancedSearchMobile.js +1 -1
  11. package/scopedImports/@salesforce-label-LightningLookup.modalTitle.js +1 -0
  12. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.addRule.js +1 -0
  13. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.applyButton.js +1 -0
  14. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.cancelButton.js +1 -0
  15. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.clearButton.js +1 -0
  16. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.duplicateValueValidation.js +1 -0
  17. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.firstRuleHeading.js +1 -0
  18. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.modalTitle.js +1 -0
  19. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.otherRuleHeading.js +1 -0
  20. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.ruleLimit.js +1 -0
  21. package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.ruleLimitReached.js +1 -0
  22. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.ascending.js +1 -0
  23. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.descending.js +1 -0
  24. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.dropdownPlaceholder.js +1 -0
  25. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.missingValueValidation.js +1 -0
  26. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.moveDownTooltip.js +1 -0
  27. package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.moveUpTooltip.js +1 -0
  28. package/scopedImports/@salesforce-label-LightningProgressIndicator.pathCurrentStage.js +1 -0
  29. package/scopedImports/@salesforce-label-LightningRecordPicker.emptyStateNoResultText.js +1 -0
  30. package/scopedImports/@salesforce-label-LightningRecordPicker.messageWhenSearchTermTooShort.js +1 -0
  31. package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForMoreThanOneHundredRecords.js +1 -0
  32. package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForMultipleRecords.js +1 -0
  33. package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForOneRecord.js +1 -0
  34. package/scopedImports/@salesforce-label-LightningRecordPicker.resultsLoading.js +1 -0
  35. package/scopedImports/@salesforce-label-LightningRecordPicker.searchInputHelp.js +1 -0
  36. package/src/lightning/accordion/accordion.js +21 -14
  37. package/src/lightning/accordionSection/button.slds.css +16 -15
  38. package/src/lightning/alert/alert.js +10 -8
  39. package/src/lightning/ariaObserver/ariaObserver.js +19 -5
  40. package/src/lightning/badge/badge.slds.css +1 -1
  41. package/src/lightning/baseCombobox/base-combobox.slds.css +1 -1
  42. package/src/lightning/baseCombobox/baseCombobox.html +2 -1
  43. package/src/lightning/baseCombobox/baseCombobox.js +21 -0
  44. package/src/lightning/baseCombobox/input-text.slds.css +5 -5
  45. package/src/lightning/button/button.js +5 -0
  46. package/src/lightning/button/button.slds.css +16 -15
  47. package/src/lightning/buttonIcon/__docs__/buttonIcon.md +4 -0
  48. package/src/lightning/buttonIcon/__examples__/basic/basic.html +17 -1
  49. package/src/lightning/buttonIcon/button-icon.slds.css +41 -25
  50. package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +33 -229
  51. package/src/lightning/buttonIconStateful/button-icon.slds.css +41 -25
  52. package/src/lightning/buttonIconStateful/button.slds.css +16 -15
  53. package/src/lightning/buttonMenu/button-icon.slds.css +41 -25
  54. package/src/lightning/buttonMenu/button-menu.slds.css +41 -15
  55. package/src/lightning/buttonMenu/button.slds.css +16 -15
  56. package/src/lightning/buttonMenu/buttonMenu.css +1 -1
  57. package/src/lightning/buttonMenu/buttonMenu.html +1 -1
  58. package/src/lightning/buttonMenu/buttonMenu.js +44 -4
  59. package/src/lightning/buttonStateful/button-stateful.slds.css +1 -4
  60. package/src/lightning/buttonStateful/button.slds.css +16 -15
  61. package/src/lightning/calendar/calendar.html +3 -4
  62. package/src/lightning/card/card.html +1 -1
  63. package/src/lightning/colorPickerCustom/colorPickerCustom.html +1 -1
  64. package/src/lightning/colorPickerCustom/colorPickerCustom.js +0 -9
  65. package/src/lightning/colorPickerCustom/input-text.slds.css +5 -5
  66. package/src/lightning/combobox/form-element.slds.css +5 -1
  67. package/src/lightning/confirm/confirm.js +10 -8
  68. package/src/lightning/datatable/__docs__/datatable.md +0 -3
  69. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/README.md +17 -0
  70. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.html +11 -0
  71. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.js +25 -0
  72. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/generateData.js +15 -0
  73. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/customInput.html +4 -0
  74. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/myCustomTypePopupTable.js +17 -0
  75. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/nestedSimpleComponentParent.html +7 -0
  76. package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.html +31 -0
  77. package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.js +36 -0
  78. package/src/lightning/datatable/columnWidthManager.js +19 -16
  79. package/src/lightning/datatable/columns.js +90 -42
  80. package/src/lightning/datatable/datatable.js +571 -148
  81. package/src/lightning/datatable/errors.js +1 -1
  82. package/src/lightning/datatable/indexes.js +32 -21
  83. package/src/lightning/datatable/infiniteLoading.js +7 -6
  84. package/src/lightning/datatable/inlineEdit.js +52 -64
  85. package/src/lightning/datatable/keyboard.js +583 -195
  86. package/src/lightning/datatable/renderManager.js +21 -27
  87. package/src/lightning/datatable/rowLevelActions.js +5 -14
  88. package/src/lightning/datatable/rowSelection.js +36 -17
  89. package/src/lightning/datatable/rowSelectionShared.js +1 -0
  90. package/src/lightning/datatable/rows.js +224 -132
  91. package/src/lightning/datatable/rowsInlining.js +473 -0
  92. package/src/lightning/datatable/sort.js +40 -15
  93. package/src/lightning/datatable/state.js +17 -4
  94. package/src/lightning/datatable/templates/div/div.html +807 -91
  95. package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +29 -3
  96. package/src/lightning/datatable/templates/table/table.css +29 -1
  97. package/src/lightning/datatable/templates/table/table.html +786 -87
  98. package/src/lightning/datatable/tree.js +0 -33
  99. package/src/lightning/datatable/utils.js +50 -0
  100. package/src/lightning/datatable/virtualization.js +44 -19
  101. package/src/lightning/datatable/wrapText.js +7 -10
  102. package/src/lightning/datepicker/datepicker.html +3 -1
  103. package/src/lightning/datepicker/datepicker.js +43 -4
  104. package/src/lightning/datepicker/form-element.slds.css +5 -1
  105. package/src/lightning/datepicker/input-text.slds.css +5 -5
  106. package/src/lightning/datetimepicker/datetimepicker.html +7 -1
  107. package/src/lightning/datetimepicker/datetimepicker.js +30 -2
  108. package/src/lightning/datetimepicker/form-element.slds.css +5 -1
  109. package/src/lightning/datetimepicker/input-text.slds.css +5 -5
  110. package/src/lightning/dualListbox/form-element.slds.css +5 -1
  111. package/src/lightning/focusTrap/focusTrap.css +7 -0
  112. package/src/lightning/groupedCombobox/form-element.slds.css +5 -1
  113. package/src/lightning/groupedCombobox/input-text.slds.css +5 -5
  114. package/src/lightning/helptext/button-icon.slds.css +41 -25
  115. package/src/lightning/helptext/form-element.slds.css +5 -1
  116. package/src/lightning/icon/__docs__/icon.md +0 -2
  117. package/src/lightning/iconSvgTemplates/buildTemplates/standard/account_score.html +8 -0
  118. package/src/lightning/iconSvgTemplates/buildTemplates/standard/aggregate.html +8 -0
  119. package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_participant.html +11 -0
  120. package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_product_participant.html +12 -0
  121. package/src/lightning/iconSvgTemplates/buildTemplates/standard/cost_model.html +7 -0
  122. package/src/lightning/iconSvgTemplates/buildTemplates/standard/labels.html +8 -0
  123. package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_fee.html +7 -0
  124. package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_rate.html +7 -0
  125. package/src/lightning/iconSvgTemplates/buildTemplates/standard/party_profile.html +8 -0
  126. package/src/lightning/iconSvgTemplates/buildTemplates/standard/path_experiment.html +7 -0
  127. package/src/lightning/iconSvgTemplates/buildTemplates/standard/people_score.html +8 -0
  128. package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  129. package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_tier.html +7 -0
  130. package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort.html +7 -0
  131. package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort_member.html +7 -0
  132. package/src/lightning/iconSvgTemplates/buildTemplates/standard/rate_adjustment.html +7 -0
  133. package/src/lightning/iconSvgTemplates/buildTemplates/standard/record_consent.html +7 -0
  134. package/src/lightning/iconSvgTemplates/buildTemplates/standard/whatsapp.html +7 -0
  135. package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +40 -1
  136. package/src/lightning/iconSvgTemplates/buildTemplates/utility/aggregate.html +8 -0
  137. package/src/lightning/iconSvgTemplates/buildTemplates/utility/array.html +7 -0
  138. package/src/lightning/iconSvgTemplates/buildTemplates/utility/bottom_group_alignment.html +7 -0
  139. package/src/lightning/iconSvgTemplates/buildTemplates/utility/cant_sync.html +7 -0
  140. package/src/lightning/iconSvgTemplates/buildTemplates/utility/center_group_alignment.html +8 -0
  141. package/src/lightning/iconSvgTemplates/buildTemplates/utility/columns.html +7 -0
  142. package/src/lightning/iconSvgTemplates/buildTemplates/utility/fully_synced.html +8 -0
  143. package/src/lightning/iconSvgTemplates/buildTemplates/utility/inner_join.html +7 -0
  144. package/src/lightning/iconSvgTemplates/buildTemplates/utility/join.html +8 -0
  145. package/src/lightning/iconSvgTemplates/buildTemplates/utility/left_join.html +14 -0
  146. package/src/lightning/iconSvgTemplates/buildTemplates/utility/macros.html +2 -2
  147. package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_in_sync.html +7 -0
  148. package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_saved.html +9 -0
  149. package/src/lightning/iconSvgTemplates/buildTemplates/utility/outer_join.html +7 -0
  150. package/src/lightning/iconSvgTemplates/buildTemplates/utility/path_experiment.html +7 -0
  151. package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort.html +7 -0
  152. package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort_member.html +7 -0
  153. package/src/lightning/iconSvgTemplates/buildTemplates/utility/record_consent.html +7 -0
  154. package/src/lightning/iconSvgTemplates/buildTemplates/utility/right_join.html +7 -0
  155. package/src/lightning/iconSvgTemplates/buildTemplates/utility/skill.html +8 -0
  156. package/src/lightning/iconSvgTemplates/buildTemplates/utility/sync_in_progress.html +7 -0
  157. package/src/lightning/iconSvgTemplates/buildTemplates/utility/top_group_alignment.html +7 -0
  158. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/account_score.html +8 -0
  159. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/aggregate.html +8 -0
  160. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_participant.html +11 -0
  161. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
  162. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/cost_model.html +7 -0
  163. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/labels.html +8 -0
  164. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_fee.html +7 -0
  165. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_rate.html +7 -0
  166. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/party_profile.html +8 -0
  167. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/path_experiment.html +7 -0
  168. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/people_score.html +8 -0
  169. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  170. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
  171. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort.html +7 -0
  172. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort_member.html +7 -0
  173. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/rate_adjustment.html +7 -0
  174. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/record_consent.html +7 -0
  175. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/whatsapp.html +7 -0
  176. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +40 -1
  177. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/aggregate.html +8 -0
  178. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/array.html +7 -0
  179. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
  180. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/cant_sync.html +7 -0
  181. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/center_group_alignment.html +8 -0
  182. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/columns.html +7 -0
  183. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/fully_synced.html +8 -0
  184. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/inner_join.html +7 -0
  185. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/join.html +8 -0
  186. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/left_join.html +14 -0
  187. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/macros.html +2 -2
  188. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_in_sync.html +7 -0
  189. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_saved.html +9 -0
  190. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/outer_join.html +7 -0
  191. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/path_experiment.html +7 -0
  192. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort.html +7 -0
  193. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort_member.html +7 -0
  194. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/record_consent.html +7 -0
  195. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/right_join.html +7 -0
  196. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/skill.html +8 -0
  197. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/sync_in_progress.html +7 -0
  198. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/top_group_alignment.html +7 -0
  199. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/account_score.html +8 -0
  200. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/aggregate.html +8 -0
  201. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_participant.html +11 -0
  202. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_product_participant.html +12 -0
  203. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/cost_model.html +7 -0
  204. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/labels.html +8 -0
  205. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_fee.html +7 -0
  206. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_rate.html +7 -0
  207. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/party_profile.html +8 -0
  208. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/path_experiment.html +7 -0
  209. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/people_score.html +8 -0
  210. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  211. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_tier.html +7 -0
  212. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort.html +7 -0
  213. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort_member.html +7 -0
  214. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/rate_adjustment.html +7 -0
  215. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/record_consent.html +7 -0
  216. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/whatsapp.html +7 -0
  217. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +19 -1
  218. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/account_score.html +8 -0
  219. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/aggregate.html +8 -0
  220. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_participant.html +11 -0
  221. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
  222. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/cost_model.html +7 -0
  223. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/labels.html +8 -0
  224. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_fee.html +7 -0
  225. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_rate.html +7 -0
  226. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/party_profile.html +8 -0
  227. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/path_experiment.html +7 -0
  228. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/people_score.html +8 -0
  229. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  230. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
  231. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort.html +7 -0
  232. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort_member.html +7 -0
  233. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/rate_adjustment.html +7 -0
  234. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/record_consent.html +7 -0
  235. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/whatsapp.html +7 -0
  236. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +19 -1
  237. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +22 -1
  238. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/aggregate.html +8 -0
  239. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/array.html +7 -0
  240. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/bottom_group_alignment.html +7 -0
  241. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/cant_sync.html +7 -0
  242. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/center_group_alignment.html +8 -0
  243. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/columns.html +7 -0
  244. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/fully_synced.html +8 -0
  245. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/inner_join.html +7 -0
  246. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/join.html +8 -0
  247. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/left_join.html +14 -0
  248. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/macros.html +2 -2
  249. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_in_sync.html +7 -0
  250. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_saved.html +9 -0
  251. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/outer_join.html +7 -0
  252. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/path_experiment.html +7 -0
  253. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort.html +7 -0
  254. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort_member.html +7 -0
  255. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/record_consent.html +7 -0
  256. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/right_join.html +7 -0
  257. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/skill.html +8 -0
  258. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/sync_in_progress.html +7 -0
  259. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/top_group_alignment.html +7 -0
  260. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +22 -1
  261. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/aggregate.html +8 -0
  262. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/array.html +7 -0
  263. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
  264. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/cant_sync.html +7 -0
  265. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/center_group_alignment.html +8 -0
  266. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/columns.html +7 -0
  267. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/fully_synced.html +8 -0
  268. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/inner_join.html +7 -0
  269. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/join.html +8 -0
  270. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/left_join.html +14 -0
  271. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/macros.html +2 -2
  272. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_in_sync.html +7 -0
  273. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_saved.html +9 -0
  274. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/outer_join.html +7 -0
  275. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/path_experiment.html +7 -0
  276. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort.html +7 -0
  277. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort_member.html +7 -0
  278. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/record_consent.html +7 -0
  279. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/right_join.html +7 -0
  280. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/skill.html +8 -0
  281. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/sync_in_progress.html +7 -0
  282. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/top_group_alignment.html +7 -0
  283. package/src/lightning/iconUtils/iconColors.js +1 -1
  284. package/src/lightning/input/form-element.slds.css +5 -1
  285. package/src/lightning/input/input.html +16 -2
  286. package/src/lightning/input/input.js +91 -3
  287. package/src/lightning/input/input.js-meta.xml +3 -0
  288. package/src/lightning/inputAddress/addressFormat.js +25 -11
  289. package/src/lightning/inputAddress/fieldsLayout.js +3 -0
  290. package/src/lightning/inputAddress/form-element.slds.css +5 -1
  291. package/src/lightning/inputAddress/input-text.slds.css +5 -5
  292. package/src/lightning/inputAddress/inputAddress.html +1 -1
  293. package/src/lightning/inputAddress/inputAddress.js +27 -11
  294. package/src/lightning/inputLocation/form-element.slds.css +5 -1
  295. package/src/lightning/inputLocation/input-text.slds.css +5 -5
  296. package/src/lightning/inputName/form-element.slds.css +5 -1
  297. package/src/lightning/inputName/input-text.slds.css +5 -5
  298. package/src/lightning/internationalizationLibrary/address/AddressFormat.js +2 -0
  299. package/src/lightning/layout/__docs__/layout.md +0 -2
  300. package/src/lightning/lookupAddress/form-element.slds.css +5 -1
  301. package/src/lightning/menuItem/menu-item.slds.css +3 -1
  302. package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +7 -3
  303. package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +18 -11
  304. package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
  305. package/src/lightning/modalBase/modalBase.css +4 -0
  306. package/src/lightning/modalBase/modalBase.html +16 -21
  307. package/src/lightning/modalBase/modalBase.js +51 -87
  308. package/src/lightning/modalHeader/modalHeader.html +3 -15
  309. package/src/lightning/modalHeader/modalHeader.js +14 -61
  310. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.css +14 -0
  311. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.html +55 -0
  312. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js +430 -0
  313. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js-meta.xml +4 -0
  314. package/src/lightning/overlayManager/overlayManager.js +16 -0
  315. package/src/lightning/pill/pill.js +19 -13
  316. package/src/lightning/pillContainer/button.slds.css +16 -15
  317. package/src/lightning/pillContainer/pillContainer.js +2 -1
  318. package/src/lightning/pillContainer/standardPillContainer.html +6 -2
  319. package/src/lightning/positionLibrary/direction.js +19 -0
  320. package/src/lightning/primitiveBubble/primitiveBubble.js +33 -11
  321. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.html +2 -2
  322. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +8 -0
  323. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.css +34 -0
  324. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.html +60 -0
  325. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.js +107 -0
  326. package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +37 -4
  327. package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.css +5 -0
  328. package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.html +9 -0
  329. package/src/lightning/primitiveInputCheckbox/form-element.slds.css +5 -1
  330. package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +3 -3
  331. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +1 -1
  332. package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +5 -1
  333. package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +6 -5
  334. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +1 -1
  335. package/src/lightning/primitiveInputColor/form-element.slds.css +5 -1
  336. package/src/lightning/primitiveInputColor/input-text.slds.css +5 -5
  337. package/src/lightning/primitiveInputColor/primitiveInputColor.html +5 -2
  338. package/src/lightning/primitiveInputColor/primitiveInputColor.js +2 -0
  339. package/src/lightning/primitiveInputFile/button.slds.css +16 -15
  340. package/src/lightning/primitiveInputFile/form-element.slds.css +5 -1
  341. package/src/lightning/primitiveInputFile/primitiveInputFile.html +1 -1
  342. package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +1 -1
  343. package/src/lightning/primitiveInputSimple/form-element.slds.css +5 -1
  344. package/src/lightning/primitiveInputSimple/input-text.slds.css +5 -5
  345. package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +3 -2
  346. package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +15 -0
  347. package/src/lightning/primitiveInputToggle/form-element.slds.css +5 -1
  348. package/src/lightning/primitiveInputToggle/input-toggle.slds.css +16 -14
  349. package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +1 -1
  350. package/src/lightning/progressBar/progress-bar.slds.css +1 -1
  351. package/src/lightning/progressIndicator/path.html +8 -2
  352. package/src/lightning/progressIndicator/progressIndicator.js +26 -2
  353. package/src/lightning/progressRing/progress-ring.slds.css +1 -1
  354. package/src/lightning/progressStep/progressStep.js +2 -1
  355. package/src/lightning/prompt/prompt.js +11 -9
  356. package/src/lightning/radioGroup/form-element.slds.css +5 -1
  357. package/src/lightning/radioGroup/input-radio-group.slds.css +4 -10
  358. package/src/lightning/select/form-element.slds.css +5 -1
  359. package/src/lightning/select/select.js +89 -7
  360. package/src/lightning/tabBar/tab-bar.slds.css +11 -0
  361. package/src/lightning/tabset/tabset.slds.css +1 -1
  362. package/src/lightning/textarea/__examples__/various/various.html +18 -1
  363. package/src/lightning/textarea/form-element.slds.css +5 -1
  364. package/src/lightning/textarea/textarea.html +1 -0
  365. package/src/lightning/textarea/textarea.js +25 -0
  366. package/src/lightning/textarea/textarea.slds.css +2 -2
  367. package/src/lightning/timepicker/form-element.slds.css +5 -1
  368. package/src/lightning/timepicker/timepicker.html +4 -1
  369. package/src/lightning/timepicker/timepicker.js +3 -0
  370. package/src/lightning/toast/button-icon.slds.css +41 -25
  371. package/src/lightning/tooltipLibrary/tooltipLibrary.js +4 -15
  372. package/src/lightning/verticalNavigationItem/vertical-navigation-item.slds.css +1 -1
  373. package/src/lightning/verticalNavigationItemBadge/badge.slds.css +1 -1
  374. package/src/lightning/verticalNavigationItemBadge/vertical-navigation-item.slds.css +1 -1
  375. package/src/lightning/verticalNavigationItemIcon/vertical-navigation-item.slds.css +1 -1
  376. package/src/lightning/verticalNavigationOverflow/button.slds.css +16 -15
  377. package/src/lightning/verticalNavigationOverflow/vertical-navigation-item.slds.css +1 -1
  378. package/scopedImports/@salesforce-label-LightningLookup.messageWhenSearchTermTooShort.js +0 -1
  379. package/src/lightning/datatable/columns-shared.js +0 -12
@@ -1,17 +1,24 @@
1
- import { assert } from 'lightning/utilsPrivate';
2
- import { classSet, isObjectLike } from './utils';
3
- import { getAttributesNames } from './types';
4
- import {
5
- getCurrentSelectionLength,
6
- SELECTABLE_HEADER_TYPE,
7
- } from './rowSelectionShared';
1
+ import { assert, isRTL } from 'lightning/utilsPrivate';
8
2
  import {
9
3
  getTypeAttributesValues,
10
4
  getSubTypeAttributesValues,
11
5
  getCellAttributesValues,
12
- generateColKeyValue,
13
6
  } from './columns';
7
+ import { addHeaderIndex } from './indexes';
8
+ import {
9
+ setInliningProperties,
10
+ updateInlineCell,
11
+ updateInlineClassAndStyle,
12
+ updateInlineCellValue,
13
+ } from './rowsInlining';
14
14
  import { getRowNumberError } from './rowNumber';
15
+ import {
16
+ getCurrentSelectionLength,
17
+ SELECTABLE_HEADER_TYPE,
18
+ SORTING_MENU_HEADER_TYPE,
19
+ } from './rowSelectionShared';
20
+ import { getAttributesNames } from './types';
21
+ import { classSet, isObjectLike } from './utils';
15
22
 
16
23
  const CELL_EDIT_CLASS = 'slds-cell-edit';
17
24
  const HAS_ERROR_CLASS = 'slds-has-error';
@@ -19,6 +26,16 @@ const IS_EDITED_CLASS = 'slds-is-edited';
19
26
  const ROLE_BASED_CELL_CLASS = 'cell';
20
27
  const TREE__ITEM_CLASS = 'slds-tree__item';
21
28
 
29
+ function resolveAttributeValue(attrValue, rowData) {
30
+ if (isObjectLike(attrValue)) {
31
+ const { fieldName } = attrValue;
32
+ if (fieldName) {
33
+ return rowData[fieldName];
34
+ }
35
+ }
36
+ return attrValue;
37
+ }
38
+
22
39
  export function setKeyField(state, value) {
23
40
  if (typeof value === 'string') {
24
41
  state.keyField = value;
@@ -32,8 +49,7 @@ export function setKeyField(state, value) {
32
49
  }
33
50
 
34
51
  /**
35
- * It compute the state.rows collection based on the current normalized (data, columns)
36
- * and generate cells indexes map(state.indexes)
52
+ * Compute state.rows and state.indexes based on the current normalized (data, columns).
37
53
  *
38
54
  * TODO: Reduce redundant calls to this function. This is indirectly called by the
39
55
  * setters of 'data' and 'columns'. Additionally, for the role-based table, if we are
@@ -43,28 +59,38 @@ export function setKeyField(state, value) {
43
59
  * @param {Object} state - The datatable state
44
60
  * @param {Object} types - The type handling factory
45
61
  */
46
- export function updateRowsAndCellIndexes(state, types) {
62
+ export function updateRowsAndCells(state, types, datatableId) {
47
63
  const {
48
64
  columns,
49
65
  data,
50
66
  keyField,
51
67
  maxRowSelection,
52
- renderModeRoleBased,
53
- virtualize,
68
+ renderModeInline,
54
69
  rowHeight,
70
+ virtualize,
55
71
  } = state;
72
+ const { privateCustomTypes } = types;
73
+ const rtl = isRTL();
56
74
  const { length: rowCount } = data;
57
- const { dirtyValues } = state.inlineEdit;
58
75
  const { length: colCount } = columns;
59
76
  const currentSelectionLength =
60
77
  maxRowSelection === 1 ? 1 : getCurrentSelectionLength(state);
61
78
  const inputType = maxRowSelection === 1 ? 'radio' : 'checkbox';
79
+ const isInputTypeCheckbox = inputType === 'checkbox';
62
80
 
63
81
  let scopeCol;
64
82
  let treeColTypeAttrs;
83
+
84
+ // Initializing all indexes.
85
+ const indexes = {};
86
+ const headerIndexes = Array(colCount);
87
+
65
88
  for (let colIndex = 0; colIndex < colCount; colIndex += 1) {
66
89
  const col = columns[colIndex];
67
- const { type: columnType } = col;
90
+ const { colKeyValue, type: columnType } = col;
91
+ addHeaderIndex(headerIndexes, indexes, colKeyValue, colIndex);
92
+
93
+ // Find scopeCol
68
94
  if (!scopeCol && col.isScopeCol && types.isValidType(columnType)) {
69
95
  scopeCol = col;
70
96
  }
@@ -73,51 +99,64 @@ export function updateRowsAndCellIndexes(state, types) {
73
99
  }
74
100
  }
75
101
 
76
- // initializing indexes
77
- state.indexes = {};
78
-
79
- const { rows: errorsRows } = state.errors;
102
+ // create arrays to track inlined checkbox, lookup and url cells
103
+ // so they can get necessary updates on re-renders
104
+ const checkboxCells = [];
105
+ const lookupCells = [];
106
+ const shownUrlCells = [];
80
107
  const rows = Array(rowCount);
108
+
109
+ // Store in caches early so data can be referenced by other methods
110
+ // during initialization.
111
+
112
+ // Untracked state changes.
113
+ state.checkboxCells = checkboxCells;
114
+ state.headerIndexes = headerIndexes;
115
+ state.indexes = indexes;
116
+ state.lookupCells = lookupCells;
117
+ state.shownUrlCells = shownUrlCells;
81
118
  // Tracked state changes.
82
119
  state.rows = rows;
83
120
 
121
+ // Add row indexes.
84
122
  for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
85
123
  const rowData = data[rowIndex];
86
124
  const rowDataKeyField = rowData[keyField];
87
125
  const rowKeyValue = rowDataKeyField
88
126
  ? `${rowDataKeyField}`
89
127
  : `row-${rowIndex}`;
90
- const dirtyRowData = dirtyValues[rowKeyValue];
91
- const rowErrors = errorsRows && errorsRows[rowKeyValue];
92
- const cellErrors = rowErrors && rowErrors.cells;
93
- const errorFieldNames = rowErrors && rowErrors.fieldNames;
94
128
 
95
129
  state.indexes[rowKeyValue] = { rowIndex };
96
130
 
97
131
  const isRowSelected = !!state.selectedRowsKeys[rowKeyValue];
132
+ const ariaSelected = isRowSelected ? 'true' : false;
98
133
  const rowNumber = rowIndex + 1;
134
+ const scopeColValue = scopeCol
135
+ ? rowData[scopeCol.fieldName]
136
+ : undefined;
99
137
  const cells = Array(colCount);
138
+ const checkboxHidden = state.hideCheckboxColumn;
100
139
 
101
140
  const row = {
102
- key: rowKeyValue,
103
- cells,
104
- rowIndex,
105
- rowNumber, // for UTAM since methods are base-1
106
141
  ariaRowIndex: rowIndex + 2, // aria attrs are base-1 and also count header as a row
142
+ ariaSelected: checkboxHidden ? null : ariaSelected,
143
+ cells,
144
+ classnames: `slds-hint-parent${
145
+ isRowSelected ? ' slds-is-selected' : ''
146
+ }`,
107
147
  inputType,
108
148
  isSelected: isRowSelected,
109
- ariaSelected: isRowSelected ? 'true' : false,
110
149
  isDisabled:
111
150
  !isRowSelected &&
112
151
  maxRowSelection !== 1 &&
113
152
  currentSelectionLength === maxRowSelection,
114
- classnames: `slds-hint-parent${
115
- isRowSelected ? ' slds-is-selected' : ''
116
- }`,
117
- tabIndex: -1,
153
+ key: rowKeyValue,
154
+ rowIndex,
155
+ rowNumber, // for UTAM since methods are base-1
118
156
  style: virtualize
119
157
  ? `position:absolute;top:${rowIndex * rowHeight}px;`
120
158
  : '',
159
+ tabIndex: -1,
121
160
  level: undefined,
122
161
  posInSet: undefined,
123
162
  setSize: undefined,
@@ -146,70 +185,83 @@ export function updateRowsAndCellIndexes(state, types) {
146
185
  resolveAttributeValue(treeColTypeAttrs.setSize, rowData) || 1;
147
186
  }
148
187
 
188
+ // Store in caches early so data can be referenced by other methods
189
+ // during initialization.
190
+ indexes[rowKeyValue] = row;
149
191
  rows[rowIndex] = row;
150
192
 
151
193
  // Add cell indexes.
152
194
  for (let colIndex = 0; colIndex < colCount; colIndex += 1) {
153
195
  const col = columns[colIndex];
154
196
  const {
155
- columnKey,
156
- fieldName,
197
+ colKeyValue,
157
198
  isScopeCol,
158
199
  label: dataLabel,
159
200
  type: columnType,
160
201
  typeAttributes,
161
202
  } = col;
162
- const colKeyValue = generateColKeyValue(col, colIndex);
203
+ const cellKeyValue = `${rowKeyValue}-${colKeyValue}`;
163
204
  const columnSubType = typeAttributes
164
205
  ? typeAttributes.subType
165
206
  : undefined;
166
- const dirtyValue = dirtyRowData && dirtyRowData[colKeyValue];
167
- const hasError = columnKey
168
- ? !!(cellErrors && cellErrors[columnKey])
169
- : !!(errorFieldNames && errorFieldNames.includes(fieldName));
170
207
  const hasTreeData = columnType === 'tree';
171
- // value based on the fieldName
172
- const value =
173
- dirtyValue === undefined ? rowData[fieldName] : dirtyValue;
208
+ const privateType =
209
+ privateCustomTypes && privateCustomTypes.get(columnType);
210
+ const standardCellLayout = privateType
211
+ ? privateType.standardCellLayout
212
+ : false;
174
213
  const displayReadOnlyIcon = !!col.displayReadOnlyIcon;
175
- const editable = isCellEditable(rowData, col);
214
+ const editable = !!resolveAttributeValue(col.editable, rowData);
215
+ const isEditable = editable && types.isEditableType(columnType);
176
216
  const isValidType = types.isValidType(columnType);
177
217
  const isCheckbox = columnType === SELECTABLE_HEADER_TYPE;
218
+ const isSortingMenu = columnType === SORTING_MENU_HEADER_TYPE;
219
+ const isCustom = privateType !== undefined;
220
+ const isCustomBareLayout = isCustom && !standardCellLayout;
221
+ const isCustomStandardLayout = isCustom && standardCellLayout;
178
222
  const isDataType = isValidType && !isScopeCol;
179
223
  const isDataTypeScope = isValidType && isScopeCol;
180
224
 
181
225
  // cell object creation
182
226
  const cell = {
183
227
  ariaReadOnly: !editable,
228
+ cellKeyValue,
184
229
  class: '',
230
+ colIndex,
185
231
  colKeyValue, // unique column key value
186
232
  columnSubType,
187
233
  columnType,
188
234
  dataLabel,
189
- describedBy: dirtyValue ? 'unsaved-cell-notification' : null,
190
235
  displayReadOnlyIcon,
191
236
  displayValue: rowData.displayValue || '',
237
+ describedBy: null,
192
238
  editable,
193
- hasError,
239
+ hasError: undefined,
240
+ hasTreeData,
194
241
  isCheckbox,
242
+ isCustom,
243
+ isCustomBareLayout,
244
+ isCustomStandardLayout,
195
245
  isDataType,
196
246
  isDataTypeScope,
197
- rowKeyValue: row.key, // unique row key value
198
- style: computeCellStyles(types, col, renderModeRoleBased),
247
+ isEditable,
248
+ isRTL: rtl,
249
+ isSortingMenu,
250
+ rowIndex,
251
+ rowKeyValue, // unique row key value
252
+ rowNumber,
253
+ scopeColValue,
254
+ style: '',
199
255
  tabIndex: -1,
200
- value,
201
- wrapText: state.wrapText[colKeyValue], // wrapText state
202
- wrapTextMaxLines: state.wrapText[colKeyValue]
203
- ? state.wrapTextMaxLines
204
- : undefined,
256
+ value: undefined,
257
+ wrapText: undefined, // wrapText state
258
+ wrapTextMaxLines: 0,
205
259
  };
206
260
 
207
- cell.class = computeCellClassNames(
208
- cell,
209
- hasTreeData,
210
- dirtyValue,
211
- renderModeRoleBased
212
- );
261
+ // Store in caches early so data can be referenced by other methods
262
+ // during initialization.
263
+ indexes[cellKeyValue] = cell;
264
+ cells[colIndex] = cell;
213
265
 
214
266
  if (!col.internal) {
215
267
  // Assign cell type or cell subType attributes.
@@ -219,7 +271,8 @@ export function updateRowsAndCellIndexes(state, types) {
219
271
  attributeNames = getAttributesNames(columnSubType);
220
272
  attributeValues = getSubTypeAttributesValues(col);
221
273
  } else {
222
- attributeNames = types.getType(columnType).typeAttributes;
274
+ const typeDesc = types.getType(columnType);
275
+ attributeNames = typeDesc && typeDesc.typeAttributes;
223
276
  attributeValues = getTypeAttributesValues(col);
224
277
  }
225
278
  const attributeNamesLength = attributeNames
@@ -241,7 +294,7 @@ export function updateRowsAndCellIndexes(state, types) {
241
294
  // object in each row.
242
295
  const cellAttributes = getCellAttributesValues(col);
243
296
  const keys = Object.keys(cellAttributes);
244
- for (let i = 0, { length } = keys; i < length; i += 1) {
297
+ for (let i = 0; i < keys.length; i += 1) {
245
298
  const attrName = keys[i];
246
299
  const attrValue = cellAttributes[attrName];
247
300
  cell[attrName] = resolveAttributeValue(attrValue, rowData);
@@ -260,40 +313,123 @@ export function updateRowsAndCellIndexes(state, types) {
260
313
  cell.typeAttribute22 = row.isExpanded === 'true';
261
314
  }
262
315
  }
263
- // Populate row number attributes.
264
- else if (columnType === 'rowNumber') {
265
- const scopeColValue = rowData[scopeCol.fieldName];
266
- // computes and sets the resolved typeAttribute for the row
267
- // number column error state
268
- cell.typeAttribute0 = getRowNumberError(
269
- rowErrors,
270
- scopeColValue
271
- );
272
- }
273
316
 
274
317
  // adding cell indexes to state.indexes
275
318
  // Keeping the hash for backward compatibility, but we need to have 2 indexes, 1 for columns and one for rows,
276
319
  // because of memory usage and also at certain point we might have the data but not the columns
277
320
  state.indexes[row.key][colKeyValue] = [rowIndex, colIndex];
278
321
  cells[colIndex] = cell;
322
+
323
+ if (renderModeInline) {
324
+ setInliningProperties(
325
+ state,
326
+ cell,
327
+ isInputTypeCheckbox,
328
+ datatableId
329
+ );
330
+ }
331
+ // Update cell properties including class, style, and value properties.
332
+ updateCell(state, rowIndex, colIndex);
333
+
334
+ // Update shownUrlCells state since it's dependent on updateCell
335
+ if (cell.showUrlLink) {
336
+ shownUrlCells.push(cell);
337
+ }
279
338
  }
280
339
  }
340
+
341
+ state.hasCalledUpdateRowsAndCells = true;
281
342
  }
282
343
 
283
344
  /**
284
- * Returns true in the following three cases:
345
+ * Cells are normally updated via updateRowsAndCells().
346
+ * However, a smaller update can be used when modifying datatable properties
347
+ * such as dt.errors and dt.wrapTextMaxLines.
285
348
  *
286
- * (1) typeof column.editable !== 'object' && column.editable
287
- * (2) typeof column.editable === 'object' && !column.editable.fieldName
288
- * (3) typeof column.editable === 'object' && column.editable.fieldName && row[column.editable.fieldName]
289
- *
290
- * Returns false in all other cases.
349
+ * @param {Object} state - The datatable state
350
+ */
351
+ export function updateCells(state, types) {
352
+ if (!state.hasCalledUpdateRowsAndCells) {
353
+ updateRowsAndCells(state, types);
354
+ return;
355
+ }
356
+ const { rows } = state;
357
+ for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
358
+ for (
359
+ let colIndex = 0;
360
+ colIndex < rows[rowIndex].cells.length;
361
+ colIndex += 1
362
+ ) {
363
+ updateCell(state, rowIndex, colIndex);
364
+ }
365
+ }
366
+ }
367
+
368
+ /**
369
+ * Performs a smaller update on the cell at the given rowIndex and colIndex.
370
+ * Used by updateCells() and updateWrapTextAndMaxLinesValuesInCells().
291
371
  *
292
- * @param {object} rowData - a row data object stored in datatable state. Must be truthy.
293
- * @param {object} col - a column data object stored in datatable state. Must be truthy.
372
+ * @param {Object} state - The tracked datatable state
373
+ * @param {Object} rowIndex - The cell row index
374
+ * @param {Object} colIndex - The cell column index
294
375
  */
295
- export function isCellEditable(rowData, col) {
296
- return !!resolveAttributeValue(col.editable, rowData);
376
+ export function updateCell(state, rowIndex, colIndex) {
377
+ const { renderModeRoleBased } = state;
378
+ const { rows: errorsRows } = state.errors;
379
+ const row = state.rows[rowIndex];
380
+ const rowData = state.data[rowIndex];
381
+ const { key: rowKeyValue } = row;
382
+ const dirtyRowData = state.inlineEdit.dirtyValues[rowKeyValue];
383
+ const rowErrors = errorsRows && errorsRows[rowKeyValue];
384
+ const cellErrors = rowErrors && rowErrors.cells;
385
+ const errorFieldNames = rowErrors && rowErrors.fieldNames;
386
+ const col = state.columns[colIndex];
387
+ const cell = row.cells[colIndex];
388
+ const { colKeyValue, columnKey, fieldName } = col;
389
+ const dirtyValue = dirtyRowData && dirtyRowData[colKeyValue];
390
+ const hasError = columnKey
391
+ ? !!(cellErrors && cellErrors[columnKey])
392
+ : !!(errorFieldNames && errorFieldNames.includes(fieldName));
393
+ // value based on the fieldName
394
+ const value = dirtyValue === undefined ? rowData[fieldName] : dirtyValue;
395
+ const wrapText = state.wrapText[colKeyValue];
396
+ const wrapTextMaxLines = wrapText ? state.wrapTextMaxLines : undefined;
397
+
398
+ cell.hasError = hasError;
399
+ cell.wrapText = wrapText;
400
+ cell.wrapTextMaxLines = wrapTextMaxLines;
401
+ cell.value = value;
402
+
403
+ if (col.internal && col.type === 'rowNumber') {
404
+ cell.typeAttribute0 = getRowNumberError(rowErrors, cell.scopeColValue);
405
+ }
406
+
407
+ let cellClass = cell.class;
408
+ if (cell.displayReadOnlyIcon || cell.editable) {
409
+ cellClass += (cellClass.length ? ' ' : '') + CELL_EDIT_CLASS;
410
+ }
411
+ if (cell.hasTreeData) {
412
+ cellClass += (cellClass.length ? ' ' : '') + TREE__ITEM_CLASS;
413
+ }
414
+ if (hasError) {
415
+ cellClass += (cellClass.length ? ' ' : '') + HAS_ERROR_CLASS;
416
+ }
417
+ if (dirtyValue !== undefined) {
418
+ cellClass += (cellClass.length ? ' ' : '') + IS_EDITED_CLASS;
419
+ cell.describedBy = 'unsaved-cell-notification';
420
+ }
421
+ if (renderModeRoleBased) {
422
+ cellClass += (cellClass.length ? ' ' : '') + ROLE_BASED_CELL_CLASS;
423
+ }
424
+
425
+ cell.class = cellClass;
426
+ cell.style = computeCellStyles(cell, col, renderModeRoleBased);
427
+
428
+ if (cell.isInlined) {
429
+ updateInlineCell(cell);
430
+ updateInlineClassAndStyle(cell, cellClass);
431
+ updateInlineCellValue(cell, value);
432
+ }
297
433
  }
298
434
 
299
435
  /**
@@ -308,14 +444,9 @@ export function isCellEditable(rowData, col) {
308
444
  * @param {Boolean} renderModeRoleBased - render mode of datatable (div || table)
309
445
  * @returns {String} - styles to be set on the cell
310
446
  */
311
- function computeCellStyles(types, col, renderModeRoleBased) {
312
- const columnType = col.type;
313
-
447
+ function computeCellStyles(cell, col, renderModeRoleBased) {
314
448
  let cellStyle = '';
315
- if (
316
- types.isCustomType(columnType) &&
317
- !types.isStandardCellLayoutForCustomType(columnType)
318
- ) {
449
+ if (cell.isCustomBareLayout) {
319
450
  // When a custom type is not using the standard layout,
320
451
  // remove the padding that comes with the standard layout
321
452
  cellStyle = 'padding: 0;';
@@ -332,45 +463,6 @@ function computeCellStyles(types, col, renderModeRoleBased) {
332
463
  return cellStyle;
333
464
  }
334
465
 
335
- function computeCellClassNames(
336
- cell,
337
- hasTreeData,
338
- dirtyValue,
339
- renderModeRoleBased
340
- ) {
341
- // TODO: With the current SLDS design, the 'slds-cell-edit' class is required on a cell in cases
342
- // where the read only icon is to be displayed. This is an issue with their design that will need to
343
- // be addressed on their end, so once they do that we can modify this code accordingly.
344
- let cellClass = '';
345
- if (cell.displayReadOnlyIcon || cell.editable) {
346
- cellClass += CELL_EDIT_CLASS;
347
- }
348
- if (hasTreeData) {
349
- cellClass += (cellClass.length ? ' ' : '') + TREE__ITEM_CLASS;
350
- }
351
- if (cell.hasError) {
352
- cellClass += (cellClass.length ? ' ' : '') + HAS_ERROR_CLASS;
353
- }
354
- if (dirtyValue !== undefined) {
355
- cellClass += (cellClass.length ? ' ' : '') + IS_EDITED_CLASS;
356
- }
357
- if (renderModeRoleBased) {
358
- cellClass += (cellClass.length ? ' ' : '') + ROLE_BASED_CELL_CLASS;
359
- }
360
- return cellClass;
361
- }
362
-
363
- function resolveAttributeValue(attrValue, rowData) {
364
- if (isObjectLike(attrValue)) {
365
- const { fieldName } = attrValue;
366
- if (fieldName) {
367
- return rowData[fieldName];
368
- }
369
- }
370
-
371
- return attrValue;
372
- }
373
-
374
466
  /**
375
467
  * For the role-based table, we need to manage the width of each cell separately.
376
468
  * Re-compute the cell styles so that the width of the cell is set
@@ -378,27 +470,27 @@ function resolveAttributeValue(attrValue, rowData) {
378
470
  *
379
471
  * @param {Object} state - Datatable's state object
380
472
  */
381
- export function recomputeCellStyles(types, state) {
473
+ export function recomputeCellStyles(state) {
382
474
  const { columns } = state;
383
475
  state.rows.forEach((row) => {
384
476
  row.cells.forEach((cell, colIndex) => {
385
477
  const colData = columns[colIndex];
386
- cell.style = computeCellStyles(types, colData, true);
478
+ cell.style = computeCellStyles(cell, colData, true);
387
479
  });
388
480
  });
389
481
  }
390
482
 
391
483
  /**
392
- * The cells' classes are normally updated via `updateRowsAndCellIndexes()`. This ideally
393
- * happens after renderMode is set since `updateRowsAndCellIndexes` requires the final
484
+ * The cells' classes are normally updated via `updateRowsAndCells()`. This ideally
485
+ * happens after renderMode is set since `updateRowsAndCells` requires the final
394
486
  * renderMode value in order to set the 'cell' class on each cell.
395
487
  *
396
- * However, in some cases, it's possible that updateRowsAndCellIndexes is called
488
+ * However, in some cases, it's possible that updateRowsAndCells is called
397
489
  * before the renderMode is set (to 'role-based'). This will cause the 'cell' class to NOT be set
398
490
  * in the individual cells because state.renderModeRoleBased will be `false` at that point.
399
491
  * As a result, positioning of the cell content will be off.
400
492
  *
401
- * In such a case where the renderMode is 'role-based' and when the updateRowsAndCellIndexes
493
+ * In such a case where the renderMode is 'role-based' and when the updateRowsAndCells
402
494
  * has already been called (indicated by the presence of 'state.rows'), retroactively
403
495
  * add the 'cell' class to each cell.
404
496
  *