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
@@ -1,15 +1,12 @@
1
1
  import { api } from 'lwc';
2
2
  import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
3
- import { getRealDOMId, synchronizeAttrs } from 'lightning/utilsPrivate';
4
- import { secure } from 'lightning/overlayUtils';
5
- import closeButtonAltText from '@salesforce/label/LightningModalBase.cancelandclose';
3
+ import { getRealDOMId } from 'lightning/utilsPrivate';
6
4
 
7
5
  // selectors
8
6
  const modalHeaderSelector = '.slds-modal__header';
9
7
  const labelSelector = '[data-label]';
10
8
  const slotWrapperSelector = '[data-slot-wrapper]';
11
9
  const defaultSlotSelector = '[data-default-slot]';
12
- const headerCloseButtonSelector = '[data-header-close-button]';
13
10
 
14
11
  /**
15
12
  * Creates a header to display the heading and tagline at the top of a modal.
@@ -19,13 +16,25 @@ export default class LightningModalHeader extends LightningShadowBaseClass {
19
16
  initialRender = true;
20
17
  initialSlotRender = true;
21
18
  unregisterCallback = null;
22
- headerCloseButtonAltText = closeButtonAltText;
23
19
 
24
20
  /**
25
21
  * Text to display as the heading at the top of the modal
26
22
  */
27
23
  @api label = '';
28
24
 
25
+ /**
26
+ * Handle the default slot change event
27
+ * Always register with parent every slot change
28
+ * @private
29
+ */
30
+ handleDefaultSlotChange() {
31
+ // Set this once so that parent can know slot has rendered
32
+ if (this.initialSlotRender) {
33
+ this.initialSlotRender = false;
34
+ }
35
+ this.registerWithParent();
36
+ }
37
+
29
38
  /**
30
39
  * Get the height of outer wrapper of modal header
31
40
  * @returns {number} represents a height value in pixels
@@ -116,62 +125,6 @@ export default class LightningModalHeader extends LightningShadowBaseClass {
116
125
  return (this.label && this.label.trim().length > 0) || false;
117
126
  }
118
127
 
119
- /**
120
- * Get the lightning-button-icon (close button element)
121
- * @returns {(HTMLElement|null)}
122
- * @private
123
- */
124
- get headerCloseButton() {
125
- return this.template.querySelector(headerCloseButtonSelector);
126
- }
127
-
128
- /**
129
- * Handle the default slot change event
130
- * Always register with parent every slot change
131
- * @private
132
- */
133
- handleDefaultSlotChange() {
134
- // Set this once so that parent can know slot has rendered
135
- if (this.initialSlotRender) {
136
- this.initialSlotRender = false;
137
- }
138
- this.registerWithParent();
139
- }
140
-
141
- /**
142
- * Toggle set disabled on the <lightning-button-icon> present inside lightning-modal-header
143
- * @param e
144
- */
145
- handlePrivateModalHeaderDisableClose(e) {
146
- if (!e?.detail?.[secure]) {
147
- console.error(
148
- 'Invalid access to privatemodalheaderdisableclose event'
149
- );
150
- return;
151
- }
152
- e.stopPropagation();
153
-
154
- const closeButtonDisable = e.detail?.disableClose ? 'disabled' : null;
155
-
156
- synchronizeAttrs(this.headerCloseButton, {
157
- disabled: closeButtonDisable,
158
- });
159
- }
160
-
161
- /**
162
- * Handle close click on close <lightning-button-icon>
163
- */
164
- handleModalHeaderClose() {
165
- const closeEvt = new CustomEvent('privatemodalheaderclose', {
166
- bubbles: true,
167
- composed: true,
168
- detail: {
169
- [secure]: true,
170
- },
171
- });
172
- this.dispatchEvent(closeEvt);
173
- }
174
-
175
128
  /**
176
129
  * Register modalHeader with modal parent, including callbacks to
177
130
  * unregister the modal header
@@ -0,0 +1,14 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import 'lightning/sldsUtilsHyphenation';
3
+
4
+ [part="columnadder"] {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ align-items: center;
8
+ padding: 0.5rem;
9
+ }
10
+
11
+
12
+ [part="modal-body"] {
13
+ height: 19rem;
14
+ }
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <lightning-modal-header label={i18n.modalTitle}>
3
+ </lightning-modal-header>
4
+ <lightning-modal-body class="modal_headerless">
5
+ <div part="modal-body">
6
+ <template iterator:it={rulesWithData}>
7
+ <lightning-primitive-column-sorter
8
+ key={it.value.key}
9
+ index={it.index}
10
+ rule={it.value}
11
+ columns={processedColumns}
12
+ first-rule={it.first}
13
+ last-rule={it.last}
14
+ ondelete={handleDeleteRule}
15
+ onselection={handleSelectionChange}
16
+ onmoveup={handleRuleMovement}
17
+ onmovedown={handleRuleMovement}>
18
+ </lightning-primitive-column-sorter>
19
+ </template>
20
+ <div part="columnadder">
21
+ <lightning-button
22
+ variant="base"
23
+ label={i18n.addRule}
24
+ icon-name="utility:add"
25
+ onclick={handleAddRule}
26
+ disabled={isAddRuleButtonDisabled}
27
+ class="slds-m-left_x-small">
28
+ </lightning-button>
29
+ <div style={ruleLimitTextStyle}>{ruleLimitText}</div>
30
+ </div>
31
+ </div>
32
+ </lightning-modal-body>
33
+ <lightning-modal-footer class="slds-modal__footer_directional">
34
+ <lightning-button
35
+ class="slds-button"
36
+ variant="neutral"
37
+ label={i18n.clearButton}
38
+ onclick={clearRules}
39
+ disabled={isClearButtonDisabled}
40
+ ></lightning-button>
41
+ <lightning-button
42
+ class="slds-button"
43
+ variant="neutral"
44
+ label={i18n.cancelButton}
45
+ onclick={cancelRules}
46
+ ></lightning-button>
47
+ <lightning-button
48
+ class="slds-button"
49
+ variant="brand"
50
+ label={i18n.applyButton}
51
+ onclick={applyRules}
52
+ disabled={isApplyButtonDisabled}
53
+ ></lightning-button>
54
+ </lightning-modal-footer>
55
+ </template>
@@ -0,0 +1,430 @@
1
+ import LightningModal from 'lightning/modal';
2
+ import Toast from 'lightning/toast';
3
+ import { track, api } from 'lwc';
4
+ import modalTitle from '@salesforce/label/LightningMultiColumnSortingModal.modalTitle';
5
+ import firstRuleHeading from '@salesforce/label/LightningMultiColumnSortingModal.firstRuleHeading';
6
+ import otherRuleHeading from '@salesforce/label/LightningMultiColumnSortingModal.otherRuleHeading';
7
+ import addRule from '@salesforce/label/LightningMultiColumnSortingModal.addRule';
8
+ import ruleLimit from '@salesforce/label/LightningMultiColumnSortingModal.ruleLimit';
9
+ import ruleLimitReached from '@salesforce/label/LightningMultiColumnSortingModal.ruleLimitReached';
10
+ import clearButton from '@salesforce/label/LightningMultiColumnSortingModal.clearButton';
11
+ import cancelButton from '@salesforce/label/LightningMultiColumnSortingModal.cancelButton';
12
+ import applyButton from '@salesforce/label/LightningMultiColumnSortingModal.applyButton';
13
+ import duplicateValueValidation from '@salesforce/label/LightningMultiColumnSortingModal.duplicateValueValidation';
14
+ import multiColumnSortingToast from '@salesforce/label/LightningDatatable.multiColumnSortingToast';
15
+ import ascending from '@salesforce/label/LightningPrimitiveColumnSorter.ascending';
16
+ import descending from '@salesforce/label/LightningPrimitiveColumnSorter.descending';
17
+ import { generateUniqueId } from 'lightning/inputUtils';
18
+ import { formatLabel } from 'lightning/utils';
19
+ const i18n = {
20
+ modalTitle,
21
+ firstRuleHeading,
22
+ otherRuleHeading,
23
+ addRule,
24
+ ruleLimit,
25
+ ruleLimitReached,
26
+ clearButton,
27
+ cancelButton,
28
+ applyButton,
29
+ duplicateValueValidation,
30
+ multiColumnSortingToast,
31
+ ascending,
32
+ descending,
33
+ };
34
+
35
+ // represents a rule that has not been configured with sorting settings
36
+ const getEmptyRule = () => ({
37
+ selectedColumn: undefined,
38
+ sortOrder: 'asc', // default sort order is set to 'ascending'
39
+ });
40
+
41
+ // base state: two rules that are not configured with sorting settings
42
+ const initialRules = [getEmptyRule(), getEmptyRule()];
43
+
44
+ export default class MultiColumnSortingModal extends LightningModal {
45
+ // lightning-datatable instance
46
+ @api dtInstance;
47
+ size = 'small';
48
+ @track rules = initialRules;
49
+
50
+ // variable track if validation errors are present
51
+ validInputs = true;
52
+ _modalBody;
53
+ _scrollToBottom = false;
54
+
55
+ get i18n() {
56
+ return i18n;
57
+ }
58
+
59
+ /**
60
+ * On initial load, the modal will create rules based on the passed in attributes:
61
+ * 'sortedBy' and 'sortedDirection'
62
+ */
63
+ connectedCallback() {
64
+ const { sortedBy, sortedDirection } = this.dtInstance;
65
+ this.clearRules(); // reset rules
66
+ if (Array.isArray(sortedBy) || Array.isArray(sortedDirection)) {
67
+ if (
68
+ sortedBy &&
69
+ sortedDirection &&
70
+ sortedBy.length === sortedDirection.length
71
+ ) {
72
+ let length = Math.min(sortedBy.length, 5); // 5 rules is the max limit
73
+ // Create rules based on sortedBy and sortedDirection
74
+ for (let i = 0; i < length; i += 1) {
75
+ this.rules[i] = {
76
+ selectedColumn: sortedBy[i],
77
+ sortOrder: sortedDirection[i],
78
+ };
79
+ }
80
+ // set `isDupe` property on this.rules so renderedCallback can report validity
81
+ this.setDuplicates(this.rules);
82
+ }
83
+ }
84
+ }
85
+
86
+ renderedCallback() {
87
+ const { comboboxInputs, rules } = this;
88
+ const duplicateEntryExists = rules.some((rule) => rule.isDupe);
89
+
90
+ const lastRuleSelected =
91
+ rules.length >= 2 &&
92
+ rules[rules.length - 1].selectedColumn !== undefined;
93
+
94
+ // report validity if user has clicked on apply button, if there is a duplicate entry, or if the
95
+ // last rule was selected
96
+ if (
97
+ this.validationThroughApplyButton ||
98
+ duplicateEntryExists ||
99
+ lastRuleSelected
100
+ ) {
101
+ if (duplicateEntryExists) {
102
+ comboboxInputs.forEach((combobox, index) => {
103
+ combobox.setCustomValidity(
104
+ rules[index].isDupe
105
+ ? this.i18n.duplicateValueValidation
106
+ : ''
107
+ );
108
+ });
109
+ }
110
+ this.reportValidity(comboboxInputs);
111
+ this.validationThroughApplyButton = false;
112
+ }
113
+
114
+ // scroll to appropriate element
115
+ this.handleScrolling();
116
+ }
117
+
118
+ // getter to get all `lightning-primitive-column-sorter` elements
119
+ get columnSorters() {
120
+ return Array.from(
121
+ this.template.querySelectorAll('lightning-primitive-column-sorter')
122
+ );
123
+ }
124
+
125
+ // getter to get all `lightning-combobox` elements from all the `lightning-primitive-column-sorter` elements
126
+ get comboboxInputs() {
127
+ return this.columnSorters.map((sorter) => sorter.combobox);
128
+ }
129
+
130
+ // getter to get the `lightning-modal-body's` `[part='modal-body']`
131
+ get modalBody() {
132
+ if (!this._modalBody) {
133
+ this._modalBody = this.template.querySelector(
134
+ 'lightning-modal-body'
135
+ ).shadowRoot.firstChild;
136
+ }
137
+ return this._modalBody;
138
+ }
139
+
140
+ get rulesWithData() {
141
+ const { rules } = this;
142
+ return rules.map((rule, index) => ({
143
+ key: generateUniqueId('sorter'),
144
+ ...rule, // sortOrder and selectedColumn
145
+ heading:
146
+ index === 0 ? i18n.firstRuleHeading : i18n.otherRuleHeading,
147
+ unselectedInitialRules:
148
+ rules.length <= 2 &&
149
+ (rules[0].selectedColumn === undefined ||
150
+ rules[1].selectedColumn === undefined), // used to disable up/down movement when only 1 out of 2 rules are configured
151
+ disabledTrash: rules.length < 3, // user should not be able to delete rules if there are only 2
152
+ // if first two rules are not selected, the second rule should have disabled input
153
+ disableInputs:
154
+ index === 1 &&
155
+ rules[index - 1].selectedColumn === undefined &&
156
+ rules[index].selectedColumn === undefined,
157
+ }));
158
+ }
159
+
160
+ /**
161
+ * an additional 'value' property needs to be added for `lightning-combobox` in the
162
+ * `primitive-column-sorter` to function properly
163
+ */
164
+ get processedColumns() {
165
+ const filteredColumns = this.dtInstance.columns.filter(
166
+ (column) => column.label && column.sortable
167
+ );
168
+ const processedColumns = filteredColumns.map((column) => {
169
+ return {
170
+ ...column,
171
+ value: column.fieldName, // Set the 'value' property to the same value as 'fieldName'
172
+ };
173
+ });
174
+ return processedColumns;
175
+ }
176
+
177
+ /**
178
+ * Text to indicate if the sorting rule limit has been reached.
179
+ */
180
+ get ruleLimitText() {
181
+ if (this.rules.length >= 5) {
182
+ return i18n.ruleLimitReached;
183
+ }
184
+ return i18n.ruleLimit;
185
+ }
186
+
187
+ /**
188
+ * inline style for the rule limit text;
189
+ */
190
+ get ruleLimitTextStyle() {
191
+ return this.ruleLimitText === i18n.ruleLimitReached
192
+ ? 'color:#8C4B02;'
193
+ : '';
194
+ }
195
+
196
+ /**
197
+ * Disable the add new rule button
198
+ */
199
+ get isAddRuleButtonDisabled() {
200
+ const unselectedRuleExists = this.rules.some(
201
+ (rule) => rule.selectedColumn === undefined
202
+ );
203
+ return (
204
+ unselectedRuleExists || this.rules.length >= 5 || !this.validInputs
205
+ );
206
+ }
207
+
208
+ /**
209
+ * Disable the apply button
210
+ */
211
+ get isApplyButtonDisabled() {
212
+ const rulesWithSelectedColumns = this.rules.filter(
213
+ (rule) => rule.selectedColumn !== undefined
214
+ );
215
+ return rulesWithSelectedColumns.length < 2 || !this.validInputs;
216
+ }
217
+
218
+ /**
219
+ * Disable the clear button
220
+ */
221
+ get isClearButtonDisabled() {
222
+ return (
223
+ this.rules[0].selectedColumn === undefined ||
224
+ this.rules[1].selectedColumn === undefined
225
+ );
226
+ }
227
+
228
+ /**
229
+ * Handles adding a new rule from the 'add rule' button
230
+ */
231
+ handleAddRule() {
232
+ this._scrollToBottom = true; // scroll to new rule
233
+ this.rules.push(getEmptyRule());
234
+ }
235
+
236
+ /**
237
+ * Handles the 'delete' event which is dispatched from `primitive-column-sorter` elements
238
+ */
239
+ handleDeleteRule(event) {
240
+ const ruleIndexToDelete = event.target.index;
241
+ this.rules.splice(ruleIndexToDelete, 1);
242
+ // Update 'isDupe' property
243
+ this.setDuplicates(this.rules);
244
+ }
245
+
246
+ /**
247
+ * Handles the 'selection' event which is dispatched from `primitive-column-sorter` elements
248
+ */
249
+ handleSelectionChange(event) {
250
+ const { index, selectedColumn, sortOrder } = event.detail;
251
+ // Get the existing rule object at the specified index
252
+ const existingRule = this.rules[index];
253
+ if (existingRule) {
254
+ const newColumnSelection =
255
+ existingRule.selectedColumn !== selectedColumn;
256
+ // Update the existing rule object with the new selectedColumn and sortOrder
257
+ existingRule.selectedColumn = selectedColumn;
258
+ existingRule.sortOrder = sortOrder;
259
+ if (newColumnSelection) {
260
+ // Update 'isDupe' property
261
+ this.setDuplicates(this.rules, index);
262
+ }
263
+ }
264
+ }
265
+
266
+ /**
267
+ * Handles the 'moveup' or 'movedown' event which is dispatched from `primitive-column-sorter` elements
268
+ */
269
+ handleRuleMovement(event) {
270
+ const { rules } = this;
271
+ const dir = event.type;
272
+ const ruleIndexToMove = event.target.index;
273
+ const ruleIndexToSwitch =
274
+ dir === 'moveup' ? ruleIndexToMove - 1 : ruleIndexToMove + 1;
275
+
276
+ // Switch rules
277
+ const tempRule = rules[ruleIndexToMove];
278
+ rules[ruleIndexToMove] = rules[ruleIndexToSwitch];
279
+ rules[ruleIndexToSwitch] = tempRule;
280
+ }
281
+
282
+ /**
283
+ * Dispatches the 'privateupdatecolsort' custom event to send selected data to parent component
284
+ * Also extracts sorting orders and columns from rules and cleaning anything 'undefined'
285
+ */
286
+ applyRules() {
287
+ const fieldNames = this.rules.map((rule) => rule.selectedColumn);
288
+ const sortDirections = this.rules.map((rule) => rule.sortOrder);
289
+
290
+ // validation to ensure that there are no invalid inputs
291
+ this.reportValidity(this.comboboxInputs);
292
+ this.validationThroughApplyButton = true;
293
+
294
+ // only dispatch event with data if all inputs are valid
295
+ if (this.validInputs) {
296
+ // Dispatch event from datatable
297
+ const event = new CustomEvent('sort', {
298
+ detail: {
299
+ fieldNames,
300
+ sortDirections,
301
+ isMultiColumnSort: true,
302
+ },
303
+ });
304
+ this.dtInstance.dispatchEvent(event);
305
+ // Construct toast
306
+ const toastMessage = this.getToastMessage(
307
+ fieldNames,
308
+ sortDirections
309
+ );
310
+ this.close({
311
+ event,
312
+ success: this.sendToast(toastMessage, 'success'),
313
+ failure: this.sendToast(toastMessage, 'failure'),
314
+ });
315
+ }
316
+ }
317
+
318
+ getToastMessage(fieldNames, sortDirections) {
319
+ // Method used to format the Toast notification's message
320
+ const capitalizeFirstLetter = (str) =>
321
+ str.charAt(0).toUpperCase() + str.slice(1);
322
+
323
+ // constructing and formatting the toast message
324
+ const message = fieldNames
325
+ .map(
326
+ (sortBy, index) =>
327
+ `${capitalizeFirstLetter(sortBy)} (${
328
+ sortDirections[index] === 'asc'
329
+ ? i18n.ascending
330
+ : i18n.descending
331
+ })`
332
+ )
333
+ .join(', ');
334
+ return formatLabel(i18n.multiColumnSortingToast, message);
335
+ }
336
+
337
+ sendToast(toastMessage, variant) {
338
+ return () => {
339
+ Toast.show(
340
+ {
341
+ label: toastMessage,
342
+ mode: 'dismissible',
343
+ variant,
344
+ },
345
+ this.dtInstance
346
+ );
347
+ };
348
+ }
349
+
350
+ /**
351
+ * Handles clearing all sorting rules from the modal from the 'clear' button
352
+ */
353
+ clearRules() {
354
+ this.rules = [getEmptyRule(), getEmptyRule()];
355
+ }
356
+
357
+ /**
358
+ * Handles closing the modal when the 'cancel' button is clicked
359
+ */
360
+ cancelRules() {
361
+ this.close();
362
+ }
363
+
364
+ /**
365
+ * method to handle the scrolling to a newly added `lightning-primitive-column-sorter` or the
366
+ * first one with a validation error present
367
+ */
368
+ handleScrolling() {
369
+ // scroll to the bottom for when new `lightning-primitive-column-sorters` are added
370
+ const { comboboxInputs } = this;
371
+ let modalBody;
372
+ if (this._scrollToBottom) {
373
+ modalBody = this.modalBody;
374
+ modalBody.scrollTop = modalBody.scrollHeight;
375
+ this._scrollToBottom = false;
376
+ }
377
+
378
+ // if there are errors present, auto-scroll to the first error
379
+ for (let i = 0; i < comboboxInputs.length; i += 1) {
380
+ const combobox = comboboxInputs[i];
381
+ if (combobox.classList.contains('slds-has-error')) {
382
+ const sorter = this.columnSorters[i];
383
+ modalBody = modalBody || this.modalBody;
384
+ modalBody.scrollTop = sorter.offsetTop - modalBody.offsetTop;
385
+ break;
386
+ }
387
+ }
388
+ }
389
+
390
+ /**
391
+ * Helper function to check if there are duplicate `selectedColumn` properties for
392
+ * each of the entries in this.rules array. if there is, then that rule gets its `isDupe`
393
+ * property set to `true`.
394
+ * @param {Array} rules
395
+ * @param {Number} ruleIndexToSetLast - rule index to set 'isDupe' for last. Used in handleSelectionChange.
396
+ */
397
+ setDuplicates(rules, ruleIndexToSetLast) {
398
+ const selectedColumns = new Set();
399
+ for (let i = 0; i < rules.length; i += 1) {
400
+ if (ruleIndexToSetLast !== i) {
401
+ const { selectedColumn } = rules[i];
402
+ rules[i].isDupe =
403
+ selectedColumn && selectedColumns.has(selectedColumn);
404
+ selectedColumns.add(selectedColumn);
405
+ }
406
+ }
407
+ if (ruleIndexToSetLast !== undefined) {
408
+ const { selectedColumn } = rules[ruleIndexToSetLast];
409
+ rules[ruleIndexToSetLast].isDupe =
410
+ selectedColumn && selectedColumns.has(selectedColumn);
411
+ selectedColumns.add(selectedColumn);
412
+ }
413
+ return selectedColumns;
414
+ }
415
+
416
+ /**
417
+ * This function will go through the list of `lightning-combobox`s and will reportValidity()
418
+ * on each to show the errors.
419
+ * Sets the `validInputs` property to track if all entries are valid or not
420
+ * @param {Array} comboboxInputs
421
+ */
422
+ reportValidity(comboboxInputs) {
423
+ comboboxInputs.forEach(
424
+ (combobox) => combobox && combobox.reportValidity()
425
+ );
426
+ this.validInputs = comboboxInputs.every(
427
+ (combobox) => combobox && combobox.validity.valid
428
+ );
429
+ }
430
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
3
+ <isExposed>true</isExposed>
4
+ </LightningComponentBundle>
@@ -433,3 +433,19 @@ function initAuraOverlayState() {
433
433
  state.auraOverlayActive = false;
434
434
  state.auraOverlayPresent = false;
435
435
  }
436
+
437
+ /**
438
+ * Helper function to detect if a lightning-modal is currently open
439
+ * Used in modalBase.js to trap a user's focus while lightning-modal is open
440
+ * @returns {boolean}
441
+ */
442
+ export function isLwcModalActive() {
443
+ let isLwcModal = false;
444
+ if (state.stack?.length > 0) {
445
+ const top = state.stack[state.stack.length - 1];
446
+ isLwcModal =
447
+ top?.overlayEngine === LWC_OVERLAY_ENGINE &&
448
+ top?.overlayType === TYPE_MODAL;
449
+ }
450
+ return isLwcModal;
451
+ }
@@ -144,20 +144,26 @@ export default class LightningPill extends LightningShadowBaseClass {
144
144
  );
145
145
  }
146
146
  renderedCallback() {
147
- // check if a component was passed into the slot
148
- this._hasMedia = this.checkMediaElement();
149
- const wrapper = this.template.querySelector('span');
150
-
151
- classListMutation(wrapper.classList, {
152
- 'slds-pill': true,
153
- 'slds-pill_link': this.isPlainLink || this.isLink,
154
- 'slds-has-error': this.hasError,
147
+ // Avoid a timing issue due to LWC v6's native custom element lifecycle:
148
+ // https://github.com/salesforce/lwc/releases/v6.0.0#new-timing
149
+ // This check for slotted content needs to occur after the connectedCallbacks for the slotted
150
+ // components have already executed.
151
+ Promise.resolve().then(() => {
152
+ // check if a component was passed into the slot
153
+ this._hasMedia = this.checkMediaElement();
154
+ const wrapper = this.template.querySelector('span');
155
+
156
+ classListMutation(wrapper.classList, {
157
+ 'slds-pill': true,
158
+ 'slds-pill_link': this.isPlainLink || this.isLink,
159
+ 'slds-has-error': this.hasError,
160
+ });
161
+
162
+ // set attributes to self if variant is plain or link
163
+ modifyAttribute(this, 'tabindex', this.tabIndex);
164
+ modifyAttribute(this, 'role', this.role);
165
+ modifyAttribute(this, 'aria-selected', this.ariaSelected);
155
166
  });
156
-
157
- // set attributes to self if variant is plain or link
158
- modifyAttribute(this, 'tabindex', this.tabIndex);
159
- modifyAttribute(this, 'role', this.role);
160
- modifyAttribute(this, 'aria-selected', this.ariaSelected);
161
167
  }
162
168
 
163
169
  /**