lightning-base-components 1.21.2-alpha → 1.21.4-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 (357) hide show
  1. package/metadata/raptor.json +77 -1
  2. package/package.json +108 -15
  3. package/scopedImports/@salesforce-label-LightningDatatable.showActions.js +1 -1
  4. package/scopedImports/@salesforce-label-LightningForm.controllerFieldsMessage.js +1 -0
  5. package/scopedImports/@salesforce-label-LightningForm.dependentFieldsHeader.js +1 -0
  6. package/scopedImports/@salesforce-label-LightningForm.dependentFieldsListHeading.js +1 -0
  7. package/scopedImports/@salesforce-label-LightningForm.generalDependentFieldsMessage.js +1 -0
  8. package/scopedImports/@salesforce-label-LightningForm.learnMore.js +1 -0
  9. package/scopedImports/@salesforce-label-LightningForm.okButton.js +1 -0
  10. package/scopedImports/@salesforce-label-LightningLookup.modalCancel.js +1 -0
  11. package/scopedImports/@salesforce-label-LightningLookup.modalSelect.js +1 -0
  12. package/scopedImports/@salesforce-label-LightningProgressIndicator.currentStage.js +1 -1
  13. package/scopedImports/@salesforce-label-LightningProgressIndicator.errorStage.js +1 -0
  14. package/scopedImports/@salesforce-label-LightningProgressIndicator.stageComplete.js +1 -1
  15. package/scopedImports/@salesforce-label-LightningProgressIndicator.stageNotStarted.js +1 -1
  16. package/scopedImports/@salesforce-label-LightningRichTextEditor.colorPicker.js +1 -0
  17. package/src/lightning/accordion/accordion-section.slds.css +3 -3
  18. package/src/lightning/accordion/accordion.slds.css +1 -2
  19. package/src/lightning/accordionSection/accordion-section.slds.css +3 -3
  20. package/src/lightning/accordionSection/accordionSection.js +3 -1
  21. package/src/lightning/accordionSection/button.slds.css +1 -1
  22. package/src/lightning/avatar/avatar.html +1 -0
  23. package/src/lightning/badge/badge.html +3 -3
  24. package/src/lightning/badge/badge.js +1 -0
  25. package/src/lightning/badge/badge.js-meta.xml +3 -0
  26. package/src/lightning/baseCombobox/base-combobox.slds.css +11 -6
  27. package/src/lightning/baseCombobox/baseCombobox.html +5 -2
  28. package/src/lightning/baseCombobox/baseCombobox.js +5 -18
  29. package/src/lightning/baseCombobox/baseCombobox.js-meta.xml +6 -0
  30. package/src/lightning/baseCombobox/input-text.slds.css +41 -68
  31. package/src/lightning/baseCombobox/keyboard.js +12 -4
  32. package/src/lightning/baseCombobox/listbox.slds.css +51 -99
  33. package/src/lightning/baseCombobox/spinner.slds.css +62 -62
  34. package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js-meta.xml +6 -0
  35. package/src/lightning/baseComboboxItem/baseComboboxItem.js +10 -6
  36. package/src/lightning/baseComboboxItem/baseComboboxItem.js-meta.xml +6 -0
  37. package/src/lightning/baseComboboxItem/listbox.slds.css +51 -99
  38. package/src/lightning/baseFormattedText/baseFormattedText.js +2 -2
  39. package/src/lightning/button/__docs__/button.md +2 -1
  40. package/src/lightning/button/button.js +5 -5
  41. package/src/lightning/button/button.slds.css +1 -1
  42. package/src/lightning/buttonIcon/__docs__/buttonIcon.md +1 -0
  43. package/src/lightning/buttonIcon/button-icon.slds.css +1 -1
  44. package/src/lightning/buttonIcon/buttonIcon.html +1 -1
  45. package/src/lightning/buttonIcon/buttonIcon.js +18 -17
  46. package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +4 -2
  47. package/src/lightning/buttonIconStateful/button-icon.slds.css +1 -1
  48. package/src/lightning/buttonIconStateful/button.slds.css +1 -1
  49. package/src/lightning/buttonMenu/button-icon.slds.css +1 -1
  50. package/src/lightning/buttonMenu/button-menu.slds.css +8 -2
  51. package/src/lightning/buttonMenu/button.slds.css +1 -1
  52. package/src/lightning/buttonMenu/buttonMenu.css +5 -0
  53. package/src/lightning/buttonMenu/buttonMenu.js +2 -0
  54. package/src/lightning/buttonStateful/button-stateful.slds.css +6 -2
  55. package/src/lightning/buttonStateful/button.slds.css +1 -1
  56. package/src/lightning/buttonStateful/buttonStateful.js +4 -1
  57. package/src/lightning/calendar/calendar.js-meta.xml +6 -0
  58. package/src/lightning/calendar/calendar.slds.css +9 -2
  59. package/src/lightning/colorPickerCustom/color-picker-custom.slds.css +22 -23
  60. package/src/lightning/colorPickerCustom/colorPickerCustom.js +12 -0
  61. package/src/lightning/colorPickerCustom/input-text.slds.css +41 -68
  62. package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +9 -10
  63. package/src/lightning/colorPickerPanel/colorPickerPanel.js +11 -1
  64. package/src/lightning/colorPickerPanel/popover.slds.css +0 -2
  65. package/src/lightning/combobox/combobox.html +1 -0
  66. package/src/lightning/combobox/combobox.slds.css +1 -2
  67. package/src/lightning/combobox/form-element.slds.css +54 -54
  68. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.html +11 -0
  69. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.js +25 -0
  70. package/src/lightning/datatable/__examples__disabled/customComponentWrapper/generateData.js +15 -0
  71. package/src/lightning/datatable/__examples__disabled/customDatatableWrapper/customDatatableWrapper.js +89 -0
  72. package/src/lightning/datatable/__examples__disabled/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +6 -0
  73. package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.js +1 -16
  74. package/src/lightning/datatable/__examples__disabled/customDatatypeLink/customDatatypeLink.html +9 -0
  75. package/src/lightning/datatable/__examples__disabled/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html +3 -0
  76. package/src/lightning/datatable/__examples__disabled/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +3 -0
  77. package/src/lightning/datatable/__examples__disabled/customDatatypeTable/customNumber.html +3 -0
  78. package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customNumberEdit.html +2 -0
  79. package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/deleteRow.html +3 -2
  80. package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/iconPill.html +1 -1
  81. package/src/lightning/datatable/{__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html → __examples__disabled/customNestedComponent/customNestedComponent.html} +2 -2
  82. package/src/lightning/datatable/__examples__disabled/customNestedComponent/customNestedComponent.js +12 -0
  83. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/customInput.html +4 -0
  84. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/myCustomTypeDatatable.js +17 -0
  85. package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/nestedSimpleComponentParent.html +7 -0
  86. package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.html +9 -0
  87. package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.js +6 -0
  88. package/src/lightning/datatable/autoWidthStrategy.js +145 -217
  89. package/src/lightning/datatable/columnResizer.js +80 -190
  90. package/src/lightning/datatable/columnWidthManager.js +128 -243
  91. package/src/lightning/datatable/columns.js +192 -283
  92. package/src/lightning/datatable/datagrid.slds.css +187 -0
  93. package/src/lightning/datatable/datatable.js +647 -614
  94. package/src/lightning/datatable/errors.js +19 -28
  95. package/src/lightning/datatable/fixedWidthStrategy.js +27 -49
  96. package/src/lightning/datatable/headerActions.js +10 -42
  97. package/src/lightning/datatable/indexes.js +42 -0
  98. package/src/lightning/datatable/infiniteLoading.js +27 -46
  99. package/src/lightning/datatable/inlineEdit.js +311 -322
  100. package/src/lightning/datatable/keyboard.js +490 -510
  101. package/src/lightning/datatable/renderManager.js +10 -11
  102. package/src/lightning/datatable/resizeObserver.js +10 -67
  103. package/src/lightning/datatable/rowLevelActions.js +7 -6
  104. package/src/lightning/datatable/rowNumber.js +41 -79
  105. package/src/lightning/datatable/rowSelection.js +236 -291
  106. package/src/lightning/datatable/rowSelectionShared.js +26 -33
  107. package/src/lightning/datatable/rows.js +264 -476
  108. package/src/lightning/datatable/sort.js +27 -82
  109. package/src/lightning/datatable/templates/div/div.css +2 -57
  110. package/src/lightning/datatable/templates/div/div.html +25 -10
  111. package/src/lightning/datatable/templates/div/div.lbc.native.css +3 -0
  112. package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +80 -0
  113. package/src/lightning/datatable/templates/table/table.html +16 -5
  114. package/src/lightning/datatable/tree.js +17 -35
  115. package/src/lightning/datatable/types.js +10 -31
  116. package/src/lightning/datatable/utils.js +54 -29
  117. package/src/lightning/datatable/virtualization.js +2 -5
  118. package/src/lightning/datatable/widthManagerShared.js +24 -41
  119. package/src/lightning/datatable/wrapText.js +45 -77
  120. package/src/lightning/datepicker/datepicker.js +32 -9
  121. package/src/lightning/datepicker/datepicker.js-meta.xml +6 -0
  122. package/src/lightning/datepicker/form-element.slds.css +54 -54
  123. package/src/lightning/datepicker/input-text.slds.css +41 -68
  124. package/src/lightning/datetimepicker/datetimepicker.js-meta.xml +6 -0
  125. package/src/lightning/datetimepicker/form-element.slds.css +54 -54
  126. package/src/lightning/datetimepicker/input-text.slds.css +41 -68
  127. package/src/lightning/dualListbox/dual-listbox.slds.css +7 -2
  128. package/src/lightning/dualListbox/dualListbox.js +7 -8
  129. package/src/lightning/dualListbox/form-element.slds.css +54 -54
  130. package/src/lightning/dualListbox/listbox.slds.css +51 -99
  131. package/src/lightning/dynamicIcon/dynamic-icon-strength.slds.css +1 -2
  132. package/src/lightning/dynamicIcon/dynamic-icon-trend.slds.css +1 -2
  133. package/src/lightning/formattedDateTime/formattedDateTime.js +7 -62
  134. package/src/lightning/formattedDateTime/formattedDateTime.js-meta.xml +3 -0
  135. package/src/lightning/formattedLocation/formattedLocation.html +1 -3
  136. package/src/lightning/formattedLocation/formattedLocation.js +3 -25
  137. package/src/lightning/formattedLookup/events.js +2 -4
  138. package/src/lightning/formattedName/formattedName.js +3 -2
  139. package/src/lightning/formattedName/formattedName.js-meta.xml +3 -0
  140. package/src/lightning/formattedNumber/formattedNumber.js +5 -51
  141. package/src/lightning/formattedNumber/formattedNumber.js-meta.xml +3 -0
  142. package/src/lightning/formattedRichText/formattedRichText.js +5 -5
  143. package/src/lightning/formattedRichText/linkTextNodes.js +58 -0
  144. package/src/lightning/formattedRichText/richTextConfig.js +1 -0
  145. package/src/lightning/groupedCombobox/form-element.slds.css +54 -54
  146. package/src/lightning/groupedCombobox/grouped-combobox.slds.css +0 -2
  147. package/src/lightning/groupedCombobox/groupedCombobox.js-meta.xml +1 -1
  148. package/src/lightning/groupedCombobox/input-text.slds.css +41 -68
  149. package/src/lightning/helptext/button-icon.slds.css +1 -1
  150. package/src/lightning/helptext/form-element.slds.css +54 -54
  151. package/src/lightning/helptext/helptext.css +7 -0
  152. package/src/lightning/helptext/helptext.js +3 -4
  153. package/src/lightning/icon/icon.html +1 -1
  154. package/src/lightning/icon/icon.slds.css +12 -25
  155. package/src/lightning/input/form-element.slds.css +54 -54
  156. package/src/lightning/input/input.html +5 -0
  157. package/src/lightning/inputAddress/addressFormat.js +31 -4
  158. package/src/lightning/inputAddress/fieldsLayout.js +6 -0
  159. package/src/lightning/inputAddress/form-element.slds.css +54 -54
  160. package/src/lightning/inputAddress/input-address.slds.css +1 -2
  161. package/src/lightning/inputAddress/input-text.slds.css +41 -68
  162. package/src/lightning/inputAddress/inputAddress.html +19 -1
  163. package/src/lightning/inputAddress/inputAddress.js +75 -3
  164. package/src/lightning/inputAddress/inputAddress.js-meta.xml +3 -0
  165. package/src/lightning/inputLocation/form-element.slds.css +54 -54
  166. package/src/lightning/inputLocation/input-location.slds.css +1 -2
  167. package/src/lightning/inputLocation/input-text.slds.css +41 -68
  168. package/src/lightning/inputName/form-element.slds.css +54 -54
  169. package/src/lightning/inputName/input-text.slds.css +41 -68
  170. package/src/lightning/interactiveDialogBase/interactive-dialog-base.slds.css +0 -3
  171. package/src/lightning/interactiveDialogBase/interactiveDialogBase.js-meta.xml +6 -0
  172. package/src/lightning/internationalizationLibrary/address/AddressFormat.js +553 -610
  173. package/src/lightning/lookupAddress/form-element.slds.css +54 -54
  174. package/src/lightning/lookupAddress/listbox.slds.css +51 -99
  175. package/src/lightning/lookupAddress/location.js +2 -0
  176. package/src/lightning/lookupAddress/lookup-address.slds.css +0 -2
  177. package/src/lightning/lookupAddress/lookupAddress.html +6 -1
  178. package/src/lightning/lookupAddress/lookupAddress.js +40 -10
  179. package/src/lightning/menuDivider/menu-divider.slds.css +0 -2
  180. package/src/lightning/menuItem/menu-item.slds.css +8 -2
  181. package/src/lightning/menuSubheader/menu-subheader.slds.css +1 -2
  182. package/src/lightning/modal/__docs__/modal.md +10 -1
  183. package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +3 -7
  184. package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +39 -133
  185. package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
  186. package/src/lightning/modal/modal.js +1 -1
  187. package/src/lightning/modalBase/modal-base.slds.css +3 -3
  188. package/src/lightning/modalBase/modalBase.html +15 -10
  189. package/src/lightning/modalBase/modalBase.js +131 -154
  190. package/src/lightning/modalBase/modalBase.js-meta.xml +6 -0
  191. package/src/lightning/modalBody/modal-body.slds.css +1 -2
  192. package/src/lightning/modalBody/modalBody.css +6 -0
  193. package/src/lightning/modalFooter/modal-footer.slds.css +2 -2
  194. package/src/lightning/modalFooter/modalFooter.js +0 -21
  195. package/src/lightning/modalHeader/modal-header.slds.css +1 -2
  196. package/src/lightning/modalHeader/modalHeader.html +16 -4
  197. package/src/lightning/modalHeader/modalHeader.js +61 -36
  198. package/src/lightning/overlay/overlay.js-meta.xml +6 -0
  199. package/src/lightning/pill/link.html +1 -0
  200. package/src/lightning/pill/pill.slds.css +32 -58
  201. package/src/lightning/pill/plain.html +1 -0
  202. package/src/lightning/pill/plainLink.html +1 -0
  203. package/src/lightning/pillContainer/button.slds.css +1 -1
  204. package/src/lightning/pillContainer/listbox.slds.css +51 -99
  205. package/src/lightning/pillContainer/pill-container.slds.css +6 -10
  206. package/src/lightning/pillContainer/pill.slds.css +32 -58
  207. package/src/lightning/popup/popover.slds.css +0 -2
  208. package/src/lightning/primitiveBubble/primitiveBubble.js +42 -0
  209. package/src/lightning/primitiveBubble/primitiveBubble.js-meta.xml +6 -0
  210. package/src/lightning/primitiveButton/primitiveButoon.js-meta.xml +6 -0
  211. package/src/lightning/primitiveCellCheckbox/checkbox.css +2 -0
  212. package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +16 -38
  213. package/src/lightning/primitiveCustomCell/primitiveCustomCell.js +26 -1
  214. package/src/lightning/primitiveDatatableCell/primitiveDatatableCell.js +1 -1
  215. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.html +1 -1
  216. package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.js +13 -0
  217. package/src/lightning/primitiveHeaderFactory/nonsortableHeader.css +1 -0
  218. package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +19 -6
  219. package/src/lightning/primitiveHeaderFactory/selectableHeader.css +2 -0
  220. package/src/lightning/primitiveHeaderFactory/sortableHeader.html +3 -1
  221. package/src/lightning/primitiveIcon/icon.slds.css +12 -25
  222. package/src/lightning/primitiveIcon/primitiveIcon.js-meta.xml +6 -0
  223. package/src/lightning/primitiveIframe/primitiveIframe.js +3 -1
  224. package/src/lightning/primitiveInputCheckbox/form-element.slds.css +54 -54
  225. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +5 -2
  226. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js-meta.xml +6 -0
  227. package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +54 -54
  228. package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +6 -4
  229. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +5 -2
  230. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js-meta.xml +6 -0
  231. package/src/lightning/primitiveInputColor/form-element.slds.css +54 -54
  232. package/src/lightning/primitiveInputColor/input-color.slds.css +2 -3
  233. package/src/lightning/primitiveInputColor/input-text.slds.css +41 -68
  234. package/src/lightning/primitiveInputColor/primitiveInputColor.js +5 -2
  235. package/src/lightning/primitiveInputColor/primitiveInputColor.js-meta.xml +6 -0
  236. package/src/lightning/primitiveInputFile/button.slds.css +1 -1
  237. package/src/lightning/primitiveInputFile/form-element.slds.css +54 -54
  238. package/src/lightning/primitiveInputFile/input-file.slds.css +1 -4
  239. package/src/lightning/primitiveInputFile/primitiveInputFile.js +4 -2
  240. package/src/lightning/primitiveInputFile/primitiveInputFile.js-meta.xml +6 -0
  241. package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +4 -2
  242. package/src/lightning/primitiveInputSimple/form-element.slds.css +54 -54
  243. package/src/lightning/primitiveInputSimple/input-text.slds.css +41 -68
  244. package/src/lightning/primitiveInputSimple/primitiveInputSimple.js-meta.xml +6 -0
  245. package/src/lightning/primitiveInputToggle/form-element.slds.css +54 -54
  246. package/src/lightning/primitiveInputToggle/input-toggle.slds.css +50 -27
  247. package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +5 -2
  248. package/src/lightning/primitiveInputToggle/primitiveInputToggle.js-meta.xml +6 -0
  249. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.css +11 -0
  250. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.html +2 -1
  251. package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.js +1 -0
  252. package/src/lightning/progressBar/progress-bar.slds.css +8 -10
  253. package/src/lightning/progressRing/progress-ring.slds.css +0 -23
  254. package/src/lightning/progressStep/base.html +5 -6
  255. package/src/lightning/progressStep/progressStep.js +15 -23
  256. package/src/lightning/prompt/__docs__/prompt.md +1 -1
  257. package/src/lightning/radioGroup/form-element.slds.css +54 -54
  258. package/src/lightning/radioGroup/radioGroup.html +1 -2
  259. package/src/lightning/radioGroup/radioGroup.js +1 -0
  260. package/src/lightning/routingService/routingService.js +31 -5
  261. package/src/lightning/select/form-element.slds.css +54 -54
  262. package/src/lightning/select/select.slds.css +4 -2
  263. package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +0 -2
  264. package/src/lightning/sldsCommon/sldsCommon.css +134 -98
  265. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +1 -1
  266. package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +14 -13
  267. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +95 -92
  268. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +1 -1
  269. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +77 -75
  270. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +73 -73
  271. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +552 -558
  272. package/src/lightning/sldsUtilsVisibility/sldsUtilsVisibility.css +5 -1
  273. package/src/lightning/spinner/spinner.slds.css +62 -62
  274. package/src/lightning/staticMap/staticMap.js +3 -2
  275. package/src/lightning/tab/tab.js +10 -5
  276. package/src/lightning/tab/tab.js-meta.xml +3 -0
  277. package/src/lightning/tab/tab.slds.css +14 -7
  278. package/src/lightning/tabBar/tab-bar.slds.css +16 -6
  279. package/src/lightning/tabBar/tabBar.js +10 -5
  280. package/src/lightning/tabset/__docs__/tabset.md +24 -1
  281. package/src/lightning/tabset/tabset.html +2 -0
  282. package/src/lightning/tabset/tabset.js +25 -38
  283. package/src/lightning/tabset/tabset.js-meta.xml +3 -0
  284. package/src/lightning/tabset/tabset.slds.css +0 -2
  285. package/src/lightning/textarea/form-element.slds.css +54 -54
  286. package/src/lightning/textarea/textarea.js +11 -2
  287. package/src/lightning/textarea/textarea.slds.css +22 -9
  288. package/src/lightning/timepicker/form-element.slds.css +54 -54
  289. package/src/lightning/timepicker/timepicker.js-meta.xml +6 -0
  290. package/src/lightning/timepicker/timepicker.slds.css +2 -2
  291. package/src/lightning/toast/__docs__/toast.md +20 -22
  292. package/src/lightning/toast/button-icon.slds.css +1 -1
  293. package/src/lightning/toast/icon.slds.css +12 -25
  294. package/src/lightning/toast/toast.js +15 -12
  295. package/src/lightning/toast/toast.slds.css +6 -18
  296. package/src/lightning/toastContainer/__docs__/toastContainer.md +3 -2
  297. package/src/lightning/toastContainer/toast.slds.css +6 -18
  298. package/src/lightning/toastContainer/toastContainer.js +25 -17
  299. package/src/lightning/tooltipLibrary/tooltipLibrary.js +36 -24
  300. package/src/lightning/tree/tree.js +2 -0
  301. package/src/lightning/utils/classSet.js +9 -3
  302. package/src/lightning/utilsPrivate/formatUtils.js +158 -0
  303. package/src/lightning/utilsPrivate/textUtils.js +16 -0
  304. package/src/lightning/utilsPrivate/utilsPrivate.js +56 -15
  305. package/src/lightning/utilsPrivate/validationUtils.js +59 -0
  306. package/src/lightning/verticalNavigation/vertical-navigation.slds.css +14 -0
  307. package/src/lightning/verticalNavigation/verticalNavigation.css +1 -1
  308. package/src/lightning/verticalNavigation/verticalNavigation.html +1 -1
  309. package/src/lightning/verticalNavigation/verticalNavigation.js +66 -28
  310. package/src/lightning/verticalNavigation/verticalNavigation.js-meta.xml +3 -0
  311. package/src/lightning/verticalNavigationItem/vertical-navigation-item.slds.css +63 -0
  312. package/src/lightning/verticalNavigationItem/verticalNavigationItem.css +2 -3
  313. package/src/lightning/verticalNavigationItem/verticalNavigationItem.js +29 -15
  314. package/src/lightning/verticalNavigationItem/verticalNavigationItem.js-meta.xml +3 -0
  315. package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.native.css +2 -0
  316. package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.synthetic.css +3 -0
  317. package/src/lightning/verticalNavigationItemBadge/badge.slds.css +76 -0
  318. package/src/lightning/verticalNavigationItemBadge/vertical-navigation-item.slds.css +63 -0
  319. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.css +2 -3
  320. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.html +1 -1
  321. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js +28 -15
  322. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js-meta.xml +3 -0
  323. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.native.css +5 -0
  324. package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.synthetic.css +3 -0
  325. package/src/lightning/verticalNavigationItemIcon/vertical-navigation-item.slds.css +63 -0
  326. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.css +2 -3
  327. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js +29 -15
  328. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js-meta.xml +3 -0
  329. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.native.css +3 -0
  330. package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.synthetic.css +3 -0
  331. package/src/lightning/verticalNavigationOverflow/button.slds.css +503 -0
  332. package/src/lightning/verticalNavigationOverflow/vertical-navigation-item.slds.css +63 -0
  333. package/src/lightning/verticalNavigationOverflow/vertical-navigation-section.slds.css +17 -0
  334. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.css +2 -1
  335. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.html +2 -0
  336. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js +18 -13
  337. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js-meta.xml +3 -0
  338. package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.lbc.native.css +5 -0
  339. package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +13 -15
  340. package/src/lightning/verticalNavigationSection/verticalNavigationSection.js-meta.xml +3 -0
  341. package/src/lightning/datatable/__examples__/customDatatableWrapper/customDatatableWrapper.js +0 -158
  342. package/src/lightning/datatable/__examples__/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +0 -6
  343. package/src/lightning/datatable/__examples__/customDatatypeLink/customDatatypeLink.html +0 -9
  344. package/src/lightning/datatable/__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +0 -40
  345. package/src/lightning/datatable/__examples__/customDatatypeTable/customNumber.html +0 -3
  346. package/src/lightning/datatable/inlineEditShared.js +0 -26
  347. package/src/lightning/datatable/resizeSensor.js +0 -244
  348. package/src/lightning/formattedRichText/linkify.js +0 -43
  349. package/src/lightning/utilsPrivate/smartSetAttribute.js +0 -19
  350. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatableWrapper/customDatatableWrapper.html +0 -0
  351. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeLink/customDatatypeLink.js +0 -0
  352. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.html +0 -0
  353. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.js +0 -0
  354. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customDatatypeTable.js +0 -0
  355. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customLink.html +0 -0
  356. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customName.html +0 -0
  357. /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/orderingButtons.html +0 -0
@@ -1,33 +1,6 @@
1
1
  import { assert } from 'lightning/utilsPrivate';
2
2
  import { getColumnName } from './columns-shared';
3
3
 
4
- const VALID_SORT_DIRECTIONS = {
5
- asc: true,
6
- desc: true,
7
- };
8
-
9
- /**
10
- * Determines if the supplied sort direction is valid.
11
- * Refer to `VALID_SORT_DIRECTIONS` for valid solid directions.
12
- *
13
- * @param {String} value The sort direction to validate
14
- * @returns {Boolean} Whether the supplied sort direction is valid
15
- */
16
- export function isValidSortDirection(value) {
17
- return !!VALID_SORT_DIRECTIONS[value];
18
- }
19
-
20
- /**
21
- * Gets the default sort direction. When clicking on a header to sort,
22
- * the default sort direction is applied first. Clicking again reverses it
23
- *
24
- * @param {Object} state The current datatable state
25
- * @returns {String} The default sort direction
26
- */
27
- export function getDefaultSortDirection(state) {
28
- return state.defaultSortDirection;
29
- }
30
-
31
4
  /**
32
5
  * Sets the default sort direction. When clicking on a header to sort,
33
6
  * the default sort direction is applied first. Clicking again reverses it
@@ -36,25 +9,16 @@ export function getDefaultSortDirection(state) {
36
9
  * @param {String} value The value to update the default sort direction to
37
10
  */
38
11
  export function setDefaultSortDirection(state, value) {
12
+ if (value === 'asc' || value === 'desc') {
13
+ state.defaultSortDirection = value;
14
+ return;
15
+ }
39
16
  assert(
40
- isValidSortDirection(value),
17
+ false,
41
18
  `The "defaultSortDirection" value passed into lightning:datatable
42
19
  is incorrect, "defaultSortDirection" value should be one of
43
- ${Object.keys(VALID_SORT_DIRECTIONS).join()}.`
20
+ 'asc' or 'desc'.`
44
21
  );
45
- state.defaultSortDirection = isValidSortDirection(value)
46
- ? value
47
- : getDefaultSortDirection(state);
48
- }
49
-
50
- /**
51
- * Gets the current sort direction
52
- *
53
- * @param {Object} state The current datatable state
54
- * @returns {String} The current sort direction
55
- */
56
- export function getSortedDirection(state) {
57
- return state.sortedDirection;
58
22
  }
59
23
 
60
24
  /**
@@ -63,29 +27,21 @@ export function getSortedDirection(state) {
63
27
  * an error providing resolution information. In an error case,
64
28
  * `sortedDirection` will be `undefined`
65
29
  *
66
- * @param {Object} state The current datatable state
30
+ * @param {Object} state The datatable state
67
31
  * @param {String} value The value to update the sort direction to
68
32
  */
69
33
  export function setSortedDirection(state, value) {
70
- const isValid = isValidSortDirection(value);
34
+ if (value === 'asc' || value === 'desc') {
35
+ state.sortedDirection = value;
36
+ return;
37
+ }
71
38
  assert(
72
- isValid,
39
+ false,
73
40
  `The "sortedDirection" value passed into lightning:datatable
74
41
  is incorrect, "sortedDirection" value should be one of
75
- ${Object.keys(VALID_SORT_DIRECTIONS).join()}.`
42
+ 'asc' or 'desc'.`
76
43
  );
77
- state.sortedDirection = isValid ? value : undefined;
78
- }
79
-
80
- /**
81
- * Gets the current sort value. The value will match the name
82
- * of a given column in the datatable
83
- *
84
- * @param {Object} state The current datatable state
85
- * @returns {String} The current sort value
86
- */
87
- export function getSortedBy(state) {
88
- return state.sortedBy;
44
+ state.sortedDirection = undefined;
89
45
  }
90
46
 
91
47
  /**
@@ -94,7 +50,7 @@ export function getSortedBy(state) {
94
50
  * non-string value is provided, the sort value with fallback
95
51
  * to `undefined`
96
52
  *
97
- * @param {Object} state The current datatable state
53
+ * @param {Object} state The datatable state
98
54
  * @param {String} value The value to update the sort state to
99
55
  */
100
56
  export function setSortedBy(state, value) {
@@ -111,29 +67,18 @@ export function setSortedBy(state, value) {
111
67
  * @param {Object} state The current datatable state
112
68
  */
113
69
  export function updateSorting(state) {
114
- const { columns } = state;
70
+ const { columns, defaultSortDirection, sortedBy, sortedDirection } = state;
115
71
  for (let i = 0, { length } = columns; i < length; i += 1) {
116
- updateColumnSortingState(columns[i], state);
117
- }
118
- }
119
-
120
- /**
121
- * Applies sorting to a datatable column
122
- *
123
- * @param {Object} column The datatable column name to sort
124
- * @param {Object} state The current datatable state
125
- */
126
- export function updateColumnSortingState(column, state) {
127
- const { sortedBy, sortedDirection, defaultSortDirection } = state;
128
-
129
- if (column.sortable && getColumnName(column) === sortedBy) {
130
- column.sorted = true;
131
- column.sortAriaLabel =
132
- sortedDirection === 'desc' ? 'descending' : 'ascending';
133
- column.sortedDirection = sortedDirection;
134
- } else {
135
- column.sorted = false;
136
- column.sortAriaLabel = column.sortable ? 'other' : null;
137
- column.sortedDirection = defaultSortDirection;
72
+ const col = columns[i];
73
+ if (col.sortable && getColumnName(col) === sortedBy) {
74
+ col.sorted = true;
75
+ col.sortAriaLabel =
76
+ sortedDirection === 'desc' ? 'descending' : 'ascending';
77
+ col.sortedDirection = sortedDirection;
78
+ } else {
79
+ col.sorted = false;
80
+ col.sortAriaLabel = col.sortable ? 'other' : null;
81
+ col.sortedDirection = defaultSortDirection;
82
+ }
138
83
  }
139
84
  }
@@ -1,57 +1,2 @@
1
- /** Styles that aren't available from SLDS **/
2
-
3
- .cell {
4
- display: inline-block;
5
- padding: .25rem .5rem;
6
- white-space: nowrap;
7
- }
8
-
9
- .column-header {
10
- color: #514f4d;
11
- padding: .25rem .5rem;
12
- font-weight: 700;
13
- line-height: normal;
14
- }
15
-
16
- .table-header {
17
- height: 0;
18
- }
19
-
20
- /* Row borders */
21
- [data-row-key-value] {
22
- border-top: 1px solid #dddbda;
23
- }
24
-
25
- .slds-table_header-fixed [data-row-key-value]:first-child {
26
- border-top: 0;
27
- }
28
-
29
- /* Required for row numbers */
30
- [role="row"] {
31
- counter-increment: row-number;
32
- }
33
-
34
- /* Move column header row to left;
35
- TODO: See if there a better way */
36
- [role="grid"] > [role="rowgroup"]:nth-child(1) {
37
- margin-left: -0.5rem;
38
- }
39
-
40
- [role="columnheader"] {
41
- outline: none;
42
- }
43
-
44
- [role="row"]:hover {
45
- background-color: var(--sds-c-color-background, #f3f2f2);
46
- }
47
-
48
- [role="row"].slds-is-selected {
49
- background-color: var(--sds-c-color-background-dark, #ecebea);
50
- }
51
-
52
- [role="rowheader"].slds-has-focus,
53
- [role="rowheader"]:focus {
54
- box-shadow: var(--sds-c-color-border-selection, #0176d3) 0 0 0 1px inset;
55
- box-shadow: var(--sds-c-color-border-selection, #0176d3) 0 0 0 1px inset;
56
- outline: 0;
57
- }
1
+ @import './div.lbc.synthetic.css';
2
+ @import './div.lbc.native.css';
@@ -7,7 +7,7 @@
7
7
  <span data-keyboard-mode="action" class={computedAriaLiveClassForActionMode}>{i18n.ariaLiveActionMode}</span>
8
8
  </span>
9
9
  <div lwc:dom="manual" class="dt-width-observer" style="width: 100%; height: 0px;"></div>
10
- <div class="dt-outer-container" style="height: 100%; position: relative;">
10
+ <div part="datagrid-wrapper" class="dt-outer-container" style="height: 100%; position: relative;">
11
11
  <!-- Inline Edit Panel -->
12
12
  <lightning-primitive-datatable-iedit-panel
13
13
  data-iedit-panel="true"
@@ -23,18 +23,20 @@
23
23
  onmasscheckboxchange={handleMassCheckboxChange}
24
24
  ></lightning-primitive-datatable-iedit-panel>
25
25
  <!-- Table Container -->
26
- <div class={computedTableContainerClass} onscroll={handleHorizontalScroll} style={scrollerXStyles}>
27
- <div class="slds-scrollable_y" onscroll={handleVerticalScroll} style={computedScrollerStyle}>
26
+ <div class={computedTableContainerClass} onscroll={handleHorizontalScroll} style={computedScrollerXStyle}>
27
+ <div class="slds-scrollable_y" onscroll={handleVerticalScroll} style={computedScrollerYStyle}>
28
28
  <!-- Corresponds to <table> -->
29
29
  <div class={computedTableClass}
30
+ part="datagrid"
30
31
  role={computedTableRole}
31
32
  style={computedTableStyle}
32
33
  onkeydown={handleTableKeydown}
33
- onclick={handleCellClick}
34
+ onclick={handleTableCellClick}
34
35
  onfocusin={handleTableFocusIn}
35
36
  onfocusout={handleTableFocusOut}
36
37
  aria-label={ariaLabel}
37
38
  aria-labelledby={ariaLabelledBy}
39
+ aria-describedby={ariaDescribedBy}
38
40
  aria-rowcount={ariaRowCount}
39
41
  aria-colcount={ariaColCount}
40
42
  data-num-rows={data.length}
@@ -46,6 +48,7 @@
46
48
  <template if:true={hasValidKeyField}>
47
49
  <!-- Corresponds to <thead> -->
48
50
  <div
51
+ part="datagrid-header"
49
52
  data-rowgroup-header
50
53
  role="rowgroup">
51
54
  <!-- TODO: Fix aria-rowindex to not be hardcoded -->
@@ -59,7 +62,8 @@
59
62
  onprivateresizeend={handleResizeEnd}>
60
63
  <template for:each={state.columns} for:item="def" for:index="colIndex">
61
64
  <!-- Column Header -->
62
- <div class="column-header cell"
65
+ <div part="cell"
66
+ class="column-header cell"
63
67
  style={def.style}
64
68
  role="columnheader"
65
69
  tabindex={def.tabIndex}
@@ -118,7 +122,7 @@
118
122
  </div>
119
123
  </div>
120
124
  <!-- Corresponds to <tbody> -->
121
- <div
125
+ <div part="datagrid-body"
122
126
  data-rowgroup-body
123
127
  role="rowgroup"
124
128
  style={computedTbodyStyle}>
@@ -142,7 +146,8 @@
142
146
  <template for:each={row.cells} for:item="cell">
143
147
  <template if:true={cell.isCheckbox}>
144
148
  <!-- Checkbox Cell -->
145
- <div class={cell.class}
149
+ <div part="cell"
150
+ class={cell.class}
146
151
  style={cell.style}
147
152
  role="gridcell"
148
153
  tabindex={cell.tabIndex}
@@ -166,11 +171,13 @@
166
171
  </template>
167
172
  <template if:true={cell.isDataTypeScope}>
168
173
  <!-- Row Header Cell -->
169
- <div class={cell.class}
174
+ <div part="cell"
175
+ class={cell.class}
170
176
  role="rowheader"
171
177
  style={cell.style}
172
178
  aria-selected={cell.ariaSelected}
173
179
  aria-readonly={cell.ariaReadOnly}
180
+ aria-describedby={cell.describedBy}
174
181
  tabindex={cell.tabIndex}
175
182
  data-label={cell.dataLabel}
176
183
  data-col-key-value={cell.colKeyValue}
@@ -211,11 +218,15 @@
211
218
  type-attribute-21={cell.typeAttribute21}
212
219
  type-attribute-22={cell.typeAttribute22}>
213
220
  </lightning-primitive-cell-factory>
221
+ <template if:true={cell.describedBy}>
222
+ <span id={cell.describedBy} class="slds-hide">Unsaved</span>
223
+ </template>
214
224
  </div>
215
225
  </template>
216
226
  <template if:true={cell.isDataType}>
217
227
  <!-- Non-Header Cells (Regular Data Cells) -->
218
- <div class={cell.class}
228
+ <div part="cell"
229
+ class={cell.class}
219
230
  role="gridcell"
220
231
  style={cell.style}
221
232
  aria-selected={cell.ariaSelected}
@@ -227,6 +238,7 @@
227
238
  <lightning-primitive-cell-factory
228
239
  types={privateTypes}
229
240
  aria-selected={cell.ariaSelected}
241
+ aria-describedby={cell.describedBy}
230
242
  data-label={cell.dataLabel}
231
243
  alignment={cell.alignment}
232
244
  has-focus={cell.hasFocus}
@@ -260,6 +272,9 @@
260
272
  type-attribute-21={cell.typeAttribute21}
261
273
  type-attribute-22={cell.typeAttribute22}>
262
274
  </lightning-primitive-cell-factory>
275
+ <template if:true={cell.describedBy}>
276
+ <span id={cell.describedBy} class="slds-hide">Unsaved</span>
277
+ </template>
263
278
  </div>
264
279
  </template>
265
280
  </template>
@@ -268,7 +283,7 @@
268
283
  <!-- Loading Indicator -->
269
284
  <template if:true={isLoading}>
270
285
  <div>
271
- <div colspan={numberOfColumns} class="slds-is-relative">
286
+ <div colspan={state.columns.length} class="slds-is-relative">
272
287
  <lightning-primitive-datatable-loading-indicator></lightning-primitive-datatable-loading-indicator>
273
288
  </div>
274
289
  </div>
@@ -0,0 +1,3 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import 'lightning/sldsUtilsVisibility';
3
+ @import '../../datagrid.slds.css';
@@ -0,0 +1,80 @@
1
+ /* TODO: fix last row's bottom border */
2
+
3
+ .slds-table_header-fixed [part='datagrid-header'] {
4
+ position: absolute;
5
+ top: 0;
6
+ min-height: var(--slds-g-sizing-9);
7
+ z-index: 1;
8
+ }
9
+
10
+ .table-header {
11
+ height: 0;
12
+ }
13
+
14
+ /* Cells */
15
+ [part='cell'] {
16
+ position: relative;
17
+ padding-inline: var(--slds-g-sizing-3);
18
+ padding-block: var(--slds-g-sizing-2);
19
+ white-space: nowrap;
20
+ align-items: center;
21
+ }
22
+
23
+ /* cell focus border color */
24
+ [role='gridcell']:focus,
25
+ [role='rowheader']:focus {
26
+ box-shadow: var(--slds-g-color-border-accent-2) 0 0 0 1px inset;
27
+ }
28
+
29
+ /* Column Header Cells */
30
+ [role='columnheader'] {
31
+ outline: none;
32
+ color: #514f4d;
33
+ font-weight: 700;
34
+ line-height: normal;
35
+ }
36
+
37
+ /* Rows */
38
+
39
+ /* Row borders */
40
+ [data-row-key-value] {
41
+ border-top: var(--slds-g-sizing-border-1) solid var(--slds-g-color-border-1);
42
+ }
43
+
44
+ /* row border on hover */
45
+ [data-row-key-value]:hover [role='gridcell']:not(.slds-has-focus),
46
+ [data-row-key-value]:hover [role='rowheader']:not(.slds-has-focus) {
47
+ box-shadow: inset 0 var(--slds-g-sizing-border-1)
48
+ var(--slds-g-color-border-1),
49
+ inset 0 calc(var(--slds-g-sizing-border-1) * -1)
50
+ var(--slds-g-color-border-1);
51
+ }
52
+
53
+ .slds-table_header-fixed [data-row-key-value]:first-child {
54
+ border-top: 0;
55
+ }
56
+
57
+ [role='row'] {
58
+ /* Required for row numbers */
59
+ counter-increment: row-number;
60
+ display: flex;
61
+ }
62
+
63
+ /* Move column header row to left;
64
+ TODO: See if there a better way */
65
+ [role='grid'] > [role='rowgroup']:nth-child(1) {
66
+ margin-left: -0.5rem;
67
+ }
68
+
69
+ /* TODO: Replace with styling hook */
70
+ [role='row']:hover {
71
+ background-color: #f3f2f2;
72
+ }
73
+ /* TODO: Replace with styling hook */
74
+ [role='row'].slds-is-selected {
75
+ background-color: #ecebea;
76
+ }
77
+
78
+ .slds-cell-edit:hover {
79
+ background-color: var(--slds-g-color-surface-container-1);
80
+ }
@@ -22,18 +22,19 @@
22
22
  onmasscheckboxchange={handleMassCheckboxChange}>
23
23
  </lightning-primitive-datatable-iedit-panel>
24
24
  <!-- Table Container -->
25
- <div class={computedTableContainerClass} onscroll={handleHorizontalScroll} style={scrollerXStyles}>
26
- <div class="slds-scrollable_y" onscroll={handleVerticalScroll} style={computedScrollerStyle}>
25
+ <div class={computedTableContainerClass} onscroll={handleHorizontalScroll} style={computedScrollerXStyle}>
26
+ <div class="slds-scrollable_y" onscroll={handleVerticalScroll} style={computedScrollerYStyle}>
27
27
  <!-- Table -->
28
28
  <table class={computedTableClass}
29
29
  role={computedTableRole}
30
30
  style={computedTableStyle}
31
31
  onkeydown={handleTableKeydown}
32
- onclick={handleCellClick}
32
+ onclick={handleTableCellClick}
33
33
  onfocusin={handleTableFocusIn}
34
34
  onfocusout={handleTableFocusOut}
35
35
  aria-label={ariaLabel}
36
36
  aria-labelledby={ariaLabelledBy}
37
+ aria-describedby={ariaDescribedBy}
37
38
  data-num-rows={data.length}
38
39
  data-num-selected-rows={selectedRows.length}
39
40
  data-last-rendered-row={_lastRenderedRow}>
@@ -111,6 +112,7 @@
111
112
  <template for:each={renderedRows} for:item="row" for:index="rowIndex">
112
113
  <!-- Data Rows -->
113
114
  <tr class={row.classnames}
115
+ role="row"
114
116
  onkeydown={handleKeydownOnDataRow}
115
117
  onprivatelookupitempicked={handlePrivateLookupItemPicked}
116
118
  key={row.key}
@@ -149,6 +151,7 @@
149
151
  <template if:true={cell.isDataTypeScope}>
150
152
  <!-- Row Header Cell -->
151
153
  <th class={cell.class}
154
+ role="rowheader"
152
155
  style={cell.style}
153
156
  aria-selected={cell.ariaSelected}
154
157
  aria-readonly={cell.ariaReadOnly}
@@ -156,7 +159,8 @@
156
159
  tabindex={cell.tabIndex}
157
160
  data-label={cell.dataLabel}
158
161
  data-col-key-value={cell.colKeyValue}
159
- key={cell.colKeyValue}>
162
+ key={cell.colKeyValue}
163
+ aria-describedby={cell.describedBy}>
160
164
  <lightning-primitive-cell-factory
161
165
  types={privateTypes}
162
166
  aria-selected={cell.ariaSelected}
@@ -194,6 +198,9 @@
194
198
  type-attribute-21={cell.typeAttribute21}
195
199
  type-attribute-22={cell.typeAttribute22}>
196
200
  </lightning-primitive-cell-factory>
201
+ <template if:true={cell.describedBy}>
202
+ <span id={cell.describedBy} class="slds-hide">Unsaved</span>
203
+ </template>
197
204
  </th>
198
205
  </template>
199
206
  <template if:true={cell.isDataType}>
@@ -206,6 +213,7 @@
206
213
  tabindex={cell.tabIndex}
207
214
  data-label={cell.dataLabel}
208
215
  data-col-key-value={cell.colKeyValue}
216
+ aria-describedby={cell.describedBy}
209
217
  key={cell.colKeyValue}>
210
218
  <lightning-primitive-cell-factory
211
219
  types={privateTypes}
@@ -244,6 +252,9 @@
244
252
  type-attribute-21={cell.typeAttribute21}
245
253
  type-attribute-22={cell.typeAttribute22}>
246
254
  </lightning-primitive-cell-factory>
255
+ <template if:true={cell.describedBy}>
256
+ <span id={cell.describedBy} class="slds-hide">Unsaved</span>
257
+ </template>
247
258
  </td>
248
259
  </template>
249
260
  </template>
@@ -252,7 +263,7 @@
252
263
  <!-- Loading Indicator -->
253
264
  <template if:true={isLoading}>
254
265
  <tr>
255
- <td colspan={numberOfColumns} class="slds-is-relative">
266
+ <td colspan={state.columns.length} class="slds-is-relative">
256
267
  <lightning-primitive-datatable-loading-indicator></lightning-primitive-datatable-loading-indicator>
257
268
  </td>
258
269
  </tr>
@@ -1,23 +1,3 @@
1
- import { getColumns } from './columns';
2
- import { isTreeType } from './types';
3
-
4
- /**
5
- * Retrieves the default values for the tree state indicator field names.
6
- * These values are used to make logic decisions later and may be updated
7
- * during normal operation.
8
- *
9
- * @returns {Object} The default tree state indicator field names
10
- */
11
- export function getTreeStateIndicatorFieldNames() {
12
- return {
13
- children: 'hasChildren',
14
- level: 'level',
15
- expanded: 'isExpanded',
16
- position: 'posInSet',
17
- setsize: 'setSize',
18
- };
19
- }
20
-
21
1
  /**
22
2
  * Determines if any of the columns in the datatable are of a tree-type.
23
3
  *
@@ -25,9 +5,9 @@ export function getTreeStateIndicatorFieldNames() {
25
5
  * @returns {Boolean} Whether any of the columns are of a tree-type
26
6
  */
27
7
  export function hasTreeDataType(state) {
28
- const columns = getColumns(state);
8
+ const { columns } = state;
29
9
  for (let i = 0, { length } = columns; i < length; i += 1) {
30
- if (isTreeType(columns[i].type)) {
10
+ if (columns[i].type === 'tree') {
31
11
  return true;
32
12
  }
33
13
  }
@@ -41,10 +21,10 @@ export function hasTreeDataType(state) {
41
21
  * @returns {Object} The first tree-type column, else `null`
42
22
  */
43
23
  export function getStateTreeColumn(state) {
44
- const columns = getColumns(state);
24
+ const { columns } = state;
45
25
  for (let i = 0, { length } = columns; i < length; i += 1) {
46
26
  const col = columns[i];
47
- if (isTreeType(col.type)) {
27
+ if (col.type === 'tree') {
48
28
  return col;
49
29
  }
50
30
  }
@@ -54,18 +34,20 @@ export function getStateTreeColumn(state) {
54
34
  /**
55
35
  * Dispatches an event when a row is toggled to be expanded or collapsed.
56
36
  *
37
+ * @param {Object} dt - The datatable instance
57
38
  * @param {String} rowKeyValue The row key being acted upon
58
39
  * @param {Boolean} expanded The current expand/collapse state of the row
59
40
  */
60
- export function fireRowToggleEvent(rowKeyValue, expanded) {
61
- const customEvent = new CustomEvent('privatetogglecell', {
62
- bubbles: true,
63
- composed: true,
64
- cancelable: true,
65
- detail: {
66
- name: rowKeyValue,
67
- nextState: expanded ? false : true, // True = expanded, False = collapsed
68
- },
69
- });
70
- this.dispatchEvent(customEvent);
41
+ export function fireRowToggleEvent(dt, rowKeyValue, expanded) {
42
+ dt.dispatchEvent(
43
+ new CustomEvent('privatetogglecell', {
44
+ bubbles: true,
45
+ composed: true,
46
+ cancelable: true,
47
+ detail: {
48
+ name: rowKeyValue,
49
+ nextState: expanded ? false : true, // True = expanded, False = collapsed
50
+ },
51
+ })
52
+ );
71
53
  }
@@ -149,26 +149,6 @@ export function isValidType(typeName) {
149
149
  return STANDARD_TYPE_NAMES.has(typeName);
150
150
  }
151
151
 
152
- /**
153
- * Determines if a supplied type is a tree type.
154
- *
155
- * @param {String} typeName The type to validate
156
- * @returns {Boolean} Whether the supplied type is a tree type
157
- */
158
- export function isTreeType(typeName) {
159
- return typeName === 'tree';
160
- }
161
-
162
- /**
163
- * Determines if a supplied type is valid for a tree type datatable.
164
- *
165
- * @param {String} typeName The type to validate
166
- * @returns {Boolean} Whether the supplied type is valid for a tree
167
- */
168
- export function isValidTypeForTree(typeName) {
169
- return TREE_SUPPORTED_TYPES.has(typeName);
170
- }
171
-
172
152
  /**
173
153
  * Retrieves the attributes for a given type. Additionally, verifies
174
154
  * the supplied type is valid.
@@ -181,16 +161,6 @@ export function getAttributesNames(typeName) {
181
161
  isValidType(typeName),
182
162
  `You are trying to access an invalid type (${typeName})`
183
163
  );
184
- return getStandardTypeAttributesNames(typeName);
185
- }
186
-
187
- /**
188
- * Retrieves the attributes for a given type.
189
- *
190
- * @param {String} typeName The type to get the attributes for
191
- * @returns {Array} An array of attributes for the supplied type
192
- */
193
- function getStandardTypeAttributesNames(typeName) {
194
164
  return STANDARD_TYPE_NAMES.get(typeName) || [];
195
165
  }
196
166
 
@@ -199,7 +169,6 @@ function getStandardTypeAttributesNames(typeName) {
199
169
  */
200
170
  export default class DatatableTypes {
201
171
  privateCustomTypes = new Map();
202
- isValidTypeForTree = isValidTypeForTree;
203
172
 
204
173
  constructor(types) {
205
174
  if (typeof types === 'object' && types !== null) {
@@ -296,4 +265,14 @@ export default class DatatableTypes {
296
265
  const privateType = this.privateCustomTypes.get(typeName);
297
266
  return privateType ? privateType.standardCellLayout : false;
298
267
  }
268
+
269
+ /**
270
+ * Determines if a supplied type is valid for a tree type datatable.
271
+ *
272
+ * @param {String} typeName The type to validate
273
+ * @returns {Boolean} Whether the supplied type is valid for a tree
274
+ */
275
+ isValidTypeForTree(typeName) {
276
+ return TREE_SUPPORTED_TYPES.has(typeName);
277
+ }
299
278
  }