lightning-base-components 1.21.1-alpha → 1.21.3-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.
- package/metadata/raptor.json +88 -1
- package/package.json +181 -2
- package/scopedImports/@salesforce-label-LightningRichTextEditor.colorPicker.js +1 -0
- package/src/lightning/accordion/accordion-section.slds.css +122 -0
- package/src/lightning/accordion/accordion.css +2 -16
- package/src/lightning/accordion/accordion.js +10 -7
- package/src/lightning/accordion/accordion.js-meta.xml +3 -0
- package/src/lightning/accordion/accordion.lbc.native.css +4 -0
- package/src/lightning/accordion/accordion.lbc.synthetic.css +13 -0
- package/src/lightning/accordion/accordion.slds.css +1 -656
- package/src/lightning/accordionSection/accordion-section.slds.css +31 -564
- package/src/lightning/accordionSection/accordionSection.css +2 -17
- package/src/lightning/accordionSection/accordionSection.js +29 -17
- package/src/lightning/accordionSection/accordionSection.js-meta.xml +3 -0
- package/src/lightning/accordionSection/accordionSection.lbc.native.css +5 -0
- package/src/lightning/accordionSection/accordionSection.lbc.synthetic.css +14 -0
- package/src/lightning/accordionSection/button.slds.css +503 -0
- package/src/lightning/alert/alert.css +1 -0
- package/src/lightning/alert/alert.js +12 -9
- package/src/lightning/alert/alert.js-meta.xml +3 -0
- package/src/lightning/alert/alert.lbc.native.css +1 -0
- package/src/lightning/ariaObserver/ariaObserver.js +111 -46
- package/src/lightning/avatar/avatar.css +1 -2
- package/src/lightning/avatar/avatar.html +19 -5
- package/src/lightning/avatar/avatar.js +18 -3
- package/src/lightning/avatar/avatar.js-meta.xml +3 -0
- package/src/lightning/avatar/avatar.lbc.native.css +2 -0
- package/src/lightning/avatar/avatar.slds.css +34 -205
- package/src/lightning/badge/__examples__/basic/basic.html +3 -1
- package/src/lightning/badge/badge.css +1 -0
- package/src/lightning/badge/badge.html +16 -14
- package/src/lightning/badge/badge.js +5 -2
- package/src/lightning/badge/badge.js-meta.xml +3 -0
- package/src/lightning/badge/badge.lbc.native.css +2 -0
- package/src/lightning/badge/badge.slds.css +76 -0
- package/src/lightning/baseCombobox/base-combobox.slds.css +108 -1435
- package/src/lightning/baseCombobox/baseCombobox.css +2 -27
- package/src/lightning/baseCombobox/baseCombobox.html +2 -2
- package/src/lightning/baseCombobox/baseCombobox.js +17 -4
- package/src/lightning/baseCombobox/baseCombobox.js-meta.xml +6 -0
- package/src/lightning/baseCombobox/baseCombobox.lbc.native.css +7 -0
- package/src/lightning/baseCombobox/baseCombobox.lbc.synthetic.css +25 -0
- package/src/lightning/baseCombobox/dropdown.slds.css +594 -0
- package/src/lightning/baseCombobox/input-text.slds.css +506 -0
- package/src/lightning/baseCombobox/keyboard.js +12 -4
- package/src/lightning/baseCombobox/listbox.slds.css +204 -0
- package/src/lightning/baseCombobox/spinner.slds.css +429 -0
- package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js +3 -2
- package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js-meta.xml +6 -0
- package/src/lightning/baseComboboxItem/baseComboboxItem.js +14 -8
- package/src/lightning/baseComboboxItem/baseComboboxItem.js-meta.xml +6 -0
- package/src/lightning/baseComboboxItem/card.css +1 -0
- package/src/lightning/baseComboboxItem/card.lbc.native.css +2 -0
- package/src/lightning/baseComboboxItem/inline.css +1 -2
- package/src/lightning/baseComboboxItem/inline.lbc.native.css +2 -0
- package/src/lightning/baseComboboxItem/listbox.slds.css +103 -151
- package/src/lightning/baseFormattedText/baseFormattedText.js +2 -2
- package/src/lightning/breadcrumb/breadcrumb.css +2 -6
- package/src/lightning/breadcrumb/breadcrumb.js +4 -2
- package/src/lightning/breadcrumb/breadcrumb.js-meta.xml +3 -0
- package/src/lightning/breadcrumb/breadcrumb.lbc.native.css +1 -0
- package/src/lightning/breadcrumb/breadcrumb.lbc.synthetic.css +3 -0
- package/src/lightning/breadcrumb/breadcrumb.slds.css +4 -6
- package/src/lightning/breadcrumbs/breadcrumbs.css +2 -10
- package/src/lightning/breadcrumbs/breadcrumbs.js +3 -2
- package/src/lightning/breadcrumbs/breadcrumbs.js-meta.xml +3 -0
- package/src/lightning/breadcrumbs/breadcrumbs.lbc.native.css +2 -0
- package/src/lightning/breadcrumbs/breadcrumbs.lbc.synthetic.css +7 -0
- package/src/lightning/breadcrumbs/breadcrumbs.slds.css +7 -5
- package/src/lightning/button/button.css +1 -2
- package/src/lightning/button/button.js +2 -1
- package/src/lightning/button/button.js-meta.xml +3 -0
- package/src/lightning/button/button.lbc.native.css +2 -0
- package/src/lightning/button/button.slds.css +365 -395
- package/src/lightning/buttonGroup/button-group.slds.css +37 -35
- package/src/lightning/buttonGroup/buttonGroup.css +2 -11
- package/src/lightning/buttonGroup/buttonGroup.js +5 -2
- package/src/lightning/buttonGroup/buttonGroup.js-meta.xml +3 -0
- package/src/lightning/buttonGroup/buttonGroup.lbc.native.css +2 -0
- package/src/lightning/buttonGroup/buttonGroup.lbc.synthetic.css +3 -0
- package/src/lightning/buttonIcon/button-icon.slds.css +575 -766
- package/src/lightning/buttonIcon/buttonIcon.css +2 -2
- package/src/lightning/buttonIcon/buttonIcon.js +8 -2
- package/src/lightning/buttonIcon/buttonIcon.js-meta.xml +3 -0
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +23 -976
- package/src/lightning/buttonIconStateful/button-icon.slds.css +724 -0
- package/src/lightning/buttonIconStateful/button.slds.css +503 -0
- package/src/lightning/buttonIconStateful/buttonIconStateful.css +2 -6
- package/src/lightning/buttonIconStateful/buttonIconStateful.js +54 -0
- package/src/lightning/buttonIconStateful/buttonIconStateful.js-meta.xml +3 -0
- package/src/lightning/buttonIconStateful/buttonIconStateful.lbc.native.css +4 -0
- package/src/lightning/buttonIconStateful/buttonIconStateful.lbc.synthetic.css +3 -0
- package/src/lightning/buttonMenu/button-icon.slds.css +724 -0
- package/src/lightning/buttonMenu/button-menu.slds.css +44 -1882
- package/src/lightning/buttonMenu/button.slds.css +503 -0
- package/src/lightning/buttonMenu/buttonMenu.css +1 -2
- package/src/lightning/buttonMenu/buttonMenu.js +8 -4
- package/src/lightning/buttonMenu/buttonMenu.js-meta.xml +3 -0
- package/src/lightning/buttonMenu/buttonMenu.lbc.native.css +5 -0
- package/src/lightning/buttonMenu/dropdown.slds.css +594 -0
- package/src/lightning/buttonStateful/button-stateful.slds.css +8 -747
- package/src/lightning/buttonStateful/button.slds.css +503 -0
- package/src/lightning/buttonStateful/buttonStateful.css +1 -2
- package/src/lightning/buttonStateful/buttonStateful.js +7 -3
- package/src/lightning/buttonStateful/buttonStateful.lbc.native.css +3 -0
- package/src/lightning/calendar/calendar.css +2 -11
- package/src/lightning/calendar/calendar.js +4 -2
- package/src/lightning/calendar/calendar.js-meta.xml +6 -0
- package/src/lightning/calendar/calendar.lbc.native.css +11 -0
- package/src/lightning/calendar/calendar.lbc.synthetic.css +8 -0
- package/src/lightning/calendar/calendar.slds.css +42 -1850
- package/src/lightning/calendar/dropdown.slds.css +594 -0
- package/src/lightning/card/card.css +1 -2
- package/src/lightning/card/card.js +3 -2
- package/src/lightning/card/card.lbc.native.css +2 -0
- package/src/lightning/card/card.slds.css +119 -176
- package/src/lightning/carousel/carousel.css +1 -7
- package/src/lightning/carousel/carousel.lbc.synthetic.css +7 -0
- package/src/lightning/colorPickerCustom/color-picker-custom.slds.css +56 -281
- package/src/lightning/colorPickerCustom/colorPickerCustom.css +1 -2
- package/src/lightning/colorPickerCustom/colorPickerCustom.js +3 -2
- package/src/lightning/colorPickerCustom/colorPickerCustom.lbc.native.css +3 -0
- package/src/lightning/colorPickerCustom/input-text.slds.css +506 -0
- package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +11 -783
- package/src/lightning/colorPickerPanel/colorPickerPanel.css +2 -12
- package/src/lightning/colorPickerPanel/colorPickerPanel.js +4 -2
- package/src/lightning/colorPickerPanel/colorPickerPanel.lbc.native.css +3 -0
- package/src/lightning/colorPickerPanel/colorPickerPanel.lbc.synthetic.css +8 -0
- package/src/lightning/colorPickerPanel/popover.slds.css +29 -32
- package/src/lightning/combobox/combobox.css +2 -19
- package/src/lightning/combobox/combobox.html +4 -1
- package/src/lightning/combobox/combobox.js +20 -3
- package/src/lightning/combobox/combobox.js-meta.xml +3 -0
- package/src/lightning/combobox/combobox.lbc.native.css +3 -0
- package/src/lightning/combobox/combobox.lbc.synthetic.css +28 -0
- package/src/lightning/combobox/combobox.slds.css +3 -4
- package/src/lightning/combobox/form-element.slds.css +122 -95
- package/src/lightning/configProvider/defaultDurationConfig.js +1 -1
- package/src/lightning/confirm/confirm.css +1 -0
- package/src/lightning/confirm/confirm.js +12 -9
- package/src/lightning/confirm/confirm.js-meta.xml +3 -0
- package/src/lightning/confirm/confirm.lbc.native.css +1 -0
- package/src/lightning/datatable/__examples__/customDatatableWrapper/customDatatableWrapper.js +0 -69
- package/src/lightning/datatable/__examples__/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +1 -1
- package/src/lightning/datatable/__examples__/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.js +1 -16
- package/src/lightning/datatable/__examples__/customDatatypeLink/customDatatypeLink.html +3 -3
- package/src/lightning/datatable/__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html +1 -8
- package/src/lightning/datatable/__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +2 -39
- package/src/lightning/datatable/__examples__/customDatatypeTable/customLink.html +5 -7
- package/src/lightning/datatable/__examples__/customDatatypeTable/customNumber.html +1 -1
- package/src/lightning/datatable/__examples__/customDatatypeTable/customNumberEdit.html +2 -0
- package/src/lightning/datatable/__examples__/customDatatypeTable/deleteRow.html +3 -2
- package/src/lightning/datatable/__examples__/customDatatypeTable/iconPill.html +1 -1
- package/src/lightning/datatable/__examples__/customNestedComponent/customNestedComponent.html +10 -0
- package/src/lightning/datatable/__examples__/customNestedComponent/customNestedComponent.js +12 -0
- package/src/lightning/datatable/autoWidthStrategy.js +147 -191
- package/src/lightning/datatable/columnResizer.js +35 -35
- package/src/lightning/datatable/columnWidthManager.js +118 -177
- package/src/lightning/datatable/columns.js +90 -59
- package/src/lightning/datatable/datagrid.slds.css +187 -0
- package/src/lightning/datatable/datatable.js +248 -229
- package/src/lightning/datatable/errors.js +3 -0
- package/src/lightning/datatable/fixedWidthStrategy.js +22 -29
- package/src/lightning/datatable/headerActions.js +7 -9
- package/src/lightning/datatable/infiniteLoading.js +15 -15
- package/src/lightning/datatable/inlineEdit.js +255 -235
- package/src/lightning/datatable/keyboard.js +318 -282
- package/src/lightning/datatable/renderManager.js +10 -7
- package/src/lightning/datatable/resizeObserver.js +11 -59
- package/src/lightning/datatable/rowLevelActions.js +6 -5
- package/src/lightning/datatable/rowNumber.js +23 -23
- package/src/lightning/datatable/rowSelection.js +173 -145
- package/src/lightning/datatable/rowSelectionShared.js +13 -6
- package/src/lightning/datatable/rows.js +231 -196
- package/src/lightning/datatable/sort.js +26 -22
- package/src/lightning/datatable/templates/div/div.css +2 -57
- package/src/lightning/datatable/templates/div/div.html +13 -6
- package/src/lightning/datatable/templates/div/div.lbc.native.css +3 -0
- package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +86 -0
- package/src/lightning/datatable/templates/table/table.html +1 -0
- package/src/lightning/datatable/utils.js +5 -5
- package/src/lightning/datatable/widthManagerShared.js +24 -21
- package/src/lightning/datatable/wrapText.js +25 -26
- package/src/lightning/datepicker/datepicker.css +1 -3
- package/src/lightning/datepicker/datepicker.js +47 -17
- package/src/lightning/datepicker/datepicker.js-meta.xml +6 -0
- package/src/lightning/datepicker/datepicker.lbc.native.css +3 -0
- package/src/lightning/datepicker/form-element.slds.css +122 -95
- package/src/lightning/datepicker/input-text.slds.css +289 -181
- package/src/lightning/datetimepicker/datetimepicker.css +1 -3
- package/src/lightning/datetimepicker/datetimepicker.html +0 -2
- package/src/lightning/datetimepicker/datetimepicker.js +35 -10
- package/src/lightning/datetimepicker/datetimepicker.js-meta.xml +6 -0
- package/src/lightning/datetimepicker/datetimepicker.lbc.native.css +3 -0
- package/src/lightning/datetimepicker/form-element.slds.css +122 -95
- package/src/lightning/datetimepicker/input-text.slds.css +289 -181
- package/src/lightning/dualListbox/dual-listbox.slds.css +34 -29
- package/src/lightning/dualListbox/dualListbox.css +2 -8
- package/src/lightning/dualListbox/dualListbox.js +55 -36
- package/src/lightning/dualListbox/dualListbox.js-meta.xml +3 -0
- package/src/lightning/dualListbox/dualListbox.lbc.native.css +4 -0
- package/src/lightning/dualListbox/dualListbox.lbc.synthetic.css +3 -0
- package/src/lightning/dualListbox/form-element.slds.css +122 -95
- package/src/lightning/dualListbox/listbox.slds.css +103 -151
- package/src/lightning/dynamicIcon/dynamic-icon-strength.slds.css +1 -2
- package/src/lightning/dynamicIcon/dynamic-icon-trend.slds.css +1 -2
- package/src/lightning/dynamicIcon/dynamicIcon.js +3 -2
- package/src/lightning/dynamicIcon/dynamicIcon.js-meta.xml +3 -0
- package/src/lightning/dynamicIcon/ellie.css +1 -1
- package/src/lightning/dynamicIcon/ellie.lbc.native.css +1 -0
- package/src/lightning/dynamicIcon/eq.css +1 -1
- package/src/lightning/dynamicIcon/eq.lbc.native.css +1 -0
- package/src/lightning/dynamicIcon/score.css +1 -1
- package/src/lightning/dynamicIcon/score.lbc.native.css +1 -0
- package/src/lightning/dynamicIcon/strength.css +1 -1
- package/src/lightning/dynamicIcon/strength.lbc.native.css +1 -0
- package/src/lightning/dynamicIcon/trend.css +1 -1
- package/src/lightning/dynamicIcon/trend.lbc.native.css +1 -0
- package/src/lightning/dynamicIcon/waffle.css +1 -1
- package/src/lightning/dynamicIcon/waffle.lbc.native.css +1 -0
- package/src/lightning/focusTrap/focusTrap.js +3 -2
- package/src/lightning/focusTrap/focusTrap.js-meta.xml +3 -0
- package/src/lightning/formattedAddress/formattedAddress.js-meta.xml +3 -0
- package/src/lightning/formattedDateTime/formattedDateTime.js +7 -62
- package/src/lightning/formattedDateTime/formattedDateTime.js-meta.xml +3 -0
- package/src/lightning/formattedEmail/formattedEmail.css +1 -0
- package/src/lightning/formattedEmail/formattedEmail.js +4 -2
- package/src/lightning/formattedEmail/formattedEmail.js-meta.xml +3 -0
- package/src/lightning/formattedEmail/formattedEmail.lbc.native.css +7 -0
- package/src/lightning/formattedLocation/formattedLocation.html +1 -3
- package/src/lightning/formattedLocation/formattedLocation.js +3 -25
- package/src/lightning/formattedLocation/formattedLocation.js-meta.xml +3 -0
- package/src/lightning/formattedLookup/events.js +2 -4
- package/src/lightning/formattedNumber/formattedNumber.css +1 -4
- package/src/lightning/formattedNumber/formattedNumber.js +2 -49
- package/src/lightning/formattedNumber/formattedNumber.lbc.synthetic.css +4 -0
- package/src/lightning/formattedPhone/formattedPhone.css +1 -4
- package/src/lightning/formattedPhone/formattedPhone.js-meta.xml +3 -0
- package/src/lightning/formattedPhone/formattedPhone.lbc.synthetic.css +4 -0
- package/src/lightning/formattedRichText/formatted-rich-text.slds.css +39 -39
- package/src/lightning/formattedRichText/formattedRichText.css +1 -3
- package/src/lightning/formattedRichText/formattedRichText.js +9 -7
- package/src/lightning/formattedRichText/formattedRichText.js-meta.xml +3 -0
- package/src/lightning/formattedRichText/formattedRichText.lbc.native.css +3 -0
- package/src/lightning/formattedRichText/linkTextNodes.js +58 -0
- package/src/lightning/formattedText/formattedText.css +1 -1
- package/src/lightning/formattedText/formattedText.js +3 -2
- package/src/lightning/formattedText/formattedText.js-meta.xml +3 -0
- package/src/lightning/formattedText/formattedText.lbc.native.css +1 -0
- package/src/lightning/formattedTime/formattedTime.js-meta.xml +3 -0
- package/src/lightning/formattedUrl/formattedUrl.js-meta.xml +3 -0
- package/src/lightning/groupedCombobox/__mockData__/exampleGroupedComboboxData.js +17 -0
- package/src/lightning/groupedCombobox/form-element.slds.css +315 -0
- package/src/lightning/groupedCombobox/grouped-combobox.slds.css +13 -0
- package/src/lightning/groupedCombobox/groupedCombobox.css +2 -3
- package/src/lightning/groupedCombobox/groupedCombobox.js +25 -3
- package/src/lightning/groupedCombobox/groupedCombobox.js-meta.xml +4 -1
- package/src/lightning/groupedCombobox/groupedCombobox.lbc.native.css +5 -0
- package/src/lightning/groupedCombobox/groupedCombobox.lbc.syhtnetic.css +3 -0
- package/src/lightning/groupedCombobox/input-text.slds.css +506 -0
- package/src/lightning/helptext/button-icon.slds.css +724 -0
- package/src/lightning/helptext/form-element.slds.css +122 -95
- package/src/lightning/helptext/help-text.slds.css +6 -938
- package/src/lightning/helptext/helptext.css +1 -3
- package/src/lightning/helptext/helptext.js +3 -2
- package/src/lightning/helptext/helptext.lbc.native.css +4 -0
- package/src/lightning/icon/icon.css +1 -2
- package/src/lightning/icon/icon.js +20 -2
- package/src/lightning/icon/icon.js-meta.xml +3 -0
- package/src/lightning/icon/icon.lbc.native.css +2 -0
- package/src/lightning/icon/icon.slds.css +76 -78
- package/src/lightning/input/form-element.slds.css +122 -95
- package/src/lightning/input/input.css +2 -13
- package/src/lightning/input/input.html +1 -0
- package/src/lightning/input/input.js +55 -9
- package/src/lightning/input/input.lbc.native.css +2 -0
- package/src/lightning/input/input.lbc.synthetic.css +9 -0
- package/src/lightning/inputAddress/form-element.slds.css +315 -0
- package/src/lightning/inputAddress/input-address.slds.css +14 -0
- package/src/lightning/inputAddress/input-text.slds.css +506 -0
- package/src/lightning/inputAddress/inputAddress.css +2 -3
- package/src/lightning/inputAddress/inputAddress.html +21 -12
- package/src/lightning/inputAddress/inputAddress.js +34 -14
- package/src/lightning/inputAddress/inputAddress.js-meta.xml +3 -0
- package/src/lightning/inputAddress/inputAddress.lbc.native.css +5 -0
- package/src/lightning/inputAddress/inputAddress.lbc.synthetic.css +4 -0
- package/src/lightning/inputLocation/form-element.slds.css +315 -0
- package/src/lightning/inputLocation/input-location.slds.css +14 -0
- package/src/lightning/inputLocation/input-text.slds.css +506 -0
- package/src/lightning/inputLocation/inputLocation.css +2 -3
- package/src/lightning/inputLocation/inputLocation.html +1 -1
- package/src/lightning/inputLocation/inputLocation.js +27 -6
- package/src/lightning/inputLocation/inputLocation.js-meta.xml +3 -0
- package/src/lightning/inputLocation/inputLocation.lbc.native.css +5 -0
- package/src/lightning/inputLocation/inputLocation.lbc.synthetic.css +3 -0
- package/src/lightning/inputName/form-element.slds.css +315 -0
- package/src/lightning/inputName/input-text.slds.css +506 -0
- package/src/lightning/inputName/inputName.css +2 -3
- package/src/lightning/inputName/inputName.js +22 -15
- package/src/lightning/inputName/inputName.lbc.native.css +4 -0
- package/src/lightning/inputName/inputName.lbc.synthetic.css +3 -0
- package/src/lightning/interactiveDialogBase/interactive-dialog-base.slds.css +21 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.css +2 -520
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.html +8 -3
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js +6 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js-meta.xml +6 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.lbc.native.css +3 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.lbc.synthetic.css +20 -0
- package/src/lightning/internationalizationLibrary/datetime/dateTimeUtils.js +33 -10
- package/src/lightning/layout/layout.css +2 -9
- package/src/lightning/layout/layout.js +5 -2
- package/src/lightning/layout/layout.js-meta.xml +3 -0
- package/src/lightning/layout/layout.lbc.native.css +2 -0
- package/src/lightning/layout/layout.lbc.synthetic.css +6 -0
- package/src/lightning/layoutItem/layoutItem.css +1 -5
- package/src/lightning/layoutItem/layoutItem.js +5 -2
- package/src/lightning/layoutItem/layoutItem.js-meta.xml +3 -0
- package/src/lightning/layoutItem/layoutItem.lbc.native.css +5 -0
- package/src/lightning/lookupAddress/form-element.slds.css +315 -0
- package/src/lightning/lookupAddress/listbox.slds.css +204 -0
- package/src/lightning/lookupAddress/location.js +2 -0
- package/src/lightning/lookupAddress/lookup-address.slds.css +8 -0
- package/src/lightning/lookupAddress/lookupAddress.css +2 -0
- package/src/lightning/lookupAddress/lookupAddress.html +12 -9
- package/src/lightning/lookupAddress/lookupAddress.js +19 -12
- package/src/lightning/lookupAddress/lookupAddress.lbc.native.css +4 -0
- package/src/lightning/menuDivider/menu-divider.slds.css +4 -6
- package/src/lightning/menuDivider/menuDivider.css +2 -6
- package/src/lightning/menuDivider/menuDivider.js +4 -3
- package/src/lightning/menuDivider/menuDivider.lbc.native.css +2 -0
- package/src/lightning/menuDivider/menuDivider.lbc.synthetic.css +3 -0
- package/src/lightning/menuItem/menu-item.slds.css +24 -18
- package/src/lightning/menuItem/menuItem.css +2 -6
- package/src/lightning/menuItem/menuItem.js +13 -3
- package/src/lightning/menuItem/menuItem.js-meta.xml +3 -0
- package/src/lightning/menuItem/menuItem.lbc.native.css +2 -0
- package/src/lightning/menuItem/menuItem.lbc.synthetic.css +3 -0
- package/src/lightning/menuSubheader/menu-subheader.slds.css +5 -6
- package/src/lightning/menuSubheader/menuSubheader.css +2 -6
- package/src/lightning/menuSubheader/menuSubheader.js +4 -2
- package/src/lightning/menuSubheader/menuSubheader.lbc.native.css +2 -0
- package/src/lightning/menuSubheader/menuSubheader.lbc.synthetic.css +3 -0
- package/src/lightning/modal/__docs__/modal.md +30 -0
- package/src/lightning/modal/__examples__disabled/allformfullcompound/allformfullcompound.css +7 -0
- package/src/lightning/modal/__examples__disabled/allformfullcompound/allformfullcompound.html +9 -0
- package/src/lightning/modal/__examples__disabled/allformfullcompound/allformfullcompound.js +54 -0
- package/src/lightning/modal/__examples__disabled/allformhoriz/allformhoriz.css +7 -0
- package/src/lightning/modal/__examples__disabled/allformhoriz/allformhoriz.html +9 -0
- package/src/lightning/modal/__examples__disabled/allformhoriz/allformhoriz.js +53 -0
- package/src/lightning/modal/__examples__disabled/allmulti/allmulti.html +1 -0
- package/src/lightning/modal/__examples__disabled/allmulti/allmulti.js +43 -1
- package/src/lightning/modal/__examples__disabled/basic/basic.css +1 -1
- package/src/lightning/modal/__examples__disabled/demo/demo.css +1 -0
- package/src/lightning/modal/__examples__disabled/demoall/demoall.css +5 -0
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.css +2 -3
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.html +181 -107
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.js +7 -1
- package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.css +2 -3
- package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.html +181 -107
- package/src/lightning/modal/__examples__disabled/demoallformfullcompound/demoallformfullcompound.css +7 -0
- package/src/lightning/modal/__examples__disabled/demoallformfullcompound/demoallformfullcompound.html +109 -0
- package/src/lightning/modal/__examples__disabled/demoallformfullcompound/demoallformfullcompound.js +241 -0
- package/src/lightning/modal/__examples__disabled/demoallformhoriz/demoallformhoriz.css +5 -0
- package/src/lightning/modal/__examples__disabled/demoallformhoriz/demoallformhoriz.html +165 -0
- package/src/lightning/modal/__examples__disabled/demoallformhoriz/demoallformhoriz.js +241 -0
- package/src/lightning/modal/__examples__disabled/demofootless/demofootless.css +1 -0
- package/src/lightning/modal/__examples__disabled/demoheadless/demoheadless.css +5 -0
- package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +8 -0
- package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +108 -3
- package/src/lightning/modalBase/modal-base.slds.css +242 -0
- package/src/lightning/modalBase/modalBase.css +2 -16
- package/src/lightning/modalBase/modalBase.html +2 -0
- package/src/lightning/modalBase/modalBase.js +158 -18
- package/src/lightning/modalBase/modalBase.js-meta.xml +6 -0
- package/src/lightning/modalBase/modalBase.lbc.native.css +2 -0
- package/src/lightning/modalBase/modalBase.lbc.synthetic.css +18 -0
- package/src/lightning/modalBody/modal-body.slds.css +60 -0
- package/src/lightning/modalBody/modalBody.css +1 -0
- package/src/lightning/modalBody/modalBody.html +1 -0
- package/src/lightning/modalBody/modalBody.js +15 -2
- package/src/lightning/modalBody/modalBody.lbc.native.css +3 -0
- package/src/lightning/modalFooter/modal-footer.slds.css +79 -0
- package/src/lightning/modalFooter/modalFooter.css +1 -0
- package/src/lightning/modalFooter/modalFooter.html +1 -1
- package/src/lightning/modalFooter/modalFooter.js +3 -23
- package/src/lightning/modalFooter/modalFooter.lbc.native.css +2 -0
- package/src/lightning/modalHeader/modal-header.slds.css +76 -0
- package/src/lightning/modalHeader/modalHeader.css +3 -0
- package/src/lightning/modalHeader/modalHeader.html +1 -1
- package/src/lightning/modalHeader/modalHeader.js +4 -24
- package/src/lightning/modalHeader/modalHeader.lbc.native.css +3 -0
- package/src/lightning/overlay/overlay.js +11 -4
- package/src/lightning/overlay/overlay.js-meta.xml +6 -0
- package/src/lightning/overlayContainer/overlayContainer.js +3 -2
- package/src/lightning/picklist/picklist.js +24 -19
- package/src/lightning/picklist/picklist.js-meta.xml +3 -0
- package/src/lightning/pill/avatar.slds.css +34 -205
- package/src/lightning/pill/link.css +1 -3
- package/src/lightning/pill/link.lbc.native.css +3 -0
- package/src/lightning/pill/pill.js +4 -2
- package/src/lightning/pill/pill.js-meta.xml +3 -0
- package/src/lightning/pill/pill.slds.css +82 -103
- package/src/lightning/pill/plain.css +1 -3
- package/src/lightning/pill/plain.lbc.native.css +3 -0
- package/src/lightning/pill/plainLink.css +1 -3
- package/src/lightning/pill/plainLink.lbc.native.css +3 -0
- package/src/lightning/pillContainer/barePillContainer.css +1 -3
- package/src/lightning/pillContainer/barePillContainer.html +1 -1
- package/src/lightning/pillContainer/barePillContainer.lbc.native.css +4 -0
- package/src/lightning/pillContainer/button.slds.css +503 -0
- package/src/lightning/pillContainer/listbox.slds.css +103 -151
- package/src/lightning/pillContainer/pill-container.slds.css +19 -17
- package/src/lightning/pillContainer/pill.slds.css +82 -103
- package/src/lightning/pillContainer/pillContainer.js +15 -12
- package/src/lightning/pillContainer/pillContainer.js-meta.xml +3 -0
- package/src/lightning/pillContainer/standardPillContainer.css +3 -2
- package/src/lightning/pillContainer/standardPillContainer.html +1 -1
- package/src/lightning/popup/popover.slds.css +29 -32
- package/src/lightning/popup/popup.css +1 -2
- package/src/lightning/popup/popup.js +3 -2
- package/src/lightning/popup/popup.js-meta.xml +3 -0
- package/src/lightning/popup/popup.lbc.native.css +2 -0
- package/src/lightning/primitiveBubble/primitiveBubble.css +2 -11
- package/src/lightning/primitiveBubble/primitiveBubble.js +4 -2
- package/src/lightning/primitiveBubble/primitiveBubble.js-meta.xml +6 -0
- package/src/lightning/primitiveBubble/primitiveBubble.lbc.native.css +2 -0
- package/src/lightning/primitiveBubble/primitiveBubble.lbc.synthetic.css +8 -0
- package/src/lightning/primitiveBubble/tooltip.slds.css +89 -142
- package/src/lightning/primitiveButton/primitiveButoon.js-meta.xml +6 -0
- package/src/lightning/primitiveButton/primitiveButton.js +4 -2
- package/src/lightning/primitiveCellCheckbox/checkbox.css +2 -0
- package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +18 -249
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.css +1 -2
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +3 -2
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.lbc.native.css +2 -0
- package/src/lightning/primitiveCustomCell/primitiveCustomCell.js +26 -2
- package/src/lightning/primitiveDatatableCell/primitiveDatatableCell.js +1 -3
- package/src/lightning/primitiveFileDroppableZone/primitiveFileDroppableZone.js +17 -7
- package/src/lightning/primitiveHeaderFactory/nonsortableHeader.css +1 -0
- package/src/lightning/primitiveHeaderFactory/selectableHeader.css +2 -0
- package/src/lightning/primitiveIcon/icon.slds.css +76 -78
- package/src/lightning/primitiveIcon/primitiveIcon.css +2 -11
- package/src/lightning/primitiveIcon/primitiveIcon.js +7 -9
- package/src/lightning/primitiveIcon/primitiveIcon.js-meta.xml +6 -0
- package/src/lightning/primitiveIcon/primitiveIcon.lbc.native.css +2 -0
- package/src/lightning/primitiveIcon/primitiveIcon.lbc.synthetic.css +9 -0
- package/src/lightning/primitiveIframe/primitiveIframe.html +9 -8
- package/src/lightning/primitiveIframe/primitiveIframe.js +7 -3
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +223 -237
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.css +1 -3
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +14 -3
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js-meta.xml +6 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.lbc.native.css +3 -0
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +36 -34
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.css +2 -6
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +5 -2
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js-meta.xml +6 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.lbc.native.css +2 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.lbc.synthetic.css +2 -0
- package/src/lightning/primitiveInputColor/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputColor/input-color.slds.css +5 -10
- package/src/lightning/primitiveInputColor/input-text.slds.css +289 -181
- package/src/lightning/primitiveInputColor/primitiveInputColor.css +1 -4
- package/src/lightning/primitiveInputColor/primitiveInputColor.js +5 -2
- package/src/lightning/primitiveInputColor/primitiveInputColor.js-meta.xml +6 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.lbc.native.css +4 -0
- package/src/lightning/primitiveInputFile/button.slds.css +365 -395
- package/src/lightning/primitiveInputFile/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputFile/input-file.slds.css +13 -16
- package/src/lightning/primitiveInputFile/primitiveInputFile.css +1 -5
- package/src/lightning/primitiveInputFile/primitiveInputFile.js +13 -9
- package/src/lightning/primitiveInputFile/primitiveInputFile.js-meta.xml +6 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.lbc.native.css +4 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +4 -2
- package/src/lightning/primitiveInputSimple/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputSimple/input-text.slds.css +289 -181
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.css +2 -9
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +4 -2
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js-meta.xml +6 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.lbc.native.css +3 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.lbc.synthetic.css +5 -0
- package/src/lightning/primitiveInputToggle/form-element.slds.css +122 -95
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +78 -55
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.css +1 -3
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +14 -3
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js-meta.xml +6 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.lbc.native.css +3 -0
- package/src/lightning/progressBar/progress-bar.slds.css +64 -0
- package/src/lightning/progressBar/progressBar.css +1 -0
- package/src/lightning/progressBar/progressBar.html +1 -0
- package/src/lightning/progressBar/progressBar.js +3 -2
- package/src/lightning/progressBar/progressBar.lbc.native.css +2 -0
- package/src/lightning/progressIndicator/progressIndicator.css +1 -3
- package/src/lightning/progressIndicator/progressIndicator.lbc.synthetic.css +3 -0
- package/src/lightning/progressRing/progress-ring.slds.css +113 -0
- package/src/lightning/progressRing/progressRing.css +1 -0
- package/src/lightning/progressRing/progressRing.html +1 -1
- package/src/lightning/progressRing/progressRing.js +3 -2
- package/src/lightning/progressRing/progressRing.lbc.native.css +2 -0
- package/src/lightning/progressStep/progressStep.js +1 -14
- package/src/lightning/prompt/prompt.css +1 -85
- package/src/lightning/prompt/prompt.html +15 -5
- package/src/lightning/prompt/prompt.js +12 -9
- package/src/lightning/prompt/prompt.js-meta.xml +3 -0
- package/src/lightning/prompt/prompt.lbc.native.css +2 -0
- package/src/lightning/prompt/prompt.slds.css +10 -0
- package/src/lightning/radioGroup/form-element.slds.css +315 -0
- package/src/lightning/radioGroup/input-radio-group.slds.css +124 -571
- package/src/lightning/radioGroup/radioGroup.css +2 -7
- package/src/lightning/radioGroup/radioGroup.html +1 -2
- package/src/lightning/radioGroup/radioGroup.js +5 -2
- package/src/lightning/radioGroup/radioGroup.lbc.native.css +3 -0
- package/src/lightning/radioGroup/radioGroup.lbc.synthetic.css +3 -0
- package/src/lightning/routingService/routingService.js +31 -5
- package/src/lightning/select/form-element.slds.css +122 -95
- package/src/lightning/select/select.css +1 -3
- package/src/lightning/select/select.js +4 -2
- package/src/lightning/select/select.js-meta.xml +3 -0
- package/src/lightning/select/select.lbc.native.css +3 -0
- package/src/lightning/select/select.slds.css +26 -343
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +27 -11
- package/src/lightning/sldsUtilsVisibility/sldsUtilsVisibility.css +24 -0
- package/src/lightning/sldsUtilsVisibility/sldsUtilsVisibility.js-meta.xml +4 -0
- package/src/lightning/spinner/spinner.css +1 -2
- package/src/lightning/spinner/spinner.js +6 -4
- package/src/lightning/spinner/spinner.js-meta.xml +3 -0
- package/src/lightning/spinner/spinner.lbc.native.css +2 -0
- package/src/lightning/spinner/spinner.slds.css +66 -72
- package/src/lightning/staticMap/staticMap.html +12 -10
- package/src/lightning/staticMap/staticMap.js +16 -4
- package/src/lightning/tab/tab.css +1 -2
- package/src/lightning/tab/tab.js +4 -2
- package/src/lightning/tab/tab.lbc.native.css +2 -0
- package/src/lightning/tab/tab.slds.css +23 -16
- package/src/lightning/tabBar/tab-bar.slds.css +75 -65
- package/src/lightning/tabBar/tabBar.css +1 -2
- package/src/lightning/tabBar/tabBar.js +19 -2
- package/src/lightning/tabBar/tabBar.lbc.native.css +2 -0
- package/src/lightning/tabset/__docs__/tabset.md +24 -1
- package/src/lightning/tabset/tabset.css +1 -10
- package/src/lightning/tabset/tabset.html +19 -7
- package/src/lightning/tabset/tabset.js +212 -61
- package/src/lightning/tabset/tabset.lbc.native.css +3 -0
- package/src/lightning/tabset/tabset.slds.css +13 -0
- package/src/lightning/textarea/form-element.slds.css +315 -0
- package/src/lightning/textarea/textarea.css +2 -5
- package/src/lightning/textarea/textarea.html +21 -5
- package/src/lightning/textarea/textarea.js +171 -128
- package/src/lightning/textarea/textarea.lbc.native.css +3 -0
- package/src/lightning/textarea/textarea.lbc.synthetic.css +5 -0
- package/src/lightning/textarea/textarea.slds.css +108 -0
- package/src/lightning/tile/standardTile.css +1 -3
- package/src/lightning/tile/standardTile.lbc.synthetic.css +3 -0
- package/src/lightning/timepicker/form-element.slds.css +122 -95
- package/src/lightning/timepicker/timepicker.css +1 -3
- package/src/lightning/timepicker/timepicker.html +1 -1
- package/src/lightning/timepicker/timepicker.js +21 -5
- package/src/lightning/timepicker/timepicker.js-meta.xml +6 -0
- package/src/lightning/timepicker/timepicker.lbc.native.css +3 -0
- package/src/lightning/timepicker/timepicker.slds.css +2 -2
- package/src/lightning/toast/__docs__/toast.md +20 -22
- package/src/lightning/toast/button-icon.slds.css +575 -766
- package/src/lightning/toast/formatted-rich-text.slds.css +39 -39
- package/src/lightning/toast/icon.slds.css +76 -78
- package/src/lightning/toast/toast.css +2 -68
- package/src/lightning/toast/toast.js +19 -14
- package/src/lightning/toast/toast.lbc.native.css +9 -0
- package/src/lightning/toast/toast.lbc.synthetic.css +58 -0
- package/src/lightning/toast/toast.slds.css +26 -38
- package/src/lightning/toastContainer/toast.slds.css +26 -38
- package/src/lightning/toastContainer/toastContainer.css +2 -43
- package/src/lightning/toastContainer/toastContainer.js +25 -17
- package/src/lightning/toastContainer/toastContainer.lbc.native.css +4 -0
- package/src/lightning/toastContainer/toastContainer.lbc.synthetic.css +38 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +12 -9
- package/src/lightning/tree/tree.js +2 -0
- package/src/lightning/utils/classSet.js +9 -3
- package/src/lightning/utilsPrivate/animation.js +10 -8
- package/src/lightning/utilsPrivate/aria.js +1 -1
- package/src/lightning/utilsPrivate/formatUtils.js +158 -0
- package/src/lightning/utilsPrivate/textUtils.js +16 -0
- package/src/lightning/utilsPrivate/utilsPrivate.js +76 -19
- package/src/lightning/utilsPrivate/validationUtils.js +59 -0
- package/src/lightning/verticalNavigation/verticalNavigation.css +1 -3
- package/src/lightning/verticalNavigation/verticalNavigation.js +3 -2
- package/src/lightning/verticalNavigation/verticalNavigation.lbc.native.css +2 -0
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.css +1 -3
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.lbc.synthetic.css +3 -0
- package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +8 -10
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.css +2 -7
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.js +3 -2
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.lbc.native.css +2 -0
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.lbc.synthetic.css +3 -0
- package/src/lightning/datatable/resizeSensor.js +0 -244
- package/src/lightning/formattedRichText/linkify.js +0 -43
- package/src/lightning/utilsPrivate/smartSetAttribute.js +0 -19
|
@@ -5,9 +5,9 @@ import { classSet } from 'lightning/utils';
|
|
|
5
5
|
import {
|
|
6
6
|
normalizeBoolean,
|
|
7
7
|
normalizeString,
|
|
8
|
-
isIE11,
|
|
9
8
|
isSafari,
|
|
10
9
|
synchronizeAttrs,
|
|
10
|
+
classSetToString,
|
|
11
11
|
} from 'lightning/utilsPrivate';
|
|
12
12
|
import { LightningDatatableResizeObserver } from './resizeObserver';
|
|
13
13
|
import { ColumnWidthManager } from './columnWidthManager';
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
setBlurActiveCell,
|
|
62
62
|
setFocusActiveCell,
|
|
63
63
|
isActiveCell,
|
|
64
|
-
|
|
64
|
+
updateCellTabIndex,
|
|
65
65
|
getIndexesByKeys,
|
|
66
66
|
updateTabIndexActiveCell,
|
|
67
67
|
updateTabIndexActiveRow,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
updateRowNavigationMode,
|
|
70
70
|
handleDatatableFocusOut,
|
|
71
71
|
handleDatatableFocusIn,
|
|
72
|
-
|
|
72
|
+
updateRowTabIndex,
|
|
73
73
|
getIndexesActiveCell,
|
|
74
74
|
reactToKeyboardOnRow,
|
|
75
75
|
setCellToFocusFromPrev,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
refocusCellElement,
|
|
83
83
|
isCellElement,
|
|
84
84
|
getActiveCellElement,
|
|
85
|
-
|
|
85
|
+
getRowDataSelector,
|
|
86
86
|
FOCUS_CLASS,
|
|
87
87
|
updateActiveCellTabIndexAfterSync,
|
|
88
88
|
} from './keyboard';
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
import {
|
|
96
96
|
handleLoadMoreCheck,
|
|
97
97
|
isInfiniteLoadingEnabled,
|
|
98
|
-
|
|
98
|
+
setEnableInfiniteLoading,
|
|
99
99
|
getLoadMoreOffset,
|
|
100
100
|
setLoadMoreOffset,
|
|
101
101
|
isLoading,
|
|
@@ -228,10 +228,15 @@ export default class LightningDatatable extends LightningElement {
|
|
|
228
228
|
*/
|
|
229
229
|
ariaLabelledBy = null;
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Public property for passing `aria-describedby` down to the child table element.
|
|
233
|
+
*/
|
|
234
|
+
ariaDescribedBy = null;
|
|
235
|
+
|
|
231
236
|
/**
|
|
232
237
|
* Specifies how column widths are calculated. Set to 'fixed' for columns with equal widths.
|
|
233
238
|
* Set to 'auto' for column widths that are based on the width of the column content and the table width. The default is 'fixed'.
|
|
234
|
-
* @type {
|
|
239
|
+
* @type {String}
|
|
235
240
|
* @default fixed
|
|
236
241
|
*/
|
|
237
242
|
@api
|
|
@@ -240,17 +245,20 @@ export default class LightningDatatable extends LightningElement {
|
|
|
240
245
|
}
|
|
241
246
|
|
|
242
247
|
set columnWidthsMode(value) {
|
|
248
|
+
const { widthsData } = this;
|
|
243
249
|
const normalizedValue = normalizeString(value, {
|
|
244
250
|
fallbackValue: 'fixed',
|
|
245
251
|
validValues: ['fixed', 'auto'],
|
|
246
252
|
});
|
|
253
|
+
// Untracked state change.
|
|
247
254
|
this._columnWidthManager.columnWidthMode = normalizedValue;
|
|
248
|
-
|
|
249
|
-
const { state, widthsData } = this;
|
|
250
255
|
if (widthsData.columnWidthsMode !== normalizedValue) {
|
|
251
|
-
|
|
256
|
+
// Tracked state changes.
|
|
257
|
+
this._columnWidthManager.handleWidthModeChange(
|
|
258
|
+
getColumns(this.state)
|
|
259
|
+
);
|
|
252
260
|
}
|
|
253
|
-
|
|
261
|
+
// Untracked state change.
|
|
254
262
|
widthsData.columnWidthsMode = normalizedValue;
|
|
255
263
|
}
|
|
256
264
|
|
|
@@ -258,7 +266,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
258
266
|
* Array of the columns object that's used to define the data types.
|
|
259
267
|
* Required properties include 'label', 'fieldName', and 'type'. The default type is 'text'.
|
|
260
268
|
* See the Documentation tab for more information.
|
|
261
|
-
* @type {
|
|
269
|
+
* @type {Array}
|
|
262
270
|
*/
|
|
263
271
|
@api
|
|
264
272
|
get columns() {
|
|
@@ -273,7 +281,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
273
281
|
|
|
274
282
|
/**
|
|
275
283
|
* The array of data to be displayed.
|
|
276
|
-
* @type {
|
|
284
|
+
* @type {Array}
|
|
277
285
|
*/
|
|
278
286
|
@api
|
|
279
287
|
// eslint-disable-next-line @lwc/lwc/valid-api
|
|
@@ -282,19 +290,20 @@ export default class LightningDatatable extends LightningElement {
|
|
|
282
290
|
}
|
|
283
291
|
|
|
284
292
|
set data(value) {
|
|
293
|
+
const { state } = this;
|
|
294
|
+
const previousData = getData(state);
|
|
285
295
|
const data = Array.isArray(value) ? value : [];
|
|
286
296
|
|
|
287
|
-
const
|
|
288
|
-
const columns = getColumns(this.state);
|
|
297
|
+
const columns = getColumns(state);
|
|
289
298
|
this._columnWidthManager.handleDataChange(previousData, data, columns);
|
|
290
299
|
|
|
291
300
|
// set data in state
|
|
292
|
-
setData(
|
|
301
|
+
setData(state, value);
|
|
293
302
|
|
|
294
303
|
// do necessary updates since rows have changed
|
|
295
|
-
if (hasValidKeyField(
|
|
304
|
+
if (hasValidKeyField(state)) {
|
|
296
305
|
this.updateRowsState();
|
|
297
|
-
resetTableHeight(
|
|
306
|
+
resetTableHeight(state);
|
|
298
307
|
}
|
|
299
308
|
if (this._customerSelectedRows) {
|
|
300
309
|
this.setSelectedRows(this._customerSelectedRows);
|
|
@@ -305,7 +314,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
305
314
|
* Specifies the default sorting direction on an unsorted column.
|
|
306
315
|
* Valid options include 'asc' and 'desc'.
|
|
307
316
|
* The default is 'asc' for sorting in ascending order.
|
|
308
|
-
* @type {
|
|
317
|
+
* @type {String}
|
|
309
318
|
* @default asc
|
|
310
319
|
*/
|
|
311
320
|
@api
|
|
@@ -314,13 +323,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
314
323
|
}
|
|
315
324
|
|
|
316
325
|
set defaultSortDirection(value) {
|
|
317
|
-
|
|
318
|
-
|
|
326
|
+
const { state } = this;
|
|
327
|
+
setDefaultSortDirection(state, value);
|
|
328
|
+
updateSorting(state);
|
|
319
329
|
}
|
|
320
330
|
|
|
321
331
|
/**
|
|
322
332
|
* The current values per row that are provided during inline edit.
|
|
323
|
-
* @type {
|
|
333
|
+
* @type {Object}
|
|
324
334
|
*/
|
|
325
335
|
@api
|
|
326
336
|
get draftValues() {
|
|
@@ -328,21 +338,22 @@ export default class LightningDatatable extends LightningElement {
|
|
|
328
338
|
}
|
|
329
339
|
|
|
330
340
|
set draftValues(value) {
|
|
341
|
+
const { state } = this;
|
|
331
342
|
this._draftValues = value;
|
|
332
|
-
setDirtyValues(
|
|
343
|
+
setDirtyValues(state, value);
|
|
333
344
|
|
|
334
|
-
if (hasValidKeyField(
|
|
335
|
-
this.updateRowsAndCellIndexes(
|
|
345
|
+
if (hasValidKeyField(state)) {
|
|
346
|
+
this.updateRowsAndCellIndexes(state);
|
|
336
347
|
}
|
|
337
348
|
|
|
338
|
-
updateActiveCellTabIndexAfterSync(
|
|
349
|
+
updateActiveCellTabIndexAfterSync(state);
|
|
339
350
|
}
|
|
340
351
|
|
|
341
352
|
/**
|
|
342
353
|
* If present, you can load a subset of data and then display more
|
|
343
354
|
* when users scroll to the end of the table.
|
|
344
355
|
* Use with the onloadmore event handler to retrieve more data.
|
|
345
|
-
* @type {
|
|
356
|
+
* @type {Boolean}
|
|
346
357
|
* @default false
|
|
347
358
|
*/
|
|
348
359
|
@api
|
|
@@ -351,14 +362,16 @@ export default class LightningDatatable extends LightningElement {
|
|
|
351
362
|
}
|
|
352
363
|
|
|
353
364
|
set enableInfiniteLoading(value) {
|
|
354
|
-
|
|
355
|
-
|
|
365
|
+
const { state } = this;
|
|
366
|
+
// Untracked state change.
|
|
367
|
+
setEnableInfiniteLoading(state, value);
|
|
368
|
+
handlePrefetch.call(this, this.template, state);
|
|
356
369
|
}
|
|
357
370
|
|
|
358
371
|
/**
|
|
359
372
|
* Specifies an object containing information about cell level, row level, and table level errors.
|
|
360
373
|
* When it's set, error messages are displayed on the table accordingly.
|
|
361
|
-
* @type {
|
|
374
|
+
* @type {Object}
|
|
362
375
|
*/
|
|
363
376
|
@api
|
|
364
377
|
get errors() {
|
|
@@ -372,7 +385,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
372
385
|
|
|
373
386
|
/**
|
|
374
387
|
* If present, the checkbox column for row selection is hidden.
|
|
375
|
-
* @type {
|
|
388
|
+
* @type {Boolean}
|
|
376
389
|
* @default false
|
|
377
390
|
*/
|
|
378
391
|
@api
|
|
@@ -389,15 +402,15 @@ export default class LightningDatatable extends LightningElement {
|
|
|
389
402
|
normalizedValue,
|
|
390
403
|
getColumns(state)
|
|
391
404
|
);
|
|
392
|
-
|
|
393
|
-
|
|
405
|
+
// Untracked state changes.
|
|
406
|
+
state.hideCheckboxColumn = normalizedValue;
|
|
394
407
|
// update the columns metadata again to update the status.
|
|
395
408
|
this.updateColumns(this._columns);
|
|
396
409
|
}
|
|
397
410
|
|
|
398
411
|
/**
|
|
399
412
|
* If present, the table header is hidden.
|
|
400
|
-
* @type {
|
|
413
|
+
* @type {Boolean}
|
|
401
414
|
* @default false
|
|
402
415
|
*/
|
|
403
416
|
@api
|
|
@@ -406,12 +419,13 @@ export default class LightningDatatable extends LightningElement {
|
|
|
406
419
|
}
|
|
407
420
|
|
|
408
421
|
set hideTableHeader(value) {
|
|
422
|
+
// Untracked state change.
|
|
409
423
|
this.state.hideTableHeader = normalizeBoolean(value);
|
|
410
424
|
}
|
|
411
425
|
|
|
412
426
|
/**
|
|
413
|
-
* If present, the table header is wrapped
|
|
414
|
-
* @type {
|
|
427
|
+
* If present, the table header is wrapped.
|
|
428
|
+
* @type {Boolean}
|
|
415
429
|
* @default false
|
|
416
430
|
*/
|
|
417
431
|
@api
|
|
@@ -420,12 +434,13 @@ export default class LightningDatatable extends LightningElement {
|
|
|
420
434
|
}
|
|
421
435
|
|
|
422
436
|
set wrapTableHeader(value) {
|
|
437
|
+
// Untracked state change.
|
|
423
438
|
this.state.wrapTableHeader = normalizeBoolean(value);
|
|
424
439
|
}
|
|
425
440
|
|
|
426
441
|
/**
|
|
427
442
|
* If present, a spinner is shown to indicate that more data is loading.
|
|
428
|
-
* @type {
|
|
443
|
+
* @type {Boolean}
|
|
429
444
|
* @default false
|
|
430
445
|
*/
|
|
431
446
|
@api
|
|
@@ -434,13 +449,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
434
449
|
}
|
|
435
450
|
|
|
436
451
|
set isLoading(value) {
|
|
452
|
+
// Tracked state change.
|
|
437
453
|
setLoading(this.state, value);
|
|
438
454
|
}
|
|
439
455
|
|
|
440
456
|
/**
|
|
441
457
|
* Required for better performance. Associates each row with a unique ID.
|
|
442
458
|
* key-field is case sensitive and must match the value you provide in the data array.
|
|
443
|
-
* @type {
|
|
459
|
+
* @type {String}
|
|
444
460
|
* @required
|
|
445
461
|
*/
|
|
446
462
|
@api
|
|
@@ -449,8 +465,11 @@ export default class LightningDatatable extends LightningElement {
|
|
|
449
465
|
}
|
|
450
466
|
|
|
451
467
|
set keyField(value) {
|
|
452
|
-
|
|
453
|
-
|
|
468
|
+
const { state } = this;
|
|
469
|
+
// Untracked state change.
|
|
470
|
+
setKeyField(state, value);
|
|
471
|
+
// Tracked state change.
|
|
472
|
+
setDirtyValues(state, this._draftValues);
|
|
454
473
|
this.updateRowsState();
|
|
455
474
|
}
|
|
456
475
|
|
|
@@ -458,7 +477,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
458
477
|
* Determines when to trigger infinite loading based on
|
|
459
478
|
* how many pixels the table's scroll position is from the bottom of the table.
|
|
460
479
|
* The default is 20.
|
|
461
|
-
* @type {
|
|
480
|
+
* @type {Number}
|
|
462
481
|
* @default 20
|
|
463
482
|
*/
|
|
464
483
|
@api
|
|
@@ -473,7 +492,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
473
492
|
/**
|
|
474
493
|
* The maximum width for all columns.
|
|
475
494
|
* The default is 1000px.
|
|
476
|
-
* @type {
|
|
495
|
+
* @type {Number}
|
|
477
496
|
* @default 1000px
|
|
478
497
|
*/
|
|
479
498
|
@api
|
|
@@ -483,7 +502,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
483
502
|
|
|
484
503
|
set maxColumnWidth(value) {
|
|
485
504
|
const { state, widthsData } = this;
|
|
505
|
+
// Tracked state change.
|
|
486
506
|
setMaxColumnWidth(getColumns(state), widthsData, value);
|
|
507
|
+
// Untracked state change.
|
|
487
508
|
this._columnWidthManager.maxColumnWidth = this.maxColumnWidth;
|
|
488
509
|
}
|
|
489
510
|
|
|
@@ -491,7 +512,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
491
512
|
* The maximum number of rows that can be selected. Value should be a positive integer
|
|
492
513
|
* Checkboxes are used for selection by default,
|
|
493
514
|
* and radio buttons are used when maxRowSelection is 1.
|
|
494
|
-
* @type {
|
|
515
|
+
* @type {Number}
|
|
495
516
|
*/
|
|
496
517
|
@api
|
|
497
518
|
get maxRowSelection() {
|
|
@@ -499,8 +520,10 @@ export default class LightningDatatable extends LightningElement {
|
|
|
499
520
|
}
|
|
500
521
|
|
|
501
522
|
set maxRowSelection(value) {
|
|
502
|
-
const
|
|
503
|
-
|
|
523
|
+
const { state } = this;
|
|
524
|
+
const previousSelectionLength = getCurrentSelectionLength(state);
|
|
525
|
+
// A mix of tracked and untracked state changes.
|
|
526
|
+
setMaxRowSelection(state, value);
|
|
504
527
|
if (previousSelectionLength > 0) {
|
|
505
528
|
this.fireSelectedRowsChange(this.getSelectedRows());
|
|
506
529
|
}
|
|
@@ -509,7 +532,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
509
532
|
/**
|
|
510
533
|
* The minimum width for all columns.
|
|
511
534
|
* The default is 50px.
|
|
512
|
-
* @type {
|
|
535
|
+
* @type {Number}
|
|
513
536
|
* @default 50px
|
|
514
537
|
*/
|
|
515
538
|
@api
|
|
@@ -519,16 +542,18 @@ export default class LightningDatatable extends LightningElement {
|
|
|
519
542
|
|
|
520
543
|
set minColumnWidth(value) {
|
|
521
544
|
const { state, widthsData } = this;
|
|
545
|
+
// Tracked state change.
|
|
522
546
|
setMinColumnWidth(getColumns(state), widthsData, value);
|
|
547
|
+
// Untracked state change.
|
|
523
548
|
this._columnWidthManager.minColumnWidth = this.minColumnWidth;
|
|
524
549
|
}
|
|
525
550
|
|
|
526
551
|
/**
|
|
527
552
|
* @typedef RenderManagerConfig
|
|
528
|
-
* @type {
|
|
529
|
-
* @property {
|
|
530
|
-
* @property {
|
|
531
|
-
* @property {
|
|
553
|
+
* @type {Object}
|
|
554
|
+
* @property {Boolean} viewportRendering - Specifies whether to defer rendering of rows outside the viewport until the user begins scrolling. To use this feature, create a fixed-height container element for lightning-datatable.
|
|
555
|
+
* @property {Number} rowHeight - Specifies the height of a row, in px
|
|
556
|
+
* @property {String} virtualize - specifies whether to enable virtualization. This requires the "role-based" render mode and a fixed-height container for lightning-datatable
|
|
532
557
|
*/
|
|
533
558
|
|
|
534
559
|
/**
|
|
@@ -543,7 +568,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
543
568
|
}
|
|
544
569
|
|
|
545
570
|
set renderConfig(value) {
|
|
546
|
-
if (typeof value === 'object'
|
|
571
|
+
if (typeof value === 'object') {
|
|
547
572
|
setViewportRendering(this.state, value.viewportRendering);
|
|
548
573
|
|
|
549
574
|
this._renderManager.configure(
|
|
@@ -578,21 +603,22 @@ export default class LightningDatatable extends LightningElement {
|
|
|
578
603
|
}
|
|
579
604
|
|
|
580
605
|
set renderMode(value) {
|
|
606
|
+
const { _renderConfig, state } = this;
|
|
581
607
|
this._renderMode = normalizeString(value, {
|
|
582
608
|
fallbackValue: 'default',
|
|
583
609
|
validValues: ['default', 'role-based'],
|
|
584
610
|
});
|
|
585
|
-
|
|
611
|
+
state.renderModeRoleBased = this._renderMode === 'role-based';
|
|
586
612
|
this._columnWidthManager.setRenderMode(this.renderMode);
|
|
587
|
-
if (
|
|
588
|
-
setVirtualize(
|
|
613
|
+
if (_renderConfig) {
|
|
614
|
+
setVirtualize(state, _renderConfig.virtualize);
|
|
589
615
|
}
|
|
590
|
-
updateCellClassForRoleBasedMode(
|
|
616
|
+
updateCellClassForRoleBasedMode(state);
|
|
591
617
|
}
|
|
592
618
|
|
|
593
619
|
/**
|
|
594
620
|
* If present, column resizing is disabled.
|
|
595
|
-
* @type {
|
|
621
|
+
* @type {Boolean}
|
|
596
622
|
* @default false
|
|
597
623
|
*/
|
|
598
624
|
@api
|
|
@@ -601,13 +627,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
601
627
|
}
|
|
602
628
|
|
|
603
629
|
set resizeColumnDisabled(value) {
|
|
630
|
+
// Untracked state change.
|
|
604
631
|
setResizeColumnDisabled(this.widthsData, value);
|
|
605
632
|
}
|
|
606
633
|
|
|
607
634
|
/**
|
|
608
635
|
* The width to resize the column when a user presses left or right arrow.
|
|
609
636
|
* The default is 10px.
|
|
610
|
-
* @type {
|
|
637
|
+
* @type {Number}
|
|
611
638
|
* @default 10px
|
|
612
639
|
*/
|
|
613
640
|
@api
|
|
@@ -616,13 +643,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
616
643
|
}
|
|
617
644
|
|
|
618
645
|
set resizeStep(value) {
|
|
646
|
+
// Tracked state change.
|
|
619
647
|
setResizeStep(this.widthsData, value);
|
|
620
648
|
}
|
|
621
649
|
|
|
622
650
|
/**
|
|
623
651
|
* Determines where to start counting the row number.
|
|
624
652
|
* The default is 0.
|
|
625
|
-
* @type {
|
|
653
|
+
* @type {Number}
|
|
626
654
|
* @default 0
|
|
627
655
|
*/
|
|
628
656
|
@api
|
|
@@ -632,8 +660,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
632
660
|
|
|
633
661
|
set rowNumberOffset(value) {
|
|
634
662
|
const { state, widthsData } = this;
|
|
663
|
+
// Untracked state change.
|
|
635
664
|
setRowNumberOffset(state, value);
|
|
636
|
-
|
|
665
|
+
// Tracked state changes.
|
|
637
666
|
this._columnWidthManager.handleRowNumberOffsetChange(state, widthsData);
|
|
638
667
|
}
|
|
639
668
|
|
|
@@ -653,7 +682,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
653
682
|
|
|
654
683
|
/**
|
|
655
684
|
* If present, the row numbers are shown in the first column.
|
|
656
|
-
* @type {
|
|
685
|
+
* @type {Boolean}
|
|
657
686
|
* @default false
|
|
658
687
|
*/
|
|
659
688
|
@api
|
|
@@ -663,13 +692,13 @@ export default class LightningDatatable extends LightningElement {
|
|
|
663
692
|
|
|
664
693
|
set showRowNumberColumn(value) {
|
|
665
694
|
const { state, _columns } = this;
|
|
666
|
-
|
|
695
|
+
// A mix of tracked and untracked state changes.
|
|
667
696
|
this._columnWidthManager.handleRowNumberColumnChange(
|
|
668
697
|
getRowNumberOffset(state),
|
|
669
698
|
value,
|
|
670
699
|
getColumns(state)
|
|
671
700
|
);
|
|
672
|
-
|
|
701
|
+
// Untracked state change.
|
|
673
702
|
setShowRowNumberColumn(state, value);
|
|
674
703
|
this.updateColumns(_columns);
|
|
675
704
|
}
|
|
@@ -677,7 +706,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
677
706
|
/**
|
|
678
707
|
* The column key or fieldName that controls the sorting order.
|
|
679
708
|
* Sort the data using the onsort event handler.
|
|
680
|
-
* @type {
|
|
709
|
+
* @type {String}
|
|
681
710
|
*/
|
|
682
711
|
@api
|
|
683
712
|
get sortedBy() {
|
|
@@ -685,15 +714,16 @@ export default class LightningDatatable extends LightningElement {
|
|
|
685
714
|
}
|
|
686
715
|
|
|
687
716
|
set sortedBy(value) {
|
|
688
|
-
|
|
689
|
-
|
|
717
|
+
const { state } = this;
|
|
718
|
+
setSortedBy(state, value);
|
|
719
|
+
updateSorting(state);
|
|
690
720
|
}
|
|
691
721
|
|
|
692
722
|
/**
|
|
693
723
|
* Specifies the sorting direction.
|
|
694
724
|
* Sort the data using the onsort event handler.
|
|
695
725
|
* Valid options include 'asc' and 'desc'.
|
|
696
|
-
* @type {
|
|
726
|
+
* @type {String}
|
|
697
727
|
*/
|
|
698
728
|
@api
|
|
699
729
|
get sortedDirection() {
|
|
@@ -701,13 +731,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
701
731
|
}
|
|
702
732
|
|
|
703
733
|
set sortedDirection(value) {
|
|
704
|
-
|
|
705
|
-
|
|
734
|
+
const { state } = this;
|
|
735
|
+
setSortedDirection(state, value);
|
|
736
|
+
updateSorting(state);
|
|
706
737
|
}
|
|
707
738
|
|
|
708
739
|
/**
|
|
709
740
|
* If present, the footer that displays the Save and Cancel buttons is hidden during inline editing.
|
|
710
|
-
* @type {
|
|
741
|
+
* @type {Boolean}
|
|
711
742
|
* @default false
|
|
712
743
|
*/
|
|
713
744
|
@api
|
|
@@ -723,7 +754,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
723
754
|
* This value specifies the number of lines after which the
|
|
724
755
|
* content will be cut off and hidden. It must be at least 1 or more.
|
|
725
756
|
* The text in the last line is truncated and shown with an ellipsis.
|
|
726
|
-
* @type {
|
|
757
|
+
* @type {Integer}
|
|
727
758
|
*/
|
|
728
759
|
@api
|
|
729
760
|
get wrapTextMaxLines() {
|
|
@@ -732,6 +763,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
732
763
|
|
|
733
764
|
set wrapTextMaxLines(value) {
|
|
734
765
|
const { state } = this;
|
|
766
|
+
// Untracked state changes.
|
|
735
767
|
setWrapTextMaxLines(state, value);
|
|
736
768
|
this._columnWidthManager.wrapTextMaxLines = state.wrapTextMaxLines;
|
|
737
769
|
this.updateRowsAndCellIndexes(state);
|
|
@@ -745,13 +777,18 @@ export default class LightningDatatable extends LightningElement {
|
|
|
745
777
|
*/
|
|
746
778
|
@api
|
|
747
779
|
getSelectedRows() {
|
|
748
|
-
const
|
|
749
|
-
|
|
780
|
+
const { state } = this;
|
|
781
|
+
const data = unwrap(getData(state));
|
|
782
|
+
const { rows } = state;
|
|
783
|
+
const selectedRows = [];
|
|
784
|
+
for (let i = 0, { length: rowCount } = rows; i < rowCount; i += 1) {
|
|
785
|
+
const row = rows[i];
|
|
750
786
|
if (row.isSelected) {
|
|
751
|
-
|
|
787
|
+
// Collect tracked data.
|
|
788
|
+
selectedRows.push(data[i]);
|
|
752
789
|
}
|
|
753
|
-
|
|
754
|
-
|
|
790
|
+
}
|
|
791
|
+
return selectedRows;
|
|
755
792
|
}
|
|
756
793
|
|
|
757
794
|
/**
|
|
@@ -786,22 +823,22 @@ export default class LightningDatatable extends LightningElement {
|
|
|
786
823
|
}
|
|
787
824
|
|
|
788
825
|
get computedTableContainerClass() {
|
|
789
|
-
return
|
|
826
|
+
return classSetToString({
|
|
790
827
|
'slds-table_header-fixed_container': !this.hideTableHeader,
|
|
791
828
|
'slds-scrollable_x': !this._isResizing,
|
|
792
|
-
})
|
|
829
|
+
});
|
|
793
830
|
}
|
|
794
831
|
|
|
795
832
|
get computedTableClass() {
|
|
796
833
|
const headerType = this.hideTableHeader ? 'hidden' : 'fixed';
|
|
797
|
-
return
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
834
|
+
return classSetToString({
|
|
835
|
+
'slds-table': true,
|
|
836
|
+
[`slds-table_header-${headerType}`]: true,
|
|
837
|
+
'slds-table_bordered': true,
|
|
838
|
+
'slds-table_edit': true,
|
|
839
|
+
'slds-table_resizable-cols': this.hasResizebleColumns,
|
|
840
|
+
'slds-tree slds-table_tree': hasTreeDataType(this.state),
|
|
841
|
+
});
|
|
805
842
|
}
|
|
806
843
|
|
|
807
844
|
get computedTableRole() {
|
|
@@ -809,14 +846,12 @@ export default class LightningDatatable extends LightningElement {
|
|
|
809
846
|
}
|
|
810
847
|
|
|
811
848
|
get computedTableStyle() {
|
|
812
|
-
const tableLayout =
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
getCSSWidthStyleOfTable(this.widthsData),
|
|
819
|
-
]);
|
|
849
|
+
const tableLayout = this._columnWidthManager.isAutoResizingUpdateQueued
|
|
850
|
+
? 'auto'
|
|
851
|
+
: 'fixed';
|
|
852
|
+
let style = `table-layout:${tableLayout}`;
|
|
853
|
+
style += getCSSWidthStyleOfTable(this.widthsData);
|
|
854
|
+
return style;
|
|
820
855
|
}
|
|
821
856
|
|
|
822
857
|
/**
|
|
@@ -826,25 +861,23 @@ export default class LightningDatatable extends LightningElement {
|
|
|
826
861
|
* virtualization is enabled
|
|
827
862
|
*/
|
|
828
863
|
get computedTbodyStyle() {
|
|
829
|
-
const
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
if (
|
|
833
|
-
|
|
834
|
-
getRowNumberOffset(this.state) >= 0
|
|
835
|
-
) {
|
|
864
|
+
const { state } = this;
|
|
865
|
+
const rowNumberOffset = getRowNumberOffset(state);
|
|
866
|
+
let style = '';
|
|
867
|
+
if (hasRowNumberColumn(state) && rowNumberOffset >= 0) {
|
|
868
|
+
const { firstVisibleIndex, bufferSize } = state;
|
|
836
869
|
const firstRenderedRow = Math.max(
|
|
837
870
|
firstVisibleIndex - bufferSize,
|
|
838
871
|
0
|
|
839
872
|
);
|
|
840
|
-
const rowNumber = firstRenderedRow +
|
|
841
|
-
style
|
|
873
|
+
const rowNumber = firstRenderedRow + rowNumberOffset;
|
|
874
|
+
style += `counter-reset: row-number ${rowNumber};`;
|
|
842
875
|
}
|
|
843
|
-
if (virtualize) {
|
|
844
|
-
|
|
845
|
-
style
|
|
876
|
+
if (state.virtualize) {
|
|
877
|
+
const { tableHeight } = state;
|
|
878
|
+
style += `position:relative;height:${tableHeight}px`;
|
|
846
879
|
}
|
|
847
|
-
return
|
|
880
|
+
return style;
|
|
848
881
|
}
|
|
849
882
|
|
|
850
883
|
/**
|
|
@@ -861,7 +894,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
861
894
|
const minHeight = this._actionsMinHeightStyle
|
|
862
895
|
? `${this._actionsMinHeightStyle};`
|
|
863
896
|
: '';
|
|
864
|
-
if (this._columnWidthManager.isAutoResizingUpdateQueued
|
|
897
|
+
if (this._columnWidthManager.isAutoResizingUpdateQueued) {
|
|
865
898
|
return `${minHeight}overflow-x:auto`;
|
|
866
899
|
}
|
|
867
900
|
return `${minHeight}${getCSSWidthStyleOfTable(this.widthsData)}`;
|
|
@@ -876,7 +909,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
876
909
|
styles['padding-bottom'] = '3rem';
|
|
877
910
|
}
|
|
878
911
|
|
|
879
|
-
if (this._columnWidthManager.isAutoResizingUpdateQueued
|
|
912
|
+
if (this._columnWidthManager.isAutoResizingUpdateQueued) {
|
|
880
913
|
styles['overflow-x'] = 'auto';
|
|
881
914
|
}
|
|
882
915
|
|
|
@@ -908,13 +941,11 @@ export default class LightningDatatable extends LightningElement {
|
|
|
908
941
|
}
|
|
909
942
|
|
|
910
943
|
get computedAriaLiveClassForActionMode() {
|
|
911
|
-
const
|
|
912
|
-
return
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
})
|
|
917
|
-
.toString();
|
|
944
|
+
const isActionMode = this.state.keyboardMode === 'ACTION';
|
|
945
|
+
return classSetToString({
|
|
946
|
+
'slds-hide': !isActionMode,
|
|
947
|
+
'slds-assistive-text': isActionMode,
|
|
948
|
+
});
|
|
918
949
|
}
|
|
919
950
|
|
|
920
951
|
/**
|
|
@@ -954,16 +985,17 @@ export default class LightningDatatable extends LightningElement {
|
|
|
954
985
|
}
|
|
955
986
|
|
|
956
987
|
get renderedRows() {
|
|
957
|
-
const {
|
|
988
|
+
const { state } = this;
|
|
989
|
+
const { virtualize, rows, renderedRowCount } = state;
|
|
958
990
|
if (virtualize) {
|
|
959
991
|
const { firstIndex, lastIndex } =
|
|
960
|
-
this._renderManager.getRenderedRange(
|
|
992
|
+
this._renderManager.getRenderedRange(state);
|
|
961
993
|
this._lastRenderedRow = lastIndex + 1; // UTAM rows are 1-indexed
|
|
962
994
|
// we shouldn't lose focus from re-renders caused by a change in renderedRows
|
|
963
995
|
this._shouldResetFocus = true;
|
|
964
996
|
return rows.slice(firstIndex, lastIndex);
|
|
965
997
|
}
|
|
966
|
-
if (this.viewportRendering
|
|
998
|
+
if (this.viewportRendering) {
|
|
967
999
|
this._lastRenderedRow = renderedRowCount;
|
|
968
1000
|
return rows.slice(0, renderedRowCount);
|
|
969
1001
|
}
|
|
@@ -1010,6 +1042,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1010
1042
|
* Attach event handlers for various events on `lightning-datatable`
|
|
1011
1043
|
*/
|
|
1012
1044
|
connectedCallback() {
|
|
1045
|
+
const { template } = this;
|
|
1013
1046
|
const {
|
|
1014
1047
|
handleResizeColumn,
|
|
1015
1048
|
handleUpdateColumnSort,
|
|
@@ -1018,89 +1051,76 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1018
1051
|
handleSelectionCellClick,
|
|
1019
1052
|
} = this;
|
|
1020
1053
|
|
|
1021
|
-
// Row
|
|
1022
|
-
this.
|
|
1054
|
+
// Row selection and de-selection
|
|
1055
|
+
this.addEventListener(
|
|
1056
|
+
'rowselection',
|
|
1057
|
+
handleRowSelectionChange.bind(this)
|
|
1058
|
+
);
|
|
1059
|
+
template.addEventListener(
|
|
1023
1060
|
'selectallrows',
|
|
1024
1061
|
handleSelectionCellClick.bind(this)
|
|
1025
1062
|
);
|
|
1026
|
-
|
|
1063
|
+
template.addEventListener(
|
|
1027
1064
|
'deselectallrows',
|
|
1028
1065
|
handleSelectionCellClick.bind(this)
|
|
1029
1066
|
);
|
|
1030
|
-
|
|
1067
|
+
template.addEventListener(
|
|
1031
1068
|
'selectrow',
|
|
1032
1069
|
handleSelectionCellClick.bind(this)
|
|
1033
1070
|
);
|
|
1034
|
-
|
|
1071
|
+
template.addEventListener(
|
|
1035
1072
|
'deselectrow',
|
|
1036
1073
|
handleSelectionCellClick.bind(this)
|
|
1037
1074
|
);
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
);
|
|
1043
|
-
|
|
1044
|
-
// Column Resizing
|
|
1045
|
-
this.template.addEventListener(
|
|
1046
|
-
'resizecol',
|
|
1047
|
-
handleResizeColumn.bind(this)
|
|
1048
|
-
);
|
|
1049
|
-
|
|
1050
|
-
// Column Sorting
|
|
1051
|
-
this.template.addEventListener(
|
|
1075
|
+
// Column resizing
|
|
1076
|
+
template.addEventListener('resizecol', handleResizeColumn.bind(this));
|
|
1077
|
+
// Column sorting
|
|
1078
|
+
template.addEventListener(
|
|
1052
1079
|
'privateupdatecolsort',
|
|
1053
1080
|
handleUpdateColumnSort.bind(this)
|
|
1054
1081
|
);
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
this.template.addEventListener(
|
|
1082
|
+
// Cell interaction
|
|
1083
|
+
template.addEventListener(
|
|
1058
1084
|
'privatecellkeydown',
|
|
1059
1085
|
handleKeydownOnCell.bind(this)
|
|
1060
1086
|
);
|
|
1061
|
-
|
|
1062
|
-
this.template.addEventListener(
|
|
1087
|
+
template.addEventListener(
|
|
1063
1088
|
'privatecellfocusedbyclick',
|
|
1064
1089
|
handleCellFocusByClick.bind(this)
|
|
1065
1090
|
);
|
|
1066
|
-
|
|
1091
|
+
template.addEventListener(
|
|
1067
1092
|
'privatecellfalseblurred',
|
|
1068
1093
|
handleFalseCellBlur.bind(this)
|
|
1069
1094
|
);
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
this.template.addEventListener(
|
|
1095
|
+
// Row level actions
|
|
1096
|
+
template.addEventListener(
|
|
1073
1097
|
'privatecellactiontriggered',
|
|
1074
1098
|
handleRowActionTriggered.bind(this)
|
|
1075
1099
|
);
|
|
1076
|
-
|
|
1100
|
+
template.addEventListener(
|
|
1077
1101
|
'privatecellactionmenuopening',
|
|
1078
1102
|
handleLoadDynamicActions.bind(this)
|
|
1079
1103
|
);
|
|
1080
|
-
|
|
1104
|
+
template.addEventListener(
|
|
1081
1105
|
'privatecellbuttonclicked',
|
|
1082
1106
|
handleCellButtonClick.bind(this)
|
|
1083
1107
|
);
|
|
1084
1108
|
|
|
1085
1109
|
// Header Actions
|
|
1086
|
-
|
|
1110
|
+
template.addEventListener(
|
|
1087
1111
|
'privatecellheaderactionmenuopening',
|
|
1088
1112
|
handleHeaderActionMenuOpening.bind(this)
|
|
1089
1113
|
);
|
|
1090
|
-
|
|
1114
|
+
template.addEventListener(
|
|
1091
1115
|
'privatecellheaderactionmenuclosed',
|
|
1092
1116
|
handleHeaderActionMenuClosed.bind(this)
|
|
1093
1117
|
);
|
|
1094
|
-
|
|
1118
|
+
template.addEventListener(
|
|
1095
1119
|
'privatecellheaderactiontriggered',
|
|
1096
1120
|
handleHeaderActionTriggered.bind(this)
|
|
1097
1121
|
);
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
this.template.addEventListener(
|
|
1101
|
-
'privateeditcell',
|
|
1102
|
-
handleEditCell.bind(this)
|
|
1103
|
-
);
|
|
1122
|
+
// Inline edit
|
|
1123
|
+
template.addEventListener('privateeditcell', handleEditCell.bind(this));
|
|
1104
1124
|
}
|
|
1105
1125
|
|
|
1106
1126
|
/**
|
|
@@ -1113,36 +1133,39 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1113
1133
|
}
|
|
1114
1134
|
|
|
1115
1135
|
renderedCallback() {
|
|
1116
|
-
const { state, template, widthsData } = this;
|
|
1136
|
+
const { _columnWidthManager, state, template, widthsData } = this;
|
|
1117
1137
|
|
|
1118
1138
|
// This keeps underlying table element up to date if the aria-* properties on this element is dynamically changed.
|
|
1119
1139
|
// It does the work of removing and adding the attribute if the value is empty(ish) or a normal string.
|
|
1120
1140
|
synchronizeAttrs(this.gridContainer, {
|
|
1121
1141
|
'aria-label': this.ariaLabel,
|
|
1122
1142
|
'aria-labelledby': this.ariaLabelledBy,
|
|
1143
|
+
'aria-describedby': this.ariaDescribedBy,
|
|
1123
1144
|
});
|
|
1124
1145
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1146
|
+
let { _privateWidthObserver } = this;
|
|
1147
|
+
if (!_privateWidthObserver) {
|
|
1148
|
+
_privateWidthObserver = new LightningDatatableResizeObserver(
|
|
1127
1149
|
template,
|
|
1128
1150
|
state,
|
|
1129
1151
|
widthsData,
|
|
1130
|
-
|
|
1152
|
+
_columnWidthManager
|
|
1131
1153
|
);
|
|
1132
|
-
|
|
1133
|
-
|
|
1154
|
+
this._privateWidthObserver = _privateWidthObserver;
|
|
1155
|
+
} else if (!_privateWidthObserver.isConnected()) {
|
|
1156
|
+
_privateWidthObserver.observe(template);
|
|
1134
1157
|
}
|
|
1135
1158
|
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1159
|
+
if (_columnWidthManager.isResizingUpdateQueued) {
|
|
1160
|
+
const columns = getColumns(state);
|
|
1161
|
+
const fireResizeEvent = _columnWidthManager.shouldFireResizeEvent(
|
|
1162
|
+
widthsData,
|
|
1163
|
+
columns
|
|
1164
|
+
);
|
|
1165
|
+
// Tracked state changes.
|
|
1166
|
+
_columnWidthManager.adjustColumnsSize(
|
|
1144
1167
|
template,
|
|
1145
|
-
|
|
1168
|
+
columns,
|
|
1146
1169
|
widthsData
|
|
1147
1170
|
);
|
|
1148
1171
|
|
|
@@ -1159,18 +1182,22 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1159
1182
|
}
|
|
1160
1183
|
|
|
1161
1184
|
handlePrefetch.call(this, template, state);
|
|
1162
|
-
|
|
1185
|
+
|
|
1186
|
+
// customerSelectedRows is only valid till render, after it, the one
|
|
1187
|
+
// used should be the one from the state.
|
|
1163
1188
|
this._customerSelectedRows = null;
|
|
1164
|
-
//
|
|
1189
|
+
// Set the previous focused cell to null after render is done.
|
|
1165
1190
|
resetCellToFocusFromPrev(state);
|
|
1166
|
-
|
|
1191
|
+
|
|
1192
|
+
// Reset focus styles on re-render.
|
|
1167
1193
|
if (this._shouldResetFocus) {
|
|
1168
|
-
//
|
|
1194
|
+
// Since focus is now getting reset, can change this back to false.
|
|
1169
1195
|
this._shouldResetFocus = false;
|
|
1170
|
-
//
|
|
1196
|
+
// Don't return focus to active cell when inline edit panel is open.
|
|
1197
|
+
const { activeCell } = state;
|
|
1171
1198
|
if (
|
|
1172
|
-
|
|
1173
|
-
|
|
1199
|
+
activeCell &&
|
|
1200
|
+
activeCell.focused &&
|
|
1174
1201
|
!state.inlineEdit.isPanelVisible
|
|
1175
1202
|
) {
|
|
1176
1203
|
const cellElement = getActiveCellElement(template, state);
|
|
@@ -1179,6 +1206,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1179
1206
|
cellElement.parentElement &&
|
|
1180
1207
|
!cellElement.parentElement.classList.contains(FOCUS_CLASS)
|
|
1181
1208
|
) {
|
|
1209
|
+
// Tracked state change.
|
|
1182
1210
|
setFocusActiveCell(template, state, null, null, false);
|
|
1183
1211
|
}
|
|
1184
1212
|
}
|
|
@@ -1221,8 +1249,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1221
1249
|
}
|
|
1222
1250
|
|
|
1223
1251
|
disconnectedCallback() {
|
|
1224
|
-
|
|
1225
|
-
|
|
1252
|
+
const { _privateWidthObserver } = this;
|
|
1253
|
+
if (_privateWidthObserver) {
|
|
1254
|
+
_privateWidthObserver.disconnect();
|
|
1226
1255
|
}
|
|
1227
1256
|
|
|
1228
1257
|
this._renderManager.disconnectResizeObserver();
|
|
@@ -1261,33 +1290,22 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1261
1290
|
* @param {KeyboardEvent} event - `keydown`
|
|
1262
1291
|
*/
|
|
1263
1292
|
handleKeydownOnDataRow(event) {
|
|
1293
|
+
const { state } = this;
|
|
1264
1294
|
// we probably should not be doing this unless we actually are interested in it
|
|
1265
|
-
if (
|
|
1266
|
-
this.state.keyboardMode === 'NAVIGATION' &&
|
|
1267
|
-
this.state.rowMode === true
|
|
1268
|
-
) {
|
|
1295
|
+
if (state.keyboardMode === 'NAVIGATION' && state.rowMode === true) {
|
|
1269
1296
|
event.stopPropagation();
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
const rowKeyValue = tr.getAttribute('data-row-key-value');
|
|
1273
|
-
const keyCode = event.keyCode;
|
|
1274
|
-
const rowHasChildren = !!tr.getAttribute('aria-expanded');
|
|
1275
|
-
const rowExpanded = tr.getAttribute('aria-expanded') === 'true';
|
|
1276
|
-
const rowLevel = tr.getAttribute('aria-level');
|
|
1277
|
-
|
|
1278
|
-
const evt = {
|
|
1297
|
+
const { currentTarget: tr } = event;
|
|
1298
|
+
reactToKeyboardOnRow(this, state, {
|
|
1279
1299
|
target: tr,
|
|
1280
1300
|
detail: {
|
|
1281
|
-
|
|
1282
|
-
keyCode,
|
|
1283
|
-
rowHasChildren,
|
|
1284
|
-
rowExpanded,
|
|
1285
|
-
rowLevel,
|
|
1301
|
+
keyCode: event.keyCode,
|
|
1286
1302
|
keyEvent: event,
|
|
1303
|
+
rowExpanded: tr.getAttribute('aria-expanded') === 'true',
|
|
1304
|
+
rowHasChildren: !!tr.getAttribute('aria-expanded'),
|
|
1305
|
+
rowKeyValue: tr.getAttribute('data-row-key-value'),
|
|
1306
|
+
rowLevel: tr.getAttribute('aria-level'),
|
|
1287
1307
|
},
|
|
1288
|
-
};
|
|
1289
|
-
|
|
1290
|
-
reactToKeyboardOnRow(this, this.state, evt);
|
|
1308
|
+
});
|
|
1291
1309
|
}
|
|
1292
1310
|
}
|
|
1293
1311
|
|
|
@@ -1307,18 +1325,20 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1307
1325
|
* @param {Event} event - `scroll`
|
|
1308
1326
|
*/
|
|
1309
1327
|
handleVerticalScroll(event) {
|
|
1328
|
+
const { state } = this;
|
|
1310
1329
|
if (this.enableInfiniteLoading) {
|
|
1311
1330
|
handleLoadMoreCheck.call(this, event);
|
|
1312
1331
|
}
|
|
1313
1332
|
|
|
1333
|
+
// Tracked state changes.
|
|
1314
1334
|
handleInlineEditPanelScroll.call(this, event);
|
|
1315
|
-
if (
|
|
1316
|
-
|
|
1335
|
+
if (state.virtualize) {
|
|
1336
|
+
state.firstVisibleIndex = findFirstVisibleIndex(
|
|
1317
1337
|
this.state,
|
|
1318
1338
|
event.target.scrollTop
|
|
1319
1339
|
);
|
|
1320
1340
|
} else if (this.viewportRendering) {
|
|
1321
|
-
this._renderManager.handleScroll(
|
|
1341
|
+
this._renderManager.handleScroll(state, event);
|
|
1322
1342
|
}
|
|
1323
1343
|
}
|
|
1324
1344
|
|
|
@@ -1346,7 +1366,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1346
1366
|
if (state.rowMode && state.activeCell) {
|
|
1347
1367
|
unsetRowNavigationMode(state);
|
|
1348
1368
|
const { rowIndex } = getIndexesActiveCell(state);
|
|
1349
|
-
|
|
1369
|
+
updateRowTabIndex(state, rowIndex, -1);
|
|
1350
1370
|
}
|
|
1351
1371
|
this.setActiveCell(rowKeyValue, colKeyValue);
|
|
1352
1372
|
}
|
|
@@ -1365,7 +1385,6 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1365
1385
|
handleUpdateColumnSort(event) {
|
|
1366
1386
|
event.stopPropagation();
|
|
1367
1387
|
const { fieldName, columnKey, sortDirection } = event.detail;
|
|
1368
|
-
|
|
1369
1388
|
this.fireSortedColumnChange(fieldName, columnKey, sortDirection);
|
|
1370
1389
|
}
|
|
1371
1390
|
|
|
@@ -1380,14 +1399,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1380
1399
|
*/
|
|
1381
1400
|
handleResizeColumn(event) {
|
|
1382
1401
|
event.stopPropagation();
|
|
1383
|
-
const { state
|
|
1384
|
-
const { colIndex, widthDelta } = event.detail;
|
|
1385
|
-
if (
|
|
1402
|
+
const { state } = this;
|
|
1403
|
+
const { colIndex, widthDelta: delta } = event.detail;
|
|
1404
|
+
if (delta !== 0) {
|
|
1386
1405
|
resizeColumnWithDelta(
|
|
1387
1406
|
getColumns(state),
|
|
1388
|
-
widthsData,
|
|
1407
|
+
this.widthsData,
|
|
1389
1408
|
colIndex,
|
|
1390
|
-
|
|
1409
|
+
delta
|
|
1391
1410
|
);
|
|
1392
1411
|
this.fireOnResize(true);
|
|
1393
1412
|
this.safariHeaderFix();
|
|
@@ -1425,14 +1444,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1425
1444
|
*/
|
|
1426
1445
|
handleSelectionCellClick(event) {
|
|
1427
1446
|
this.handleCellFocusByClick(event);
|
|
1428
|
-
|
|
1429
|
-
if (
|
|
1447
|
+
const { type } = event;
|
|
1448
|
+
if (type === 'selectrow') {
|
|
1430
1449
|
handleSelectRow.call(this, event);
|
|
1431
|
-
} else if (
|
|
1450
|
+
} else if (type === 'deselectrow') {
|
|
1432
1451
|
handleDeselectRow.call(this, event);
|
|
1433
|
-
} else if (
|
|
1452
|
+
} else if (type === 'selectallrows') {
|
|
1434
1453
|
handleSelectAllRows.call(this, event);
|
|
1435
|
-
} else if (
|
|
1454
|
+
} else if (type === 'deselectallrows') {
|
|
1436
1455
|
handleDeselectAllRows.call(this, event);
|
|
1437
1456
|
}
|
|
1438
1457
|
}
|
|
@@ -1444,14 +1463,14 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1444
1463
|
*/
|
|
1445
1464
|
handleCellFocusByClick(event) {
|
|
1446
1465
|
event.stopPropagation();
|
|
1466
|
+
const { state } = this;
|
|
1447
1467
|
const { rowKeyValue, colKeyValue, needsRefocusOnCellElement } =
|
|
1448
1468
|
event.detail;
|
|
1449
|
-
const { state } = this;
|
|
1450
1469
|
if (!isActiveCell(state, rowKeyValue, colKeyValue)) {
|
|
1451
1470
|
if (state.rowMode && state.activeCell) {
|
|
1452
1471
|
unsetRowNavigationMode(state);
|
|
1453
1472
|
const { rowIndex } = getIndexesActiveCell(state);
|
|
1454
|
-
|
|
1473
|
+
updateRowTabIndex(state, rowIndex, -1);
|
|
1455
1474
|
}
|
|
1456
1475
|
this.setActiveCell(rowKeyValue, colKeyValue);
|
|
1457
1476
|
refocusCellElement(this.template, state, needsRefocusOnCellElement);
|
|
@@ -1465,12 +1484,13 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1465
1484
|
*/
|
|
1466
1485
|
handleFalseCellBlur(event) {
|
|
1467
1486
|
event.stopPropagation();
|
|
1468
|
-
const {
|
|
1487
|
+
const { state } = this;
|
|
1469
1488
|
const { rowKeyValue, colKeyValue } = event.detail;
|
|
1470
1489
|
if (!isActiveCell(state, rowKeyValue, colKeyValue)) {
|
|
1471
1490
|
this.setActiveCell(rowKeyValue, colKeyValue);
|
|
1472
1491
|
}
|
|
1473
|
-
|
|
1492
|
+
// Tracked state change.
|
|
1493
|
+
setFocusActiveCell(this.template, state);
|
|
1474
1494
|
}
|
|
1475
1495
|
|
|
1476
1496
|
/**
|
|
@@ -1499,8 +1519,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1499
1519
|
*/
|
|
1500
1520
|
handleTableFocusOut(event) {
|
|
1501
1521
|
handleDatatableFocusOut.call(this, event);
|
|
1502
|
-
|
|
1503
|
-
|
|
1522
|
+
const { activeCell } = this.state;
|
|
1523
|
+
if (activeCell) {
|
|
1524
|
+
activeCell.focused = this._shouldResetFocus;
|
|
1504
1525
|
}
|
|
1505
1526
|
}
|
|
1506
1527
|
|
|
@@ -1534,10 +1555,8 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1534
1555
|
handleInlineEditSave(event) {
|
|
1535
1556
|
event.stopPropagation();
|
|
1536
1557
|
event.preventDefault();
|
|
1537
|
-
|
|
1538
1558
|
closeInlineEdit(this);
|
|
1539
|
-
const draftValues = this
|
|
1540
|
-
|
|
1559
|
+
const { draftValues } = this;
|
|
1541
1560
|
this.dispatchEvent(
|
|
1542
1561
|
new CustomEvent('save', {
|
|
1543
1562
|
detail: {
|
|
@@ -1563,6 +1582,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1563
1582
|
const customerEvent = new CustomEvent('cancel', {
|
|
1564
1583
|
cancelable: true,
|
|
1565
1584
|
});
|
|
1585
|
+
|
|
1566
1586
|
this.dispatchEvent(customerEvent);
|
|
1567
1587
|
|
|
1568
1588
|
if (!customerEvent.defaultPrevented) {
|
|
@@ -1590,10 +1610,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1590
1610
|
event.stopPropagation();
|
|
1591
1611
|
event.preventDefault();
|
|
1592
1612
|
|
|
1593
|
-
const { currentTarget } = event;
|
|
1594
1613
|
const { recordId } = event.detail;
|
|
1595
1614
|
const { rowIndex, rowKeyValue } =
|
|
1596
|
-
this.computeRowLookupItemPickedInformation(currentTarget);
|
|
1615
|
+
this.computeRowLookupItemPickedInformation(event.currentTarget);
|
|
1597
1616
|
|
|
1598
1617
|
this.dispatchEvent(
|
|
1599
1618
|
// We will the below Eslint rule as we use a constant to apply the name of the event
|
|
@@ -1740,7 +1759,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1740
1759
|
} else if (virtualizedRows && state.fixedHeight) {
|
|
1741
1760
|
// if heights are fixed, we only need to check height of first row
|
|
1742
1761
|
const rowElement = this.template.querySelector(
|
|
1743
|
-
|
|
1762
|
+
getRowDataSelector(this.renderedRows[0].key)
|
|
1744
1763
|
);
|
|
1745
1764
|
// increase height by 1 since first rendered row is missing an extra 1px border
|
|
1746
1765
|
if (rowElement) {
|
|
@@ -1774,7 +1793,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1774
1793
|
setBlurActiveCell(template, state);
|
|
1775
1794
|
updateActiveCell(state, rowKeyValue, colKeyValue);
|
|
1776
1795
|
addFocusStylesToActiveCell(template, state);
|
|
1777
|
-
|
|
1796
|
+
updateCellTabIndex(state, rowIndex, colIndex, 0);
|
|
1778
1797
|
}
|
|
1779
1798
|
|
|
1780
1799
|
/**
|