lightning-base-components 1.21.6-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 (368) hide show
  1. package/metadata/raptor.json +45 -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/baseCombobox/base-combobox.slds.css +1 -1
  41. package/src/lightning/baseCombobox/baseCombobox.html +2 -1
  42. package/src/lightning/baseCombobox/baseCombobox.js +21 -0
  43. package/src/lightning/baseCombobox/input-text.slds.css +5 -5
  44. package/src/lightning/button/button.js +5 -0
  45. package/src/lightning/button/button.slds.css +16 -15
  46. package/src/lightning/buttonIcon/__docs__/buttonIcon.md +4 -0
  47. package/src/lightning/buttonIcon/__examples__/basic/basic.html +17 -1
  48. package/src/lightning/buttonIcon/button-icon.slds.css +41 -25
  49. package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +33 -229
  50. package/src/lightning/buttonIconStateful/button-icon.slds.css +41 -25
  51. package/src/lightning/buttonIconStateful/button.slds.css +16 -15
  52. package/src/lightning/buttonMenu/button-icon.slds.css +41 -25
  53. package/src/lightning/buttonMenu/button-menu.slds.css +41 -15
  54. package/src/lightning/buttonMenu/button.slds.css +16 -15
  55. package/src/lightning/buttonMenu/buttonMenu.css +1 -1
  56. package/src/lightning/buttonMenu/buttonMenu.html +1 -1
  57. package/src/lightning/buttonMenu/buttonMenu.js +44 -4
  58. package/src/lightning/buttonStateful/button-stateful.slds.css +1 -4
  59. package/src/lightning/buttonStateful/button.slds.css +16 -15
  60. package/src/lightning/calendar/calendar.html +3 -4
  61. package/src/lightning/card/card.html +1 -1
  62. package/src/lightning/colorPickerCustom/colorPickerCustom.html +1 -1
  63. package/src/lightning/colorPickerCustom/colorPickerCustom.js +0 -9
  64. package/src/lightning/colorPickerCustom/input-text.slds.css +5 -5
  65. package/src/lightning/combobox/form-element.slds.css +1 -0
  66. package/src/lightning/confirm/confirm.js +10 -8
  67. package/src/lightning/datatable/__docs__/datatable.md +0 -3
  68. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/README.md +17 -0
  69. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.html +11 -0
  70. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.js +25 -0
  71. package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/generateData.js +15 -0
  72. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/customInput.html +4 -0
  73. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/myCustomTypePopupTable.js +17 -0
  74. package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/nestedSimpleComponentParent.html +7 -0
  75. package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.html +31 -0
  76. package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.js +36 -0
  77. package/src/lightning/datatable/columnWidthManager.js +19 -16
  78. package/src/lightning/datatable/columns.js +74 -25
  79. package/src/lightning/datatable/datatable.js +493 -133
  80. package/src/lightning/datatable/errors.js +1 -1
  81. package/src/lightning/datatable/indexes.js +32 -19
  82. package/src/lightning/datatable/infiniteLoading.js +6 -5
  83. package/src/lightning/datatable/inlineEdit.js +45 -59
  84. package/src/lightning/datatable/keyboard.js +571 -160
  85. package/src/lightning/datatable/renderManager.js +12 -9
  86. package/src/lightning/datatable/rowLevelActions.js +5 -14
  87. package/src/lightning/datatable/rowSelection.js +36 -17
  88. package/src/lightning/datatable/rowSelectionShared.js +1 -0
  89. package/src/lightning/datatable/rows.js +132 -24
  90. package/src/lightning/datatable/rowsInlining.js +473 -0
  91. package/src/lightning/datatable/sort.js +8 -4
  92. package/src/lightning/datatable/state.js +12 -4
  93. package/src/lightning/datatable/templates/div/div.html +807 -91
  94. package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +29 -3
  95. package/src/lightning/datatable/templates/table/table.css +29 -1
  96. package/src/lightning/datatable/templates/table/table.html +786 -87
  97. package/src/lightning/datatable/utils.js +39 -0
  98. package/src/lightning/datatable/virtualization.js +44 -19
  99. package/src/lightning/datatable/wrapText.js +7 -10
  100. package/src/lightning/datepicker/datepicker.html +3 -1
  101. package/src/lightning/datepicker/datepicker.js +31 -1
  102. package/src/lightning/datepicker/form-element.slds.css +1 -0
  103. package/src/lightning/datepicker/input-text.slds.css +5 -5
  104. package/src/lightning/datetimepicker/datetimepicker.html +7 -1
  105. package/src/lightning/datetimepicker/datetimepicker.js +30 -2
  106. package/src/lightning/datetimepicker/form-element.slds.css +1 -0
  107. package/src/lightning/datetimepicker/input-text.slds.css +5 -5
  108. package/src/lightning/dualListbox/form-element.slds.css +1 -0
  109. package/src/lightning/focusTrap/focusTrap.css +7 -0
  110. package/src/lightning/groupedCombobox/form-element.slds.css +1 -0
  111. package/src/lightning/groupedCombobox/input-text.slds.css +5 -5
  112. package/src/lightning/helptext/button-icon.slds.css +41 -25
  113. package/src/lightning/helptext/form-element.slds.css +1 -0
  114. package/src/lightning/icon/__docs__/icon.md +0 -2
  115. package/src/lightning/iconSvgTemplates/buildTemplates/standard/account_score.html +8 -0
  116. package/src/lightning/iconSvgTemplates/buildTemplates/standard/aggregate.html +8 -0
  117. package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_participant.html +11 -0
  118. package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_product_participant.html +12 -0
  119. package/src/lightning/iconSvgTemplates/buildTemplates/standard/cost_model.html +7 -0
  120. package/src/lightning/iconSvgTemplates/buildTemplates/standard/labels.html +8 -0
  121. package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_fee.html +7 -0
  122. package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_rate.html +7 -0
  123. package/src/lightning/iconSvgTemplates/buildTemplates/standard/party_profile.html +8 -0
  124. package/src/lightning/iconSvgTemplates/buildTemplates/standard/path_experiment.html +7 -0
  125. package/src/lightning/iconSvgTemplates/buildTemplates/standard/people_score.html +8 -0
  126. package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  127. package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_tier.html +7 -0
  128. package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort.html +7 -0
  129. package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort_member.html +7 -0
  130. package/src/lightning/iconSvgTemplates/buildTemplates/standard/rate_adjustment.html +7 -0
  131. package/src/lightning/iconSvgTemplates/buildTemplates/standard/record_consent.html +7 -0
  132. package/src/lightning/iconSvgTemplates/buildTemplates/standard/whatsapp.html +7 -0
  133. package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +40 -1
  134. package/src/lightning/iconSvgTemplates/buildTemplates/utility/aggregate.html +8 -0
  135. package/src/lightning/iconSvgTemplates/buildTemplates/utility/array.html +7 -0
  136. package/src/lightning/iconSvgTemplates/buildTemplates/utility/bottom_group_alignment.html +7 -0
  137. package/src/lightning/iconSvgTemplates/buildTemplates/utility/cant_sync.html +7 -0
  138. package/src/lightning/iconSvgTemplates/buildTemplates/utility/center_group_alignment.html +8 -0
  139. package/src/lightning/iconSvgTemplates/buildTemplates/utility/columns.html +7 -0
  140. package/src/lightning/iconSvgTemplates/buildTemplates/utility/fully_synced.html +8 -0
  141. package/src/lightning/iconSvgTemplates/buildTemplates/utility/inner_join.html +7 -0
  142. package/src/lightning/iconSvgTemplates/buildTemplates/utility/join.html +8 -0
  143. package/src/lightning/iconSvgTemplates/buildTemplates/utility/left_join.html +14 -0
  144. package/src/lightning/iconSvgTemplates/buildTemplates/utility/macros.html +2 -2
  145. package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_in_sync.html +7 -0
  146. package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_saved.html +9 -0
  147. package/src/lightning/iconSvgTemplates/buildTemplates/utility/outer_join.html +7 -0
  148. package/src/lightning/iconSvgTemplates/buildTemplates/utility/path_experiment.html +7 -0
  149. package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort.html +7 -0
  150. package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort_member.html +7 -0
  151. package/src/lightning/iconSvgTemplates/buildTemplates/utility/record_consent.html +7 -0
  152. package/src/lightning/iconSvgTemplates/buildTemplates/utility/right_join.html +7 -0
  153. package/src/lightning/iconSvgTemplates/buildTemplates/utility/skill.html +8 -0
  154. package/src/lightning/iconSvgTemplates/buildTemplates/utility/sync_in_progress.html +7 -0
  155. package/src/lightning/iconSvgTemplates/buildTemplates/utility/top_group_alignment.html +7 -0
  156. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/account_score.html +8 -0
  157. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/aggregate.html +8 -0
  158. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_participant.html +11 -0
  159. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
  160. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/cost_model.html +7 -0
  161. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/labels.html +8 -0
  162. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_fee.html +7 -0
  163. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_rate.html +7 -0
  164. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/party_profile.html +8 -0
  165. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/path_experiment.html +7 -0
  166. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/people_score.html +8 -0
  167. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  168. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
  169. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort.html +7 -0
  170. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort_member.html +7 -0
  171. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/rate_adjustment.html +7 -0
  172. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/record_consent.html +7 -0
  173. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/whatsapp.html +7 -0
  174. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +40 -1
  175. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/aggregate.html +8 -0
  176. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/array.html +7 -0
  177. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
  178. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/cant_sync.html +7 -0
  179. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/center_group_alignment.html +8 -0
  180. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/columns.html +7 -0
  181. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/fully_synced.html +8 -0
  182. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/inner_join.html +7 -0
  183. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/join.html +8 -0
  184. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/left_join.html +14 -0
  185. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/macros.html +2 -2
  186. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_in_sync.html +7 -0
  187. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_saved.html +9 -0
  188. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/outer_join.html +7 -0
  189. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/path_experiment.html +7 -0
  190. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort.html +7 -0
  191. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort_member.html +7 -0
  192. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/record_consent.html +7 -0
  193. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/right_join.html +7 -0
  194. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/skill.html +8 -0
  195. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/sync_in_progress.html +7 -0
  196. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/top_group_alignment.html +7 -0
  197. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/account_score.html +8 -0
  198. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/aggregate.html +8 -0
  199. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_participant.html +11 -0
  200. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_product_participant.html +12 -0
  201. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/cost_model.html +7 -0
  202. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/labels.html +8 -0
  203. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_fee.html +7 -0
  204. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_rate.html +7 -0
  205. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/party_profile.html +8 -0
  206. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/path_experiment.html +7 -0
  207. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/people_score.html +8 -0
  208. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  209. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_tier.html +7 -0
  210. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort.html +7 -0
  211. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort_member.html +7 -0
  212. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/rate_adjustment.html +7 -0
  213. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/record_consent.html +7 -0
  214. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/whatsapp.html +7 -0
  215. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +19 -1
  216. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/account_score.html +8 -0
  217. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/aggregate.html +8 -0
  218. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_participant.html +11 -0
  219. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
  220. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/cost_model.html +7 -0
  221. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/labels.html +8 -0
  222. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_fee.html +7 -0
  223. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_rate.html +7 -0
  224. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/party_profile.html +8 -0
  225. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/path_experiment.html +7 -0
  226. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/people_score.html +8 -0
  227. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
  228. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
  229. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort.html +7 -0
  230. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort_member.html +7 -0
  231. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/rate_adjustment.html +7 -0
  232. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/record_consent.html +7 -0
  233. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/whatsapp.html +7 -0
  234. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +19 -1
  235. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +22 -1
  236. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/aggregate.html +8 -0
  237. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/array.html +7 -0
  238. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/bottom_group_alignment.html +7 -0
  239. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/cant_sync.html +7 -0
  240. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/center_group_alignment.html +8 -0
  241. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/columns.html +7 -0
  242. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/fully_synced.html +8 -0
  243. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/inner_join.html +7 -0
  244. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/join.html +8 -0
  245. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/left_join.html +14 -0
  246. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/macros.html +2 -2
  247. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_in_sync.html +7 -0
  248. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_saved.html +9 -0
  249. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/outer_join.html +7 -0
  250. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/path_experiment.html +7 -0
  251. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort.html +7 -0
  252. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort_member.html +7 -0
  253. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/record_consent.html +7 -0
  254. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/right_join.html +7 -0
  255. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/skill.html +8 -0
  256. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/sync_in_progress.html +7 -0
  257. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/top_group_alignment.html +7 -0
  258. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +22 -1
  259. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/aggregate.html +8 -0
  260. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/array.html +7 -0
  261. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
  262. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/cant_sync.html +7 -0
  263. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/center_group_alignment.html +8 -0
  264. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/columns.html +7 -0
  265. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/fully_synced.html +8 -0
  266. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/inner_join.html +7 -0
  267. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/join.html +8 -0
  268. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/left_join.html +14 -0
  269. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/macros.html +2 -2
  270. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_in_sync.html +7 -0
  271. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_saved.html +9 -0
  272. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/outer_join.html +7 -0
  273. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/path_experiment.html +7 -0
  274. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort.html +7 -0
  275. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort_member.html +7 -0
  276. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/record_consent.html +7 -0
  277. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/right_join.html +7 -0
  278. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/skill.html +8 -0
  279. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/sync_in_progress.html +7 -0
  280. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/top_group_alignment.html +7 -0
  281. package/src/lightning/iconUtils/iconColors.js +1 -1
  282. package/src/lightning/input/form-element.slds.css +1 -0
  283. package/src/lightning/input/input.html +16 -2
  284. package/src/lightning/input/input.js +91 -3
  285. package/src/lightning/input/input.js-meta.xml +3 -0
  286. package/src/lightning/inputAddress/addressFormat.js +25 -11
  287. package/src/lightning/inputAddress/fieldsLayout.js +3 -0
  288. package/src/lightning/inputAddress/form-element.slds.css +1 -0
  289. package/src/lightning/inputAddress/input-text.slds.css +5 -5
  290. package/src/lightning/inputAddress/inputAddress.html +1 -1
  291. package/src/lightning/inputAddress/inputAddress.js +27 -11
  292. package/src/lightning/inputLocation/form-element.slds.css +1 -0
  293. package/src/lightning/inputLocation/input-text.slds.css +5 -5
  294. package/src/lightning/inputName/form-element.slds.css +1 -0
  295. package/src/lightning/inputName/input-text.slds.css +5 -5
  296. package/src/lightning/internationalizationLibrary/address/AddressFormat.js +2 -0
  297. package/src/lightning/layout/__docs__/layout.md +0 -2
  298. package/src/lightning/lookupAddress/form-element.slds.css +1 -0
  299. package/src/lightning/menuItem/menu-item.slds.css +3 -1
  300. package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +7 -3
  301. package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +18 -11
  302. package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
  303. package/src/lightning/modalBase/modalBase.css +4 -0
  304. package/src/lightning/modalBase/modalBase.html +16 -21
  305. package/src/lightning/modalBase/modalBase.js +46 -65
  306. package/src/lightning/modalHeader/modalHeader.html +3 -15
  307. package/src/lightning/modalHeader/modalHeader.js +14 -61
  308. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.css +14 -0
  309. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.html +55 -0
  310. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js +430 -0
  311. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js-meta.xml +4 -0
  312. package/src/lightning/overlayManager/overlayManager.js +16 -0
  313. package/src/lightning/pill/pill.js +19 -13
  314. package/src/lightning/pillContainer/button.slds.css +16 -15
  315. package/src/lightning/pillContainer/pillContainer.js +2 -1
  316. package/src/lightning/pillContainer/standardPillContainer.html +6 -2
  317. package/src/lightning/positionLibrary/direction.js +19 -0
  318. package/src/lightning/primitiveBubble/primitiveBubble.js +7 -0
  319. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.html +2 -2
  320. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +8 -0
  321. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.css +34 -0
  322. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.html +60 -0
  323. package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.js +107 -0
  324. package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +36 -3
  325. package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.css +5 -0
  326. package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.html +9 -0
  327. package/src/lightning/primitiveInputCheckbox/form-element.slds.css +1 -0
  328. package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +3 -3
  329. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +1 -1
  330. package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +1 -0
  331. package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +6 -5
  332. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +1 -1
  333. package/src/lightning/primitiveInputColor/form-element.slds.css +1 -0
  334. package/src/lightning/primitiveInputColor/input-text.slds.css +5 -5
  335. package/src/lightning/primitiveInputColor/primitiveInputColor.html +5 -2
  336. package/src/lightning/primitiveInputColor/primitiveInputColor.js +2 -0
  337. package/src/lightning/primitiveInputFile/button.slds.css +16 -15
  338. package/src/lightning/primitiveInputFile/form-element.slds.css +1 -0
  339. package/src/lightning/primitiveInputFile/primitiveInputFile.html +1 -1
  340. package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +1 -1
  341. package/src/lightning/primitiveInputSimple/form-element.slds.css +1 -0
  342. package/src/lightning/primitiveInputSimple/input-text.slds.css +5 -5
  343. package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +3 -2
  344. package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +15 -0
  345. package/src/lightning/primitiveInputToggle/form-element.slds.css +1 -0
  346. package/src/lightning/primitiveInputToggle/input-toggle.slds.css +16 -14
  347. package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +1 -1
  348. package/src/lightning/progressIndicator/path.html +8 -2
  349. package/src/lightning/progressIndicator/progressIndicator.js +26 -2
  350. package/src/lightning/progressRing/progress-ring.slds.css +1 -1
  351. package/src/lightning/progressStep/progressStep.js +2 -1
  352. package/src/lightning/prompt/prompt.js +11 -9
  353. package/src/lightning/radioGroup/form-element.slds.css +1 -0
  354. package/src/lightning/radioGroup/input-radio-group.slds.css +4 -10
  355. package/src/lightning/select/form-element.slds.css +1 -0
  356. package/src/lightning/select/select.js +89 -7
  357. package/src/lightning/tabBar/tab-bar.slds.css +11 -0
  358. package/src/lightning/tabset/tabset.slds.css +1 -1
  359. package/src/lightning/textarea/form-element.slds.css +1 -0
  360. package/src/lightning/textarea/textarea.html +1 -0
  361. package/src/lightning/textarea/textarea.slds.css +2 -2
  362. package/src/lightning/timepicker/form-element.slds.css +1 -0
  363. package/src/lightning/timepicker/timepicker.html +4 -1
  364. package/src/lightning/timepicker/timepicker.js +3 -0
  365. package/src/lightning/toast/button-icon.slds.css +41 -25
  366. package/src/lightning/tooltipLibrary/tooltipLibrary.js +4 -15
  367. package/src/lightning/verticalNavigationOverflow/button.slds.css +16 -15
  368. package/scopedImports/@salesforce-label-LightningLookup.messageWhenSearchTermTooShort.js +0 -1
@@ -0,0 +1,473 @@
1
+ import labelEdit from '@salesforce/label/LightningDatatable.edit';
2
+ import labelEditHasError from '@salesforce/label/LightningDatatable.editHasError';
3
+ import labelEmailLabel from '@salesforce/label/LightningFormattedEmail.emailIconLabel';
4
+ import labelFalse from '@salesforce/label/LightningDatatable.false';
5
+ import labelSelectItem from '@salesforce/label/LightningDatatable.selectItem';
6
+ import labelTrue from '@salesforce/label/LightningDatatable.true';
7
+ import {
8
+ dateTimeFormat,
9
+ numberFormat,
10
+ toDate,
11
+ } from 'lightning/internationalizationLibrary';
12
+ import {
13
+ isTextIgnoreRTL,
14
+ isValidPhone,
15
+ makeAbsoluteUrl,
16
+ parseToFormattedLinkifiedParts,
17
+ toFormattedLocation,
18
+ toFormattedNumber,
19
+ toFormattedDate,
20
+ toNorthAmericanPhoneNumber,
21
+ } from 'lightning/utilsPrivate';
22
+ import { TOOLTIP_ALLOWANCE } from './rowNumber';
23
+ import { getDefaultState } from './state';
24
+
25
+ const CELL_MARGIN_LEFT_CLASS = 'slds-m-left_x-small';
26
+ const CELL_WRAP = 'slds-cell-wrap';
27
+ const GRID_CLASS = 'slds-grid';
28
+ const GRID_ALIGN_END_CLASS = 'slds-grid_align-end';
29
+ const GRID_ALIGN_SPREAD_CLASS = 'slds-grid_align-spread';
30
+ const HYPHENATE_CLASS = 'slds-hyphenate';
31
+ const LINE_CLAMP_CLASS = 'slds-line-clamp';
32
+ const LTR_CONTENT_IN_RTL_CLASS = 'ltr-content-in-rtl';
33
+ const NO_SPACE_CLASS = 'slds-no-space';
34
+ const TRUNCATE_CLASS = 'slds-truncate';
35
+
36
+ const { keyboardMode: DEFAULT_KEYBOARD_MODE } = getDefaultState();
37
+
38
+ const i18n = {
39
+ edit: labelEdit,
40
+ editHasError: labelEditHasError,
41
+ emailLabel: labelEmailLabel,
42
+ false: labelFalse,
43
+ selectItem: labelSelectItem,
44
+ true: labelTrue,
45
+ };
46
+
47
+ const noopHandler = () => {};
48
+
49
+ const BASE_INLINING_PROPS = {
50
+ isInlined: true,
51
+ actionableElementsCount: 0,
52
+ computedCellDivClass: '',
53
+ computedCellDivStyle: '',
54
+ computedMarginClassWhenLeftIconExists: '',
55
+ computedWrapperClass: '',
56
+ currentInputIndex: 0,
57
+ editIconAssistiveText: '',
58
+ hasFocus: false,
59
+ hasLeftIcon: false,
60
+ hasRightIcon: false,
61
+ internalTabIndex: -1,
62
+ isRTL: false, // url, email, phone
63
+ mode: DEFAULT_KEYBOARD_MODE,
64
+ shouldDisplayReadOnlyIcon: false,
65
+ };
66
+
67
+ /**
68
+ * Adds all properties to cell required to inline the given type
69
+ *
70
+ * @param {Object} state - The datatable state
71
+ * @param {Object} cell - The datatable cell
72
+ * @param {Boolean} isInputTypeCheckbox - Whether input is using checkbox type
73
+ * @param {String} datatableId - Unique id for the datatable
74
+ */
75
+ export function setInliningProperties(
76
+ state,
77
+ cell,
78
+ isInputTypeCheckbox,
79
+ datatableId
80
+ ) {
81
+ const { columnSubType, columnType, isCheckbox, isCustom } = cell;
82
+
83
+ // boolean
84
+ if ('boolean' === columnType || 'boolean' === columnSubType) {
85
+ Object.assign(cell, BASE_INLINING_PROPS, {
86
+ isBoolean: true,
87
+ isChecked: false,
88
+ booleanCellAssistiveText: '',
89
+ });
90
+ }
91
+ // checkbox
92
+ else if (isCheckbox && isInputTypeCheckbox) {
93
+ const { rowNumber } = cell;
94
+ Object.assign(cell, BASE_INLINING_PROPS, {
95
+ checkboxId: `${datatableId}-check-id-${rowNumber}`,
96
+ checkboxLabelId: `check-button-label-${rowNumber}`,
97
+ checkboxName: `${datatableId}-options-${rowNumber}`,
98
+ checkboxSelectItemAssistiveText: `${i18n.selectItem} ${rowNumber}`,
99
+ });
100
+ state.checkboxCells.push(cell);
101
+ }
102
+ // radio
103
+ else if (isCheckbox) {
104
+ // radio inputs are not inlined
105
+ Object.assign(cell, { isInlined: false });
106
+ }
107
+ // custom
108
+ else if (isCustom) {
109
+ Object.assign(cell, BASE_INLINING_PROPS, {
110
+ keyboardMode: '', // should be defined
111
+ });
112
+ }
113
+ // currency
114
+ else if ('currency' === columnType || 'currency' === columnSubType) {
115
+ Object.assign(cell, BASE_INLINING_PROPS, {
116
+ isCurrency: true,
117
+ currencyValue: '',
118
+ });
119
+ }
120
+ // date-local
121
+ else if ('date-local' === columnType || 'date-local' === columnSubType) {
122
+ Object.assign(cell, BASE_INLINING_PROPS, {
123
+ isDateLocal: true,
124
+ dateLocalValue: '',
125
+ });
126
+ }
127
+ // date
128
+ else if ('date' === columnType || 'date' === columnSubType) {
129
+ Object.assign(cell, BASE_INLINING_PROPS, {
130
+ isDateTime: true,
131
+ dateTimeValue: '',
132
+ });
133
+ }
134
+ // email
135
+ else if ('email' === columnType || 'email' === columnSubType) {
136
+ Object.assign(cell, BASE_INLINING_PROPS, {
137
+ isEmail: true,
138
+ emailIconAssistiveText: '',
139
+ emailIconHidden: false,
140
+ emailLabel: '',
141
+ showEmailLink: false,
142
+ });
143
+ }
144
+ // location
145
+ else if ('location' === columnType || 'location' === columnSubType) {
146
+ Object.assign(cell, BASE_INLINING_PROPS, {
147
+ isLocation: true,
148
+ locationValue: '',
149
+ });
150
+ }
151
+ // lookup
152
+ else if ('reference' === columnType || 'reference' === columnSubType) {
153
+ Object.assign(cell, BASE_INLINING_PROPS, {
154
+ isLookup: true,
155
+ _handleLookupAnchorClick: noopHandler,
156
+ handleLookupAnchorClick: (event) => {
157
+ cell._handleLookupAnchorClick(event);
158
+ },
159
+ lookupIsNavigable: false,
160
+ lookupLink: '',
161
+ lookupValue: cell.typeAttribute0,
162
+ });
163
+ state.lookupCells.push(cell);
164
+ }
165
+ // number
166
+ else if ('number' === columnType || 'number' === columnSubType) {
167
+ Object.assign(cell, BASE_INLINING_PROPS, {
168
+ isNumber: true,
169
+ numberValue: '',
170
+ });
171
+ }
172
+ // percent
173
+ else if ('percent' === columnType || 'percent' === columnSubType) {
174
+ Object.assign(cell, BASE_INLINING_PROPS, {
175
+ isPercent: true,
176
+ percentValue: '',
177
+ });
178
+ }
179
+ // phone
180
+ else if ('phone' === columnType || 'phone' === columnSubType) {
181
+ Object.assign(cell, BASE_INLINING_PROPS, {
182
+ isPhone: true,
183
+ phoneLabel: '',
184
+ phoneLink: '',
185
+ showPhoneLink: false,
186
+ });
187
+ }
188
+ // row number
189
+ else if ('rowNumber' === columnType || 'rowNumber' === columnSubType) {
190
+ Object.assign(cell, BASE_INLINING_PROPS, {
191
+ isRowNumber: true,
192
+ computedRowNumberStyle: '',
193
+ rowHasError: false,
194
+ });
195
+ }
196
+ // text
197
+ else if ('text' === columnType || 'text' === columnSubType) {
198
+ Object.assign(cell, BASE_INLINING_PROPS, {
199
+ isText: true,
200
+ ignoreRTL: false,
201
+ shouldFormatText: false,
202
+ textParts: undefined,
203
+ textValue: undefined,
204
+ });
205
+ }
206
+ // url
207
+ else if ('url' === columnType || 'url' === columnSubType) {
208
+ Object.assign(cell, BASE_INLINING_PROPS, {
209
+ isURL: true,
210
+ _handleUrlAnchorClick: undefined,
211
+ handlUrlAnchorClick: undefined,
212
+ showUrlLink: false,
213
+ urlLabel: '',
214
+ urlLink: '',
215
+ urlTarget: '',
216
+ urlTooltip: '',
217
+ });
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Use to calculate a small subset of cell properties
223
+ *
224
+ * @param {Object} state - The datatable state
225
+ * @param {Boolean} hasError - Whether an error is present on the cell
226
+ */
227
+ export function updateInlineCell(cell) {
228
+ if (cell.isEditable) {
229
+ cell.editIconAssistiveText = `${i18n.edit} ${cell.dataLabel}${
230
+ cell.hasError ? ` ${i18n.editHasError}` : ''
231
+ }`;
232
+ } else {
233
+ cell.shouldDisplayReadOnlyIcon = cell.displayReadOnlyIcon;
234
+ }
235
+ if (cell.iconName) {
236
+ const { iconPosition } = cell;
237
+ if (iconPosition === 'right') {
238
+ cell.hasRightIcon = true;
239
+ } else if (!iconPosition || iconPosition === 'left') {
240
+ cell.hasLeftIcon = true;
241
+ }
242
+ }
243
+ if (cell.isRowNumber) {
244
+ const { typeAttribute0: error } = cell;
245
+ const rowHasError = !!(error && error.title && error.messages);
246
+ cell.computedRowNumberStyle = rowHasError
247
+ ? ''
248
+ : `padding-left: ${TOOLTIP_ALLOWANCE}px;`;
249
+ cell.rowHasError = rowHasError;
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Use to calculate the class and style for an inlined cell
255
+ *
256
+ * @param {Object} cell - The datatable cell
257
+ * @param {String} cellClass - Class string calculated for cell so far
258
+ */
259
+ export function updateInlineClassAndStyle(cell, cellClass) {
260
+ let computedCellDivClass = '';
261
+ let computedCellDivStyle = '';
262
+ const { alignment, columnType, hasTreeData, wrapText } = cell;
263
+ if (wrapText) {
264
+ cellClass += (cellClass.length ? ' ' : '') + CELL_WRAP;
265
+ computedCellDivClass += HYPHENATE_CLASS;
266
+ const { wrapTextMaxLines } = cell;
267
+ if (wrapTextMaxLines) {
268
+ computedCellDivClass += ` ${LINE_CLAMP_CLASS}`;
269
+ computedCellDivStyle = `--lwc-lineClamp: ${wrapTextMaxLines};`;
270
+ }
271
+ } else {
272
+ computedCellDivClass += TRUNCATE_CLASS;
273
+ }
274
+ if (
275
+ cell.isRTL &&
276
+ // is LTR type
277
+ (columnType === 'url' ||
278
+ columnType === 'email' ||
279
+ columnType === 'phone')
280
+ ) {
281
+ computedCellDivClass += ` ${LTR_CONTENT_IN_RTL_CLASS}`;
282
+ }
283
+
284
+ let computedMarginClassWhenLeftIconExists = '';
285
+ if (cell.iconName) {
286
+ const { iconPosition } = cell;
287
+ if (!iconPosition || iconPosition === 'left') {
288
+ computedMarginClassWhenLeftIconExists = CELL_MARGIN_LEFT_CLASS;
289
+ }
290
+ }
291
+
292
+ let computedWrapperClass = GRID_CLASS;
293
+ if (
294
+ alignment === 'right' ||
295
+ // Numbers are aligned right.
296
+ columnType === 'currency' ||
297
+ columnType === 'number' ||
298
+ columnType === 'percent'
299
+ ) {
300
+ computedWrapperClass += ` ${GRID_ALIGN_END_CLASS}`;
301
+ } else if (
302
+ !alignment ||
303
+ alignment === 'left' ||
304
+ (alignment !== 'center' && alignment !== 'right')
305
+ ) {
306
+ computedWrapperClass += ` ${GRID_ALIGN_SPREAD_CLASS}`;
307
+ }
308
+ if (hasTreeData) {
309
+ computedWrapperClass += ` ${NO_SPACE_CLASS}`;
310
+ }
311
+
312
+ cell.class = cellClass;
313
+ cell.computedCellDivClass = computedCellDivClass;
314
+ cell.computedCellDivStyle = computedCellDivStyle;
315
+ cell.computedMarginClassWhenLeftIconExists =
316
+ computedMarginClassWhenLeftIconExists;
317
+ cell.computedWrapperClass = computedWrapperClass;
318
+ }
319
+
320
+ /**
321
+ * Updates the value-related attributes for an inlined datatable cell
322
+ *
323
+ * @param {Object} cell - The datatable cell
324
+ * @param {String} value - Current cell value
325
+ */
326
+ export function updateInlineCellValue(cell, value) {
327
+ if (cell.isBoolean) {
328
+ cell.isChecked = !!value;
329
+ cell.booleanCellAssistiveText = value ? i18n.true : i18n.false;
330
+ } else if (cell.isCurrency) {
331
+ cell.currencyValue = toFormattedNumber(
332
+ {
333
+ value,
334
+ formatStyle: 'currency',
335
+ currencyCode: cell.typeAttribute0,
336
+ currencyDisplayAs: cell.typeAttribute1,
337
+ minimumIntegerDigits: cell.typeAttribute2,
338
+ minimumFractionDigits: cell.typeAttribute3,
339
+ maximumFractionDigits: cell.typeAttribute4,
340
+ minimumSignificantDigits: cell.typeAttribute5,
341
+ maximumSignificantDigits: cell.typeAttribute6,
342
+ },
343
+ numberFormat
344
+ );
345
+ } else if (cell.isDateLocal) {
346
+ cell.dateLocalValue = toFormattedDate(
347
+ {
348
+ value,
349
+ day: cell.typeAttribute0 || 'numeric',
350
+ month: cell.typeAttribute1 || 'short',
351
+ year: cell.typeAttribute2 || 'numeric',
352
+ timeZone: 'UTC',
353
+ },
354
+ dateTimeFormat
355
+ );
356
+ } else if (cell.isDateTime) {
357
+ cell.dateTimeValue = toFormattedDate(
358
+ {
359
+ // Supported values can be passed directly to lightning-formatted-date-time but
360
+ // non-supported formats need to be passed through Date constructor to avoid
361
+ // customer breakages for the time being. Ideally the use of toDate here will be
362
+ // temporary and we can remove use of the Date constructor in the future
363
+ value: toDate(value),
364
+ day: cell.typeAttribute0,
365
+ era: cell.typeAttribute1,
366
+ hour: cell.typeAttribute2,
367
+ hour12: cell.typeAttribute3,
368
+ minute: cell.typeAttribute4,
369
+ month: cell.typeAttribute5,
370
+ second: cell.typeAttribute6,
371
+ timeZone: cell.typeAttribute7,
372
+ timeZoneName: cell.typeAttribute8,
373
+ weekday: cell.typeAttribute9,
374
+ year: cell.typeAttribute10,
375
+ },
376
+ dateTimeFormat
377
+ );
378
+ } else if (cell.isEmail) {
379
+ let emailIconAssistiveText = '';
380
+ const emailLabel = value ? value.trim() : '';
381
+ const showEmailLink = !!emailLabel;
382
+ if (showEmailLink) {
383
+ emailIconAssistiveText = i18n.emailLabel;
384
+ }
385
+ cell.emailIconAssistiveText = emailIconAssistiveText;
386
+ cell.emailLabel = emailLabel;
387
+ cell.showEmailLink = showEmailLink;
388
+ } else if (cell.isLocation) {
389
+ cell.locationValue = toFormattedLocation(value);
390
+ } else if (cell.isNumber) {
391
+ cell.numberValue = toFormattedNumber(
392
+ {
393
+ value,
394
+ minimumIntegerDigits: cell.typeAttribute0,
395
+ minimumFractionDigits: cell.typeAttribute1,
396
+ maximumFractionDigits: cell.typeAttribute2,
397
+ minimumSignificantDigits: cell.typeAttribute3,
398
+ maximumSignificantDigits: cell.typeAttribute4,
399
+ },
400
+ numberFormat
401
+ );
402
+ } else if (cell.isPercent) {
403
+ cell.percentValue = toFormattedNumber(
404
+ {
405
+ value,
406
+ formatStyle: 'percent',
407
+ minimumIntegerDigits: cell.typeAttribute0,
408
+ minimumFractionDigits: cell.typeAttribute1,
409
+ maximumFractionDigits: cell.typeAttribute2,
410
+ minimumSignificantDigits: cell.typeAttribute3,
411
+ maximumSignificantDigits: cell.typeAttribute4,
412
+ },
413
+ numberFormat
414
+ );
415
+ } else if (cell.isPhone) {
416
+ let phoneLabel = '';
417
+ let phoneLink = '';
418
+ const showPhoneLink = isValidPhone(value);
419
+ if (showPhoneLink) {
420
+ phoneLabel = toNorthAmericanPhoneNumber(value);
421
+ phoneLink = `tel:${value}`;
422
+ }
423
+ cell.phoneLabel = phoneLabel;
424
+ cell.phoneLink = phoneLink;
425
+ cell.showPhoneLink = showPhoneLink;
426
+ } else if (cell.isText) {
427
+ const { typeAttribute0: linkify } = cell;
428
+ const shouldFormatText = linkify
429
+ ? typeof value === 'string' && value !== ''
430
+ : false;
431
+ cell.ignoreRTL = cell.isRTL && isTextIgnoreRTL(value);
432
+ cell.shouldFormatText = shouldFormatText;
433
+ cell.textParts = shouldFormatText
434
+ ? parseToFormattedLinkifiedParts(value, true)
435
+ : [];
436
+ // W-7860598 some team rely on text column support for primitive type.
437
+ // W-7752316 customer use compound field for text column, to avoid [object Object]
438
+ // Check if value is object or null and return '';
439
+ cell.textValue = typeof value === 'object' ? '' : value;
440
+ } else if (cell.isURL) {
441
+ let _handleUrlAnchorClick;
442
+ let handleUrlAnchorClick;
443
+ let urlLabel = '';
444
+ let urlLink = '';
445
+ let urlTarget = '';
446
+ let urlTooltip = '';
447
+ const showUrlLink =
448
+ value !== null && value !== undefined && value !== '';
449
+ if (showUrlLink) {
450
+ let { typeAttribute0, typeAttribute2 } = cell;
451
+ _handleUrlAnchorClick = noopHandler;
452
+ handleUrlAnchorClick = (event) => {
453
+ cell._handleUrlAnchorClick(event);
454
+ };
455
+ urlLink = makeAbsoluteUrl(value);
456
+ urlLabel =
457
+ typeAttribute0 !== null &&
458
+ typeAttribute0 !== undefined &&
459
+ typeAttribute0 !== ''
460
+ ? typeAttribute0
461
+ : urlLink;
462
+ urlTarget = cell.typeAttribute1 || '_self';
463
+ urlTooltip = typeAttribute2 === '' ? '' : typeAttribute2 || value;
464
+ }
465
+ cell._handleUrlAnchorClick = _handleUrlAnchorClick;
466
+ cell.handleUrlAnchorClick = handleUrlAnchorClick;
467
+ cell.showUrlLink = showUrlLink;
468
+ cell.urlLabel = urlLabel;
469
+ cell.urlLink = urlLink;
470
+ cell.urlTarget = urlTarget;
471
+ cell.urlTooltip = urlTooltip;
472
+ }
473
+ }
@@ -91,11 +91,15 @@ export function updateSorting(state) {
91
91
  col.sorted = true;
92
92
  col.sortAriaLabel =
93
93
  sortedDirection === 'desc' ? 'descending' : 'ascending';
94
- col.sortedDirection = sortedDirection;
94
+ col.sortedDirection = isSortedByArray
95
+ ? sortedDirection[sortedBy.indexOf(col.name)]
96
+ : sortedDirection;
95
97
 
96
- // If sortedBy is an array, set col.sorted to the index in the array
97
- // Otherwise, set it to true
98
- col.sorted = isSortedByArray ? sortedBy.indexOf(col.name) : true;
98
+ // If sortedBy is an array, set col.sorted to the index in the array + 1 because
99
+ // 0 index is considered falsely in javascript Otherwise, set it to true
100
+ col.sorted = isSortedByArray
101
+ ? sortedBy.indexOf(col.name) + 1
102
+ : true;
99
103
  } else {
100
104
  col.sorted = false;
101
105
  col.sortAriaLabel = col.sortable ? 'other' : null;
@@ -6,29 +6,36 @@
6
6
  *
7
7
  * @returns {Object} Intial state of the datatable
8
8
  */
9
- export const getDefaultState = function () {
9
+ export function getDefaultState() {
10
10
  return {
11
11
  // columns
12
12
  columns: [],
13
13
  hadTreeDataTypePreviously: false,
14
14
  hideCheckboxColumn: false,
15
+ showActionsMenu: false,
15
16
  treeColumn: undefined,
16
17
 
17
18
  // rows
18
19
  data: [],
20
+ hasCalledUpdateRowsAndCells: false,
19
21
  keyField: undefined,
20
22
  rows: [],
21
- indexes: {},
23
+ checkboxCells: [],
24
+ lookupCells: [],
25
+ shownUrlCells: [],
22
26
 
23
27
  // row selection
24
28
  selectedRowsKeys: {},
25
29
  lastSelectedRowKey: undefined,
26
30
  maxRowSelection: undefined,
27
31
 
28
- headerIndexes: {},
29
32
  hideTableHeader: false,
30
33
  wrapTableHeader: false,
31
34
 
35
+ // indexes:
36
+ headerIndexes: [],
37
+ indexes: {}, // cannot use a Map because they aren't trackable
38
+
32
39
  // keyboard
33
40
  keyboardMode: 'NAVIGATION',
34
41
  rowMode: false,
@@ -57,6 +64,7 @@ export const getDefaultState = function () {
57
64
  isLoading: false,
58
65
 
59
66
  // table render mode
67
+ renderModeInline: false,
60
68
  renderModeRoleBased: false,
61
69
 
62
70
  // viewport rendering and virtualization
@@ -96,4 +104,4 @@ export const getDefaultState = function () {
96
104
  // table rendered flag
97
105
  hasRenderedFirstTime: false,
98
106
  };
99
- };
107
+ }