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.
- package/metadata/raptor.json +77 -1
- package/package.json +108 -15
- package/scopedImports/@salesforce-label-LightningDatatable.showActions.js +1 -1
- package/scopedImports/@salesforce-label-LightningForm.controllerFieldsMessage.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.dependentFieldsHeader.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.dependentFieldsListHeading.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.generalDependentFieldsMessage.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.learnMore.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.okButton.js +1 -0
- package/scopedImports/@salesforce-label-LightningLookup.modalCancel.js +1 -0
- package/scopedImports/@salesforce-label-LightningLookup.modalSelect.js +1 -0
- package/scopedImports/@salesforce-label-LightningProgressIndicator.currentStage.js +1 -1
- package/scopedImports/@salesforce-label-LightningProgressIndicator.errorStage.js +1 -0
- package/scopedImports/@salesforce-label-LightningProgressIndicator.stageComplete.js +1 -1
- package/scopedImports/@salesforce-label-LightningProgressIndicator.stageNotStarted.js +1 -1
- package/scopedImports/@salesforce-label-LightningRichTextEditor.colorPicker.js +1 -0
- package/src/lightning/accordion/accordion-section.slds.css +3 -3
- package/src/lightning/accordion/accordion.slds.css +1 -2
- package/src/lightning/accordionSection/accordion-section.slds.css +3 -3
- package/src/lightning/accordionSection/accordionSection.js +3 -1
- package/src/lightning/accordionSection/button.slds.css +1 -1
- package/src/lightning/avatar/avatar.html +1 -0
- package/src/lightning/badge/badge.html +3 -3
- package/src/lightning/badge/badge.js +1 -0
- package/src/lightning/badge/badge.js-meta.xml +3 -0
- package/src/lightning/baseCombobox/base-combobox.slds.css +11 -6
- package/src/lightning/baseCombobox/baseCombobox.html +5 -2
- package/src/lightning/baseCombobox/baseCombobox.js +5 -18
- package/src/lightning/baseCombobox/baseCombobox.js-meta.xml +6 -0
- package/src/lightning/baseCombobox/input-text.slds.css +41 -68
- package/src/lightning/baseCombobox/keyboard.js +12 -4
- package/src/lightning/baseCombobox/listbox.slds.css +51 -99
- package/src/lightning/baseCombobox/spinner.slds.css +62 -62
- package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js-meta.xml +6 -0
- package/src/lightning/baseComboboxItem/baseComboboxItem.js +10 -6
- package/src/lightning/baseComboboxItem/baseComboboxItem.js-meta.xml +6 -0
- package/src/lightning/baseComboboxItem/listbox.slds.css +51 -99
- package/src/lightning/baseFormattedText/baseFormattedText.js +2 -2
- package/src/lightning/button/__docs__/button.md +2 -1
- package/src/lightning/button/button.js +5 -5
- package/src/lightning/button/button.slds.css +1 -1
- package/src/lightning/buttonIcon/__docs__/buttonIcon.md +1 -0
- package/src/lightning/buttonIcon/button-icon.slds.css +1 -1
- package/src/lightning/buttonIcon/buttonIcon.html +1 -1
- package/src/lightning/buttonIcon/buttonIcon.js +18 -17
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +4 -2
- package/src/lightning/buttonIconStateful/button-icon.slds.css +1 -1
- package/src/lightning/buttonIconStateful/button.slds.css +1 -1
- package/src/lightning/buttonMenu/button-icon.slds.css +1 -1
- package/src/lightning/buttonMenu/button-menu.slds.css +8 -2
- package/src/lightning/buttonMenu/button.slds.css +1 -1
- package/src/lightning/buttonMenu/buttonMenu.css +5 -0
- package/src/lightning/buttonMenu/buttonMenu.js +2 -0
- package/src/lightning/buttonStateful/button-stateful.slds.css +6 -2
- package/src/lightning/buttonStateful/button.slds.css +1 -1
- package/src/lightning/buttonStateful/buttonStateful.js +4 -1
- package/src/lightning/calendar/calendar.js-meta.xml +6 -0
- package/src/lightning/calendar/calendar.slds.css +9 -2
- package/src/lightning/colorPickerCustom/color-picker-custom.slds.css +22 -23
- package/src/lightning/colorPickerCustom/colorPickerCustom.js +12 -0
- package/src/lightning/colorPickerCustom/input-text.slds.css +41 -68
- package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +9 -10
- package/src/lightning/colorPickerPanel/colorPickerPanel.js +11 -1
- package/src/lightning/colorPickerPanel/popover.slds.css +0 -2
- package/src/lightning/combobox/combobox.html +1 -0
- package/src/lightning/combobox/combobox.slds.css +1 -2
- package/src/lightning/combobox/form-element.slds.css +54 -54
- package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.html +11 -0
- package/src/lightning/datatable/__examples__disabled/customComponentWrapper/customComponentWrapper.js +25 -0
- package/src/lightning/datatable/__examples__disabled/customComponentWrapper/generateData.js +15 -0
- package/src/lightning/datatable/__examples__disabled/customDatatableWrapper/customDatatableWrapper.js +89 -0
- package/src/lightning/datatable/__examples__disabled/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +6 -0
- package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.js +1 -16
- package/src/lightning/datatable/__examples__disabled/customDatatypeLink/customDatatypeLink.html +9 -0
- package/src/lightning/datatable/__examples__disabled/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html +3 -0
- package/src/lightning/datatable/__examples__disabled/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +3 -0
- package/src/lightning/datatable/__examples__disabled/customDatatypeTable/customNumber.html +3 -0
- package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customNumberEdit.html +2 -0
- package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/deleteRow.html +3 -2
- package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/iconPill.html +1 -1
- package/src/lightning/datatable/{__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.html → __examples__disabled/customNestedComponent/customNestedComponent.html} +2 -2
- package/src/lightning/datatable/__examples__disabled/customNestedComponent/customNestedComponent.js +12 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/customInput.html +4 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/myCustomTypeDatatable.js +17 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypeDatatable/nestedSimpleComponentParent.html +7 -0
- package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.html +9 -0
- package/src/lightning/datatable/__examples__disabled/simpleComponentNested/simpleComponentNested.js +6 -0
- package/src/lightning/datatable/autoWidthStrategy.js +145 -217
- package/src/lightning/datatable/columnResizer.js +80 -190
- package/src/lightning/datatable/columnWidthManager.js +128 -243
- package/src/lightning/datatable/columns.js +192 -283
- package/src/lightning/datatable/datagrid.slds.css +187 -0
- package/src/lightning/datatable/datatable.js +647 -614
- package/src/lightning/datatable/errors.js +19 -28
- package/src/lightning/datatable/fixedWidthStrategy.js +27 -49
- package/src/lightning/datatable/headerActions.js +10 -42
- package/src/lightning/datatable/indexes.js +42 -0
- package/src/lightning/datatable/infiniteLoading.js +27 -46
- package/src/lightning/datatable/inlineEdit.js +311 -322
- package/src/lightning/datatable/keyboard.js +490 -510
- package/src/lightning/datatable/renderManager.js +10 -11
- package/src/lightning/datatable/resizeObserver.js +10 -67
- package/src/lightning/datatable/rowLevelActions.js +7 -6
- package/src/lightning/datatable/rowNumber.js +41 -79
- package/src/lightning/datatable/rowSelection.js +236 -291
- package/src/lightning/datatable/rowSelectionShared.js +26 -33
- package/src/lightning/datatable/rows.js +264 -476
- package/src/lightning/datatable/sort.js +27 -82
- package/src/lightning/datatable/templates/div/div.css +2 -57
- package/src/lightning/datatable/templates/div/div.html +25 -10
- package/src/lightning/datatable/templates/div/div.lbc.native.css +3 -0
- package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +80 -0
- package/src/lightning/datatable/templates/table/table.html +16 -5
- package/src/lightning/datatable/tree.js +17 -35
- package/src/lightning/datatable/types.js +10 -31
- package/src/lightning/datatable/utils.js +54 -29
- package/src/lightning/datatable/virtualization.js +2 -5
- package/src/lightning/datatable/widthManagerShared.js +24 -41
- package/src/lightning/datatable/wrapText.js +45 -77
- package/src/lightning/datepicker/datepicker.js +32 -9
- package/src/lightning/datepicker/datepicker.js-meta.xml +6 -0
- package/src/lightning/datepicker/form-element.slds.css +54 -54
- package/src/lightning/datepicker/input-text.slds.css +41 -68
- package/src/lightning/datetimepicker/datetimepicker.js-meta.xml +6 -0
- package/src/lightning/datetimepicker/form-element.slds.css +54 -54
- package/src/lightning/datetimepicker/input-text.slds.css +41 -68
- package/src/lightning/dualListbox/dual-listbox.slds.css +7 -2
- package/src/lightning/dualListbox/dualListbox.js +7 -8
- package/src/lightning/dualListbox/form-element.slds.css +54 -54
- package/src/lightning/dualListbox/listbox.slds.css +51 -99
- 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/formattedDateTime/formattedDateTime.js +7 -62
- package/src/lightning/formattedDateTime/formattedDateTime.js-meta.xml +3 -0
- package/src/lightning/formattedLocation/formattedLocation.html +1 -3
- package/src/lightning/formattedLocation/formattedLocation.js +3 -25
- package/src/lightning/formattedLookup/events.js +2 -4
- package/src/lightning/formattedName/formattedName.js +3 -2
- package/src/lightning/formattedName/formattedName.js-meta.xml +3 -0
- package/src/lightning/formattedNumber/formattedNumber.js +5 -51
- package/src/lightning/formattedNumber/formattedNumber.js-meta.xml +3 -0
- package/src/lightning/formattedRichText/formattedRichText.js +5 -5
- package/src/lightning/formattedRichText/linkTextNodes.js +58 -0
- package/src/lightning/formattedRichText/richTextConfig.js +1 -0
- package/src/lightning/groupedCombobox/form-element.slds.css +54 -54
- package/src/lightning/groupedCombobox/grouped-combobox.slds.css +0 -2
- package/src/lightning/groupedCombobox/groupedCombobox.js-meta.xml +1 -1
- package/src/lightning/groupedCombobox/input-text.slds.css +41 -68
- package/src/lightning/helptext/button-icon.slds.css +1 -1
- package/src/lightning/helptext/form-element.slds.css +54 -54
- package/src/lightning/helptext/helptext.css +7 -0
- package/src/lightning/helptext/helptext.js +3 -4
- package/src/lightning/icon/icon.html +1 -1
- package/src/lightning/icon/icon.slds.css +12 -25
- package/src/lightning/input/form-element.slds.css +54 -54
- package/src/lightning/input/input.html +5 -0
- package/src/lightning/inputAddress/addressFormat.js +31 -4
- package/src/lightning/inputAddress/fieldsLayout.js +6 -0
- package/src/lightning/inputAddress/form-element.slds.css +54 -54
- package/src/lightning/inputAddress/input-address.slds.css +1 -2
- package/src/lightning/inputAddress/input-text.slds.css +41 -68
- package/src/lightning/inputAddress/inputAddress.html +19 -1
- package/src/lightning/inputAddress/inputAddress.js +75 -3
- package/src/lightning/inputAddress/inputAddress.js-meta.xml +3 -0
- package/src/lightning/inputLocation/form-element.slds.css +54 -54
- package/src/lightning/inputLocation/input-location.slds.css +1 -2
- package/src/lightning/inputLocation/input-text.slds.css +41 -68
- package/src/lightning/inputName/form-element.slds.css +54 -54
- package/src/lightning/inputName/input-text.slds.css +41 -68
- package/src/lightning/interactiveDialogBase/interactive-dialog-base.slds.css +0 -3
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js-meta.xml +6 -0
- package/src/lightning/internationalizationLibrary/address/AddressFormat.js +553 -610
- package/src/lightning/lookupAddress/form-element.slds.css +54 -54
- package/src/lightning/lookupAddress/listbox.slds.css +51 -99
- package/src/lightning/lookupAddress/location.js +2 -0
- package/src/lightning/lookupAddress/lookup-address.slds.css +0 -2
- package/src/lightning/lookupAddress/lookupAddress.html +6 -1
- package/src/lightning/lookupAddress/lookupAddress.js +40 -10
- package/src/lightning/menuDivider/menu-divider.slds.css +0 -2
- package/src/lightning/menuItem/menu-item.slds.css +8 -2
- package/src/lightning/menuSubheader/menu-subheader.slds.css +1 -2
- package/src/lightning/modal/__docs__/modal.md +10 -1
- package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +3 -7
- package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +39 -133
- package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
- package/src/lightning/modal/modal.js +1 -1
- package/src/lightning/modalBase/modal-base.slds.css +3 -3
- package/src/lightning/modalBase/modalBase.html +15 -10
- package/src/lightning/modalBase/modalBase.js +131 -154
- package/src/lightning/modalBase/modalBase.js-meta.xml +6 -0
- package/src/lightning/modalBody/modal-body.slds.css +1 -2
- package/src/lightning/modalBody/modalBody.css +6 -0
- package/src/lightning/modalFooter/modal-footer.slds.css +2 -2
- package/src/lightning/modalFooter/modalFooter.js +0 -21
- package/src/lightning/modalHeader/modal-header.slds.css +1 -2
- package/src/lightning/modalHeader/modalHeader.html +16 -4
- package/src/lightning/modalHeader/modalHeader.js +61 -36
- package/src/lightning/overlay/overlay.js-meta.xml +6 -0
- package/src/lightning/pill/link.html +1 -0
- package/src/lightning/pill/pill.slds.css +32 -58
- package/src/lightning/pill/plain.html +1 -0
- package/src/lightning/pill/plainLink.html +1 -0
- package/src/lightning/pillContainer/button.slds.css +1 -1
- package/src/lightning/pillContainer/listbox.slds.css +51 -99
- package/src/lightning/pillContainer/pill-container.slds.css +6 -10
- package/src/lightning/pillContainer/pill.slds.css +32 -58
- package/src/lightning/popup/popover.slds.css +0 -2
- package/src/lightning/primitiveBubble/primitiveBubble.js +42 -0
- package/src/lightning/primitiveBubble/primitiveBubble.js-meta.xml +6 -0
- package/src/lightning/primitiveButton/primitiveButoon.js-meta.xml +6 -0
- package/src/lightning/primitiveCellCheckbox/checkbox.css +2 -0
- package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +16 -38
- package/src/lightning/primitiveCustomCell/primitiveCustomCell.js +26 -1
- package/src/lightning/primitiveDatatableCell/primitiveDatatableCell.js +1 -1
- package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.html +1 -1
- package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.js +13 -0
- package/src/lightning/primitiveHeaderFactory/nonsortableHeader.css +1 -0
- package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +19 -6
- package/src/lightning/primitiveHeaderFactory/selectableHeader.css +2 -0
- package/src/lightning/primitiveHeaderFactory/sortableHeader.html +3 -1
- package/src/lightning/primitiveIcon/icon.slds.css +12 -25
- package/src/lightning/primitiveIcon/primitiveIcon.js-meta.xml +6 -0
- package/src/lightning/primitiveIframe/primitiveIframe.js +3 -1
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +5 -2
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js-meta.xml +6 -0
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +6 -4
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +5 -2
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js-meta.xml +6 -0
- package/src/lightning/primitiveInputColor/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputColor/input-color.slds.css +2 -3
- package/src/lightning/primitiveInputColor/input-text.slds.css +41 -68
- package/src/lightning/primitiveInputColor/primitiveInputColor.js +5 -2
- package/src/lightning/primitiveInputColor/primitiveInputColor.js-meta.xml +6 -0
- package/src/lightning/primitiveInputFile/button.slds.css +1 -1
- package/src/lightning/primitiveInputFile/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputFile/input-file.slds.css +1 -4
- package/src/lightning/primitiveInputFile/primitiveInputFile.js +4 -2
- package/src/lightning/primitiveInputFile/primitiveInputFile.js-meta.xml +6 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +4 -2
- package/src/lightning/primitiveInputSimple/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputSimple/input-text.slds.css +41 -68
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js-meta.xml +6 -0
- package/src/lightning/primitiveInputToggle/form-element.slds.css +54 -54
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +50 -27
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +5 -2
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js-meta.xml +6 -0
- package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.css +11 -0
- package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.html +2 -1
- package/src/lightning/primitiveResizeHandler/primitiveResizeHandler.js +1 -0
- package/src/lightning/progressBar/progress-bar.slds.css +8 -10
- package/src/lightning/progressRing/progress-ring.slds.css +0 -23
- package/src/lightning/progressStep/base.html +5 -6
- package/src/lightning/progressStep/progressStep.js +15 -23
- package/src/lightning/prompt/__docs__/prompt.md +1 -1
- package/src/lightning/radioGroup/form-element.slds.css +54 -54
- package/src/lightning/radioGroup/radioGroup.html +1 -2
- package/src/lightning/radioGroup/radioGroup.js +1 -0
- package/src/lightning/routingService/routingService.js +31 -5
- package/src/lightning/select/form-element.slds.css +54 -54
- package/src/lightning/select/select.slds.css +4 -2
- package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +0 -2
- package/src/lightning/sldsCommon/sldsCommon.css +134 -98
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +1 -1
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +14 -13
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +95 -92
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +1 -1
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +77 -75
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +73 -73
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +552 -558
- package/src/lightning/sldsUtilsVisibility/sldsUtilsVisibility.css +5 -1
- package/src/lightning/spinner/spinner.slds.css +62 -62
- package/src/lightning/staticMap/staticMap.js +3 -2
- package/src/lightning/tab/tab.js +10 -5
- package/src/lightning/tab/tab.js-meta.xml +3 -0
- package/src/lightning/tab/tab.slds.css +14 -7
- package/src/lightning/tabBar/tab-bar.slds.css +16 -6
- package/src/lightning/tabBar/tabBar.js +10 -5
- package/src/lightning/tabset/__docs__/tabset.md +24 -1
- package/src/lightning/tabset/tabset.html +2 -0
- package/src/lightning/tabset/tabset.js +25 -38
- package/src/lightning/tabset/tabset.js-meta.xml +3 -0
- package/src/lightning/tabset/tabset.slds.css +0 -2
- package/src/lightning/textarea/form-element.slds.css +54 -54
- package/src/lightning/textarea/textarea.js +11 -2
- package/src/lightning/textarea/textarea.slds.css +22 -9
- package/src/lightning/timepicker/form-element.slds.css +54 -54
- package/src/lightning/timepicker/timepicker.js-meta.xml +6 -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 +1 -1
- package/src/lightning/toast/icon.slds.css +12 -25
- package/src/lightning/toast/toast.js +15 -12
- package/src/lightning/toast/toast.slds.css +6 -18
- package/src/lightning/toastContainer/__docs__/toastContainer.md +3 -2
- package/src/lightning/toastContainer/toast.slds.css +6 -18
- package/src/lightning/toastContainer/toastContainer.js +25 -17
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +36 -24
- package/src/lightning/tree/tree.js +2 -0
- package/src/lightning/utils/classSet.js +9 -3
- package/src/lightning/utilsPrivate/formatUtils.js +158 -0
- package/src/lightning/utilsPrivate/textUtils.js +16 -0
- package/src/lightning/utilsPrivate/utilsPrivate.js +56 -15
- package/src/lightning/utilsPrivate/validationUtils.js +59 -0
- package/src/lightning/verticalNavigation/vertical-navigation.slds.css +14 -0
- package/src/lightning/verticalNavigation/verticalNavigation.css +1 -1
- package/src/lightning/verticalNavigation/verticalNavigation.html +1 -1
- package/src/lightning/verticalNavigation/verticalNavigation.js +66 -28
- package/src/lightning/verticalNavigation/verticalNavigation.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationItem/vertical-navigation-item.slds.css +63 -0
- package/src/lightning/verticalNavigationItem/verticalNavigationItem.css +2 -3
- package/src/lightning/verticalNavigationItem/verticalNavigationItem.js +29 -15
- package/src/lightning/verticalNavigationItem/verticalNavigationItem.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.native.css +2 -0
- package/src/lightning/verticalNavigationItem/verticalNavigationItem.lbc.synthetic.css +3 -0
- package/src/lightning/verticalNavigationItemBadge/badge.slds.css +76 -0
- package/src/lightning/verticalNavigationItemBadge/vertical-navigation-item.slds.css +63 -0
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.css +2 -3
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.html +1 -1
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js +28 -15
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.native.css +5 -0
- package/src/lightning/verticalNavigationItemBadge/verticalNavigationItemBadge.lbc.synthetic.css +3 -0
- package/src/lightning/verticalNavigationItemIcon/vertical-navigation-item.slds.css +63 -0
- package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.css +2 -3
- package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js +29 -15
- package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.native.css +3 -0
- package/src/lightning/verticalNavigationItemIcon/verticalNavigationItemIcon.lbc.synthetic.css +3 -0
- package/src/lightning/verticalNavigationOverflow/button.slds.css +503 -0
- package/src/lightning/verticalNavigationOverflow/vertical-navigation-item.slds.css +63 -0
- package/src/lightning/verticalNavigationOverflow/vertical-navigation-section.slds.css +17 -0
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.css +2 -1
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.html +2 -0
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js +18 -13
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationOverflow/verticalNavigationOverflow.lbc.native.css +5 -0
- package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +13 -15
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.js-meta.xml +3 -0
- package/src/lightning/datatable/__examples__/customDatatableWrapper/customDatatableWrapper.js +0 -158
- package/src/lightning/datatable/__examples__/customDatatypeDeleteRowBtn/customDatatypeDeleteRowBtn.html +0 -6
- package/src/lightning/datatable/__examples__/customDatatypeLink/customDatatypeLink.html +0 -9
- package/src/lightning/datatable/__examples__/customDatatypeRowOrderingBtn/customDatatypeRowOrderingBtn.js +0 -40
- package/src/lightning/datatable/__examples__/customDatatypeTable/customNumber.html +0 -3
- package/src/lightning/datatable/inlineEditShared.js +0 -26
- package/src/lightning/datatable/resizeSensor.js +0 -244
- package/src/lightning/formattedRichText/linkify.js +0 -43
- package/src/lightning/utilsPrivate/smartSetAttribute.js +0 -19
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatableWrapper/customDatatableWrapper.html +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeLink/customDatatypeLink.js +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.html +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeNumber/customDatatypeNumber.js +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customDatatypeTable.js +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customLink.html +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/customName.html +0 -0
- /package/src/lightning/datatable/{__examples__ → __examples__disabled}/customDatatypeTable/orderingButtons.html +0 -0
|
@@ -1,41 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startPositioning,
|
|
3
3
|
stopPositioning,
|
|
4
|
-
Direction,
|
|
4
|
+
Direction as DIRECTION,
|
|
5
5
|
} from 'lightning/positionLibrary';
|
|
6
6
|
import {
|
|
7
7
|
setFocusActiveCell,
|
|
8
8
|
reactToTabBackward,
|
|
9
9
|
reactToTabForward,
|
|
10
10
|
getActiveCellElement,
|
|
11
|
-
updateActiveCell,
|
|
12
11
|
isActiveCellEditable,
|
|
12
|
+
NAVIGATION_DIR,
|
|
13
13
|
isValidCell,
|
|
14
14
|
} from './keyboard';
|
|
15
|
+
import { updateRowsAndCellIndexes, isCellEditable } from './rows';
|
|
16
|
+
import { getStateColumnIndex } from './columns';
|
|
17
|
+
import { resetErrors } from './errors';
|
|
18
|
+
import { setAriaSelectedOnCell, unsetAriaSelectedOnCell } from './rowSelection';
|
|
15
19
|
import {
|
|
16
|
-
updateRowsAndCellIndexes,
|
|
17
|
-
getRowByKey,
|
|
18
|
-
getKeyField,
|
|
19
|
-
getUserRowByCellKeys,
|
|
20
|
-
isCellEditable,
|
|
21
|
-
} from './rows';
|
|
22
|
-
import {
|
|
23
|
-
getColumnIndexByColumnKey,
|
|
24
|
-
getColumns,
|
|
25
|
-
getStateColumnIndex,
|
|
26
|
-
getEditableColumns,
|
|
27
|
-
} from './columns';
|
|
28
|
-
import { setErrors } from './errors';
|
|
29
|
-
import {
|
|
30
|
-
setAriaSelectedOnCell,
|
|
31
|
-
unsetAriaSelectedOnCell,
|
|
32
|
-
isSelectedRow,
|
|
33
20
|
getCurrentSelectionLength,
|
|
34
21
|
getSelectedRowsKeys,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
isSelectedRow,
|
|
23
|
+
} from './rowSelectionShared';
|
|
24
|
+
import { hasOwnProperties } from 'lightning/utilsPrivate';
|
|
25
|
+
import { getRowByKey, getUserRowByCellKeys } from './indexes';
|
|
39
26
|
|
|
40
27
|
const IEDIT_PANEL_SELECTOR = '[data-iedit-panel="true"]';
|
|
41
28
|
const HIDE_PANEL_THRESHOLD = 5; // hide panel on scroll
|
|
@@ -60,10 +47,10 @@ export function handleEditCell(event) {
|
|
|
60
47
|
*/
|
|
61
48
|
export function handleInlineEditFinish(event) {
|
|
62
49
|
stopPanelPositioning(this);
|
|
63
|
-
|
|
64
50
|
const { reason, rowKeyValue, colKeyValue } = event.detail;
|
|
65
|
-
|
|
66
51
|
processInlineEditFinish(this, reason, rowKeyValue, colKeyValue);
|
|
52
|
+
// Set private draftValues var to new value
|
|
53
|
+
this._draftValues = this.draftValues;
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
/**
|
|
@@ -77,11 +64,12 @@ export function handleMassCheckboxChange(event) {
|
|
|
77
64
|
if (event.detail.checked) {
|
|
78
65
|
setAriaSelectedOnAllSelectedRows(state);
|
|
79
66
|
} else {
|
|
67
|
+
const { inlineEdit: inlineEditState } = state;
|
|
80
68
|
unsetAriaSelectedOnAllSelectedRows(this.state);
|
|
81
69
|
setAriaSelectedOnCell(
|
|
82
70
|
state,
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
inlineEditState.rowKeyValue,
|
|
72
|
+
inlineEditState.colKeyValue
|
|
85
73
|
);
|
|
86
74
|
}
|
|
87
75
|
}
|
|
@@ -98,30 +86,32 @@ export function handleMassCheckboxChange(event) {
|
|
|
98
86
|
* @returns
|
|
99
87
|
*/
|
|
100
88
|
export function handleInlineEditPanelScroll(event) {
|
|
101
|
-
const {
|
|
89
|
+
const { state } = this;
|
|
90
|
+
const { inlineEdit: inlineEditState } = state;
|
|
91
|
+
const { isPanelVisible } = inlineEditState;
|
|
102
92
|
|
|
103
93
|
if (!isPanelVisible) {
|
|
104
94
|
return;
|
|
105
95
|
}
|
|
106
96
|
|
|
107
97
|
let delta = 0;
|
|
108
|
-
const
|
|
98
|
+
const { target: scroller } = event;
|
|
109
99
|
|
|
110
|
-
// When user scrolls
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
if (this.
|
|
114
|
-
this.
|
|
100
|
+
// When user scrolls vertically.
|
|
101
|
+
if (scroller.classList.contains('slds-scrollable_y')) {
|
|
102
|
+
const scrollY = scroller.scrollTop;
|
|
103
|
+
if (this._lastScrollY == null) {
|
|
104
|
+
this._lastScrollY = scrollY;
|
|
115
105
|
} else {
|
|
116
|
-
delta = Math.abs(this.
|
|
106
|
+
delta = Math.abs(this._lastScrollY - scrollY);
|
|
117
107
|
}
|
|
118
108
|
} else {
|
|
119
|
-
// When user scrolls
|
|
120
|
-
const
|
|
121
|
-
if (this.
|
|
122
|
-
this.
|
|
109
|
+
// When user scrolls horizontally.
|
|
110
|
+
const scrollX = scroller.scrollLeft;
|
|
111
|
+
if (this._lastScrollX == null) {
|
|
112
|
+
this._lastScrollX = scrollX;
|
|
123
113
|
} else {
|
|
124
|
-
delta = Math.abs(this.
|
|
114
|
+
delta = Math.abs(this._lastScrollX - scrollX);
|
|
125
115
|
}
|
|
126
116
|
}
|
|
127
117
|
|
|
@@ -129,8 +119,9 @@ export function handleInlineEditPanelScroll(event) {
|
|
|
129
119
|
// reset stored scroll values, hide panel and
|
|
130
120
|
// process inline edit completion
|
|
131
121
|
if (delta > HIDE_PANEL_THRESHOLD) {
|
|
132
|
-
|
|
133
|
-
this.
|
|
122
|
+
const { rowKeyValue, colKeyValue } = inlineEditState;
|
|
123
|
+
this._lastScrollX = null;
|
|
124
|
+
this._lastScrollY = null;
|
|
134
125
|
stopPanelPositioning(this);
|
|
135
126
|
processInlineEditFinish(this, 'lost-focus', rowKeyValue, colKeyValue);
|
|
136
127
|
} else {
|
|
@@ -146,17 +137,14 @@ export function handleInlineEditPanelScroll(event) {
|
|
|
146
137
|
* Dispatches the `cellchange` event with the `draftValues` in the
|
|
147
138
|
* detail object.
|
|
148
139
|
*
|
|
149
|
-
* @param {Object}
|
|
150
|
-
* @param {Object}
|
|
140
|
+
* @param {Object} dt - The datatable instance
|
|
141
|
+
* @param {Object} changes - Object containing cell changes
|
|
151
142
|
*/
|
|
152
|
-
function dispatchCellChangeEvent(
|
|
153
|
-
|
|
143
|
+
function dispatchCellChangeEvent(dt, changes) {
|
|
144
|
+
dt.dispatchEvent(
|
|
154
145
|
new CustomEvent('cellchange', {
|
|
155
146
|
detail: {
|
|
156
|
-
draftValues: getResolvedCellChanges(
|
|
157
|
-
dtInstance.state,
|
|
158
|
-
cellChange
|
|
159
|
-
),
|
|
147
|
+
draftValues: getResolvedCellChanges(dt.state, changes),
|
|
160
148
|
},
|
|
161
149
|
})
|
|
162
150
|
);
|
|
@@ -165,17 +153,18 @@ function dispatchCellChangeEvent(dtInstance, cellChange) {
|
|
|
165
153
|
/************************** INLINE EDIT STATE MANAGEMENT **************************/
|
|
166
154
|
|
|
167
155
|
export function isInlineEditTriggered(state) {
|
|
168
|
-
return
|
|
156
|
+
return hasOwnProperties(state.inlineEdit.dirtyValues);
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
export function cancelInlineEdit(dt) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
160
|
+
const { state, _privateTypes } = dt;
|
|
161
|
+
resetErrors(state);
|
|
162
|
+
state.inlineEdit.dirtyValues = {};
|
|
163
|
+
updateRowsAndCellIndexes(state, _privateTypes);
|
|
175
164
|
}
|
|
176
165
|
|
|
177
166
|
export function closeInlineEdit(dt) {
|
|
178
|
-
const inlineEditState = dt.state
|
|
167
|
+
const { inlineEdit: inlineEditState } = dt.state;
|
|
179
168
|
|
|
180
169
|
if (inlineEditState.isPanelVisible) {
|
|
181
170
|
processInlineEditFinish(
|
|
@@ -213,71 +202,68 @@ export function closeInlineEdit(dt) {
|
|
|
213
202
|
*
|
|
214
203
|
* If the user inline edit panel lost focus, the datatable should react accordingly.
|
|
215
204
|
*
|
|
216
|
-
* @param {Object} dt - datatable instance
|
|
205
|
+
* @param {Object} dt - The datatable instance
|
|
217
206
|
* @param {string} reason - reason to finish the edit; valid reasons are: edit-canceled | lost-focus | tab-pressed | submit-action
|
|
218
207
|
* @param {string} rowKeyValue - row key of the edited cell
|
|
219
208
|
* @param {string} colKeyValue - column key of the edited cell
|
|
220
209
|
*/
|
|
221
210
|
function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
222
|
-
const state = dt
|
|
223
|
-
const inlineEditState = state
|
|
211
|
+
const { state, template } = dt;
|
|
212
|
+
const { inlineEdit: inlineEditState } = state;
|
|
224
213
|
|
|
225
214
|
const shouldSaveData =
|
|
215
|
+
isValidCell(state, rowKeyValue, colKeyValue) &&
|
|
226
216
|
reason !== 'edit-canceled' &&
|
|
227
|
-
!(
|
|
228
|
-
isValidCell(dt.state, rowKeyValue, colKeyValue);
|
|
217
|
+
!(reason === 'lost-focus' && inlineEditState.massEditEnabled);
|
|
229
218
|
|
|
230
219
|
if (shouldSaveData) {
|
|
231
|
-
const panel =
|
|
232
|
-
const editValue = panel.value;
|
|
220
|
+
const panel = template.querySelector(IEDIT_PANEL_SELECTOR);
|
|
233
221
|
const isValidEditValue = panel.validity.valid;
|
|
234
|
-
const updateAllSelectedRows = panel.isMassEditChecked;
|
|
235
222
|
const currentValue = getCellValue(state, rowKeyValue, colKeyValue);
|
|
223
|
+
const { isMassEditChecked: updateAllSelectedRows, value: editValue } =
|
|
224
|
+
panel;
|
|
236
225
|
|
|
237
226
|
if (
|
|
238
227
|
isValidEditValue &&
|
|
239
228
|
(editValue !== currentValue || updateAllSelectedRows)
|
|
240
229
|
) {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
230
|
+
const changes = {
|
|
231
|
+
[rowKeyValue]: {
|
|
232
|
+
[colKeyValue]: editValue,
|
|
233
|
+
},
|
|
234
|
+
};
|
|
245
235
|
if (updateAllSelectedRows) {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
236
|
+
const selectedRowsKeys = getSelectedRowsKeys(state);
|
|
237
|
+
for (let i = 0; i < selectedRowsKeys.length; i += 1) {
|
|
238
|
+
const otherRowKeyValue = selectedRowsKeys[i];
|
|
239
|
+
changes[otherRowKeyValue] = {
|
|
240
|
+
[colKeyValue]: editValue,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
251
243
|
}
|
|
252
244
|
|
|
253
|
-
updateDirtyValues(state,
|
|
254
|
-
|
|
255
|
-
dispatchCellChangeEvent(dt, cellChange);
|
|
245
|
+
updateDirtyValues(state, changes);
|
|
246
|
+
dispatchCellChangeEvent(dt, changes);
|
|
256
247
|
|
|
257
248
|
// TODO: do we need to update all rows in the dt or just the one that was modified?
|
|
258
|
-
updateRowsAndCellIndexes
|
|
249
|
+
updateRowsAndCellIndexes(state, dt._privateTypes);
|
|
259
250
|
}
|
|
260
251
|
}
|
|
261
252
|
|
|
262
253
|
if (reason !== 'lost-focus') {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
reactToTabBackward(dt.template, state);
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
default: {
|
|
273
|
-
setFocusActiveCell(dt.template, state, 0);
|
|
274
|
-
}
|
|
254
|
+
if (reason === 'tab-pressed-next') {
|
|
255
|
+
reactToTabForward(state, template);
|
|
256
|
+
} else if (reason === 'tab-pressed-prev') {
|
|
257
|
+
reactToTabBackward(state, template);
|
|
258
|
+
} else {
|
|
259
|
+
setFocusActiveCell(state, template, NAVIGATION_DIR.USE_CURRENT);
|
|
275
260
|
}
|
|
276
261
|
}
|
|
277
262
|
|
|
278
263
|
unsetAriaSelectedOnAllSelectedRows(state);
|
|
279
264
|
unsetAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
280
265
|
|
|
266
|
+
// Tracked state change.
|
|
281
267
|
inlineEditState.isPanelVisible = false;
|
|
282
268
|
}
|
|
283
269
|
|
|
@@ -302,45 +288,43 @@ function openInlineEdit(dt, target) {
|
|
|
302
288
|
startPanelPositioning(dt, target.parentElement);
|
|
303
289
|
|
|
304
290
|
const { state, template, privateTypes: types } = dt;
|
|
305
|
-
const inlineEdit = state
|
|
291
|
+
const { inlineEdit: inlineEditState } = state;
|
|
306
292
|
|
|
307
|
-
if (
|
|
293
|
+
if (inlineEditState.isPanelVisible) {
|
|
308
294
|
// A special case when we are trying to open a edit but we have one open. (click on another edit while editing)
|
|
309
295
|
// in this case we will need to process the values before re-open the edit panel with the new values or we may lose the edition.
|
|
310
296
|
processInlineEditFinish(
|
|
311
297
|
dt,
|
|
312
298
|
'lost-focus',
|
|
313
|
-
|
|
314
|
-
|
|
299
|
+
inlineEditState.rowKeyValue,
|
|
300
|
+
inlineEditState.colKeyValue
|
|
315
301
|
);
|
|
316
302
|
}
|
|
317
303
|
|
|
318
304
|
const { rowKeyValue, colKeyValue } = target;
|
|
319
|
-
|
|
320
|
-
inlineEdit.isPanelVisible = true;
|
|
321
|
-
inlineEdit.rowKeyValue = rowKeyValue;
|
|
322
|
-
inlineEdit.colKeyValue = colKeyValue;
|
|
323
|
-
|
|
324
|
-
inlineEdit.editedValue = getCellValue(state, rowKeyValue, colKeyValue);
|
|
325
|
-
inlineEdit.massEditSelectedRows = getCurrentSelectionLength(state);
|
|
326
|
-
inlineEdit.massEditEnabled =
|
|
327
|
-
isSelectedRow(state, rowKeyValue) &&
|
|
328
|
-
inlineEdit.massEditSelectedRows > 1;
|
|
329
|
-
|
|
330
|
-
// pass the column definition
|
|
331
305
|
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
306
|
+
const col = state.columns[colIndex];
|
|
307
|
+
|
|
308
|
+
inlineEditState.isPanelVisible = true;
|
|
309
|
+
inlineEditState.rowKeyValue = rowKeyValue;
|
|
310
|
+
inlineEditState.colKeyValue = colKeyValue;
|
|
311
|
+
inlineEditState.columnDef = col;
|
|
312
|
+
inlineEditState.editedValue = getCellValue(state, rowKeyValue, colKeyValue);
|
|
313
|
+
inlineEditState.massEditSelectedRows = getCurrentSelectionLength(state);
|
|
314
|
+
inlineEditState.massEditEnabled =
|
|
315
|
+
inlineEditState.massEditSelectedRows > 1 &&
|
|
316
|
+
isSelectedRow(state, rowKeyValue);
|
|
317
|
+
|
|
318
|
+
const { typeAttributes } = col || {};
|
|
319
|
+
if (typeAttributes) {
|
|
320
|
+
// When the inline edit panel is opened resolve the typeAttributes if available
|
|
321
|
+
// then assign the resolved values to inlineEdit.resolvedTypeAttributes.
|
|
322
|
+
inlineEditState.resolvedTypeAttributes = resolveNestedTypeAttributes(
|
|
339
323
|
state,
|
|
340
324
|
rowKeyValue,
|
|
341
325
|
colKeyValue,
|
|
342
326
|
types,
|
|
343
|
-
|
|
327
|
+
typeAttributes,
|
|
344
328
|
colIndex
|
|
345
329
|
);
|
|
346
330
|
}
|
|
@@ -357,8 +341,8 @@ function openInlineEdit(dt, target) {
|
|
|
357
341
|
processInlineEditFinish(
|
|
358
342
|
dt,
|
|
359
343
|
'edit-canceled',
|
|
360
|
-
|
|
361
|
-
|
|
344
|
+
inlineEditState.rowKeyValue,
|
|
345
|
+
inlineEditState.colKeyValue
|
|
362
346
|
);
|
|
363
347
|
} else {
|
|
364
348
|
// if panel can be edited, focus
|
|
@@ -378,20 +362,19 @@ function openInlineEdit(dt, target) {
|
|
|
378
362
|
* @param {Object} dt - The datatable instance. Must be a truthy and valid datatable reference.
|
|
379
363
|
*/
|
|
380
364
|
export function openInlineEditOnActiveCell(dt) {
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
if (!isActiveCellEditable(
|
|
365
|
+
const { state } = dt;
|
|
366
|
+
if (state.data && state.data.length > 0) {
|
|
367
|
+
if (!isActiveCellEditable(state)) {
|
|
384
368
|
const firstEditableCell = getFirstEditableCell(dt);
|
|
385
369
|
if (firstEditableCell) {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
firstEditableCell.
|
|
389
|
-
|
|
390
|
-
);
|
|
391
|
-
setFocusAndOpenInlineEdit(dt, dt.state.activeCell);
|
|
370
|
+
state.activeCell = {
|
|
371
|
+
rowKeyValue: firstEditableCell.rowKeyValue,
|
|
372
|
+
colKeyValue: firstEditableCell.colKeyValue,
|
|
373
|
+
};
|
|
374
|
+
setFocusAndOpenInlineEdit(dt);
|
|
392
375
|
}
|
|
393
376
|
} else {
|
|
394
|
-
setFocusAndOpenInlineEdit(dt
|
|
377
|
+
setFocusAndOpenInlineEdit(dt);
|
|
395
378
|
}
|
|
396
379
|
}
|
|
397
380
|
}
|
|
@@ -403,9 +386,10 @@ export function openInlineEditOnActiveCell(dt) {
|
|
|
403
386
|
*/
|
|
404
387
|
// eslint-disable-next-line @lwc/lwc/no-async-await
|
|
405
388
|
async function setFocusAndOpenInlineEdit(dt) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
389
|
+
const { state, template } = dt;
|
|
390
|
+
await setFocusActiveCell(state, template, NAVIGATION_DIR.USE_CURRENT);
|
|
391
|
+
const cellElement = getActiveCellElement(template, state);
|
|
392
|
+
openInlineEdit(dt, cellElement);
|
|
409
393
|
}
|
|
410
394
|
|
|
411
395
|
/************************** PANEL POSITIONING **************************/
|
|
@@ -422,39 +406,40 @@ async function setFocusAndOpenInlineEdit(dt) {
|
|
|
422
406
|
* - horizontal - Left -> align panel to left edge of cell
|
|
423
407
|
* - vertical - Top -> align panel to top of the cell
|
|
424
408
|
*
|
|
425
|
-
* @param {Object} dt - datatable instance
|
|
426
|
-
* @param {HTMLElement}
|
|
409
|
+
* @param {Object} dt - The datatable instance
|
|
410
|
+
* @param {HTMLElement} cellElement - The cell element on which inline edit should open
|
|
427
411
|
*/
|
|
428
|
-
function startPanelPositioning(dt,
|
|
412
|
+
function startPanelPositioning(dt, cellElement) {
|
|
429
413
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
430
414
|
requestAnimationFrame(() => {
|
|
431
415
|
// we need to discard previous binding otherwise the panel
|
|
432
416
|
// will retain previous alignment
|
|
433
417
|
stopPanelPositioning(dt);
|
|
434
418
|
|
|
435
|
-
dt.
|
|
436
|
-
target,
|
|
437
|
-
element
|
|
438
|
-
dt.template
|
|
439
|
-
|
|
440
|
-
|
|
419
|
+
dt._positionRelationship = startPositioning(dt, {
|
|
420
|
+
target: cellElement,
|
|
421
|
+
element() {
|
|
422
|
+
const panel = dt.template.querySelector(IEDIT_PANEL_SELECTOR);
|
|
423
|
+
return panel.getPositionedElement();
|
|
424
|
+
},
|
|
425
|
+
autoFlip: true,
|
|
441
426
|
align: {
|
|
442
|
-
horizontal:
|
|
443
|
-
vertical:
|
|
427
|
+
horizontal: DIRECTION.Left,
|
|
428
|
+
vertical: DIRECTION.Top,
|
|
444
429
|
},
|
|
445
430
|
targetAlign: {
|
|
446
|
-
horizontal:
|
|
447
|
-
vertical:
|
|
431
|
+
horizontal: DIRECTION.Left,
|
|
432
|
+
vertical: DIRECTION.Top,
|
|
448
433
|
},
|
|
449
|
-
autoFlip: true,
|
|
450
434
|
});
|
|
451
435
|
});
|
|
452
436
|
}
|
|
453
437
|
|
|
454
438
|
function stopPanelPositioning(dt) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
439
|
+
const { _positionRelationship } = dt;
|
|
440
|
+
if (_positionRelationship) {
|
|
441
|
+
stopPositioning(_positionRelationship);
|
|
442
|
+
dt._positionRelationship = null;
|
|
458
443
|
}
|
|
459
444
|
}
|
|
460
445
|
|
|
@@ -462,13 +447,14 @@ function stopPanelPositioning(dt) {
|
|
|
462
447
|
* Repositions the inline edit panel. this does not realign the element,
|
|
463
448
|
* so it doesn't fix alignment when size of panel changes
|
|
464
449
|
*
|
|
465
|
-
* @param {Object} dt - datatable instance
|
|
450
|
+
* @param {Object} dt - The datatable instance
|
|
466
451
|
*/
|
|
467
452
|
function repositionPanel(dt) {
|
|
468
453
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
469
454
|
requestAnimationFrame(() => {
|
|
470
|
-
|
|
471
|
-
|
|
455
|
+
const { _positionRelationship } = dt;
|
|
456
|
+
if (_positionRelationship) {
|
|
457
|
+
_positionRelationship.reposition();
|
|
472
458
|
}
|
|
473
459
|
});
|
|
474
460
|
}
|
|
@@ -476,7 +462,7 @@ function repositionPanel(dt) {
|
|
|
476
462
|
/************************** DIRTY/UNSAVED VALUES **************************/
|
|
477
463
|
|
|
478
464
|
/**
|
|
479
|
-
* @param {Object} state -
|
|
465
|
+
* @param {Object} state - The datatable state
|
|
480
466
|
* @returns {Array} - An array of objects, each object describing the dirty values in the form { colName : dirtyValue }.
|
|
481
467
|
* A special key is the { [keyField]: value } pair used to identify the row containing this changed values.
|
|
482
468
|
* The returned array will be in the form - [{colName : dirtyValue, ... , [keyField]: value }, {...}, {...}]
|
|
@@ -488,84 +474,59 @@ export function getDirtyValues(state) {
|
|
|
488
474
|
/**
|
|
489
475
|
* Sets the dirty values in the datatable.
|
|
490
476
|
*
|
|
491
|
-
* @param {Object} state
|
|
492
|
-
* @param {Array}
|
|
477
|
+
* @param {Object} state The datatable state
|
|
478
|
+
* @param {Array} values An untracked array of objects, each object describing the dirty values in the form { colName : dirtyValue }.
|
|
493
479
|
* A special key is the { [keyField]: value } pair used to identify the row containing this changed values.
|
|
494
480
|
*/
|
|
495
|
-
export function setDirtyValues(state,
|
|
496
|
-
const keyField =
|
|
497
|
-
const dirtyValues = Array.isArray(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
dirtyValues[rowKey] = {};
|
|
481
|
+
export function setDirtyValues(state, values) {
|
|
482
|
+
const { columns, keyField } = state;
|
|
483
|
+
const dirtyValues = Array.isArray(values) ? values : [];
|
|
484
|
+
const result = {};
|
|
485
|
+
for (let dirtyIndex = 0; dirtyIndex < dirtyValues.length; dirtyIndex += 1) {
|
|
486
|
+
const rowValues = dirtyValues[dirtyIndex];
|
|
487
|
+
const colKeys = Object.keys(rowValues);
|
|
488
|
+
const colChanges = {};
|
|
489
|
+
for (
|
|
490
|
+
let colKeysIndex = 0, { length: colKeysLength } = colKeys;
|
|
491
|
+
colKeysIndex < colKeysLength;
|
|
492
|
+
colKeysIndex += 1
|
|
493
|
+
) {
|
|
494
|
+
const externalColKeyValue = colKeys[colKeysIndex];
|
|
495
|
+
for (let colIndex = 0; colIndex < columns.length; colIndex += 1) {
|
|
496
|
+
const col = columns[colIndex];
|
|
497
|
+
if (
|
|
498
|
+
col.columnKey === externalColKeyValue ||
|
|
499
|
+
(!col.columnKey && col.fieldName === externalColKeyValue)
|
|
500
|
+
) {
|
|
501
|
+
colChanges[col.colKeyValue] =
|
|
502
|
+
rowValues[externalColKeyValue];
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
521
506
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}
|
|
507
|
+
delete colChanges[keyField];
|
|
508
|
+
result[rowValues[keyField]] = colChanges;
|
|
509
|
+
}
|
|
510
|
+
state.inlineEdit.dirtyValues = result;
|
|
525
511
|
}
|
|
526
512
|
|
|
527
513
|
/**
|
|
528
|
-
*
|
|
529
|
-
* be referenced by the column key value. It follows this format:
|
|
530
|
-
* { <colKeyValue: "<editedValue>"> }; Ex. { "name-text-2": "My changes" }
|
|
514
|
+
* Updates the dirty values specified in the `changes` object.
|
|
531
515
|
*
|
|
532
|
-
* @param {Object} state - datatable
|
|
533
|
-
* @param {Object} changes -
|
|
534
|
-
* @returns {Object} - changes in a column that can be referenced by the column key
|
|
516
|
+
* @param {Object} state - The datatable state
|
|
517
|
+
* @param {Object} changes - An object in the form of { rowKeyValue: { colKeyValue1: value, ..., colKeyValueN: value } ... }
|
|
535
518
|
*/
|
|
536
|
-
function
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
if (
|
|
542
|
-
|
|
543
|
-
result[colKey] = changes[externalColumnKey];
|
|
519
|
+
function updateDirtyValues(state, changes) {
|
|
520
|
+
const dirtyValues = state.inlineEdit.dirtyValues;
|
|
521
|
+
const rowKeys = Object.keys(changes);
|
|
522
|
+
for (let rowKeyIndex = 0; rowKeyIndex < rowKeys.length; rowKeyIndex += 1) {
|
|
523
|
+
const rowKeyValue = rowKeys[rowKeyIndex];
|
|
524
|
+
if (!Object.prototype.hasOwnProperty.call(dirtyValues, rowKeyValue)) {
|
|
525
|
+
dirtyValues[rowKeyValue] = {};
|
|
544
526
|
}
|
|
545
527
|
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Retrieves the changes in cells in a particular column
|
|
552
|
-
* Returns an object where each item follows this format:
|
|
553
|
-
* { <columnName>: "<changes>"} -> Ex. { name: "My changes" }
|
|
554
|
-
*
|
|
555
|
-
* @param {Object} state - Datatable state
|
|
556
|
-
* @param {Object} changes - The internal representation of changes in a row
|
|
557
|
-
* @returns {Object} - the list of customer changes in a column
|
|
558
|
-
*/
|
|
559
|
-
function getCellChangesByColumn(state, changes) {
|
|
560
|
-
return Object.keys(changes).reduce((result, colKey) => {
|
|
561
|
-
const columns = getColumns(state);
|
|
562
|
-
const columnIndex = getStateColumnIndex(state, colKey);
|
|
563
|
-
const columnDef = columns[columnIndex];
|
|
564
|
-
|
|
565
|
-
result[columnDef.columnKey || columnDef.fieldName] = changes[colKey];
|
|
566
|
-
|
|
567
|
-
return result;
|
|
568
|
-
}, {});
|
|
528
|
+
Object.assign(dirtyValues[rowKeyValue], changes[rowKeyValue]);
|
|
529
|
+
}
|
|
569
530
|
}
|
|
570
531
|
|
|
571
532
|
/**
|
|
@@ -577,26 +538,47 @@ function getCellChangesByColumn(state, changes) {
|
|
|
577
538
|
* Ex. [{ name: "My changes", id: "2" }]; where column name is 'name' and 'id' is the keyField
|
|
578
539
|
* The keyField can be used to identify the row.
|
|
579
540
|
*
|
|
580
|
-
* @param {Object} state - datatable state
|
|
581
|
-
* @param {Object}
|
|
541
|
+
* @param {Object} state - The datatable state
|
|
542
|
+
* @param {Object} rowChanges - list of cell changes to be resolved
|
|
582
543
|
* @returns {Array} - array containing changes and identifiers of column and row where the changes
|
|
583
544
|
* should be applied
|
|
584
545
|
*/
|
|
585
|
-
function getResolvedCellChanges(state,
|
|
586
|
-
const keyField =
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
546
|
+
function getResolvedCellChanges(state, rowChanges) {
|
|
547
|
+
const { columns, keyField } = state;
|
|
548
|
+
const result = [];
|
|
549
|
+
const changeRowKeys = Object.keys(rowChanges);
|
|
550
|
+
for (
|
|
551
|
+
let changeRowIndex = 0, { length: changeRowCount } = changeRowKeys;
|
|
552
|
+
changeRowIndex < changeRowCount;
|
|
553
|
+
changeRowIndex += 1
|
|
554
|
+
) {
|
|
555
|
+
const rowKeyValue = changeRowKeys[changeRowIndex];
|
|
556
|
+
const colChanges = rowChanges[rowKeyValue];
|
|
557
|
+
const changeColKeys = Object.keys(colChanges);
|
|
558
|
+
const { length: changeColCount } = changeColKeys;
|
|
559
|
+
if (changeColCount) {
|
|
560
|
+
const cellChanges = {
|
|
561
|
+
// Add identifier for which row has change
|
|
562
|
+
[keyField]: rowKeyValue,
|
|
563
|
+
};
|
|
564
|
+
// Get the changes made by column
|
|
565
|
+
for (
|
|
566
|
+
let changeColIndex = 0;
|
|
567
|
+
changeColIndex < changeColCount;
|
|
568
|
+
changeColIndex += 1
|
|
569
|
+
) {
|
|
570
|
+
const colKeyValue = changeColKeys[changeColIndex];
|
|
571
|
+
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
572
|
+
if (colIndex !== -1) {
|
|
573
|
+
const col = columns[colIndex];
|
|
574
|
+
cellChanges[col.columnKey || col.fieldName] =
|
|
575
|
+
colChanges[colKeyValue];
|
|
576
|
+
}
|
|
577
|
+
}
|
|
595
578
|
result.push(cellChanges);
|
|
596
579
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}, []);
|
|
580
|
+
}
|
|
581
|
+
return result;
|
|
600
582
|
}
|
|
601
583
|
|
|
602
584
|
/************************** TYPE ATTRIBUTES RESOLUTION **************************/
|
|
@@ -604,53 +586,49 @@ function getResolvedCellChanges(state, changes) {
|
|
|
604
586
|
/**
|
|
605
587
|
* Returns the resolved typeAttributes
|
|
606
588
|
*
|
|
607
|
-
* @param {Object} state -
|
|
608
|
-
* @param {String} rowKeyValue - row key
|
|
609
|
-
* @param {String} colKeyValue - column key
|
|
610
|
-
* @param {
|
|
611
|
-
* @param {
|
|
612
|
-
* @param {
|
|
589
|
+
* @param {Object} state - The datatable state
|
|
590
|
+
* @param {String} rowKeyValue - The row key
|
|
591
|
+
* @param {String} colKeyValue - The column key
|
|
592
|
+
* @param {Object} types - The type handling factory
|
|
593
|
+
* @param {Object} typeAttributes - values of typeAttributes from column definition
|
|
594
|
+
* @param {Number} colIndex - The column index
|
|
613
595
|
*
|
|
614
|
-
* @returns {Object}
|
|
596
|
+
* @returns {Object} The resolved typeAttributes.
|
|
615
597
|
*/
|
|
616
598
|
export function resolveNestedTypeAttributes(
|
|
617
599
|
state,
|
|
618
600
|
rowKeyValue,
|
|
619
601
|
colKeyValue,
|
|
620
602
|
types,
|
|
621
|
-
|
|
622
|
-
|
|
603
|
+
typeAttributes,
|
|
604
|
+
colIndex
|
|
623
605
|
) {
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
606
|
+
const col = state.columns[colIndex];
|
|
607
|
+
const typeDesc = typeAttributes && types.getType(col.type);
|
|
608
|
+
const attributeNames = typeDesc && typeDesc.typeAttributes;
|
|
609
|
+
// Check if attrValue and typeAttributes are available.
|
|
610
|
+
if (attributeNames) {
|
|
611
|
+
const resolvedTypeAttributes = {};
|
|
612
|
+
const { length: attributeNamesLength } = attributeNames;
|
|
613
|
+
const _rowData = getUserRowByCellKeys(state, rowKeyValue, colKeyValue);
|
|
631
614
|
// We only want to resolve typeAttributes based on the custom types configuration
|
|
632
|
-
// If the attribute is not in that configuration, the value of
|
|
615
|
+
// If the attribute is not in that configuration, the value of attrValue
|
|
633
616
|
// for that will be undefined. This behavior is consistent with view cell.
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
resolvedTypeAttributes[typeAttributeName] =
|
|
641
|
-
resolveNestedTypeAttributesHelper(
|
|
642
|
-
rowData,
|
|
643
|
-
typeAttributesValue
|
|
644
|
-
);
|
|
617
|
+
for (let i = 0; i < attributeNamesLength; i += 1) {
|
|
618
|
+
const attrName = attributeNames[i];
|
|
619
|
+
const attrValue = typeAttributes[attrName];
|
|
620
|
+
if (attrValue) {
|
|
621
|
+
resolvedTypeAttributes[attrName] =
|
|
622
|
+
resolveNestedTypeAttributesHelper(_rowData, attrValue);
|
|
645
623
|
}
|
|
646
|
-
}
|
|
624
|
+
}
|
|
647
625
|
return resolvedTypeAttributes;
|
|
648
626
|
}
|
|
649
|
-
return
|
|
627
|
+
return typeAttributes;
|
|
650
628
|
}
|
|
651
629
|
|
|
652
630
|
/**
|
|
653
|
-
* Helper function to recursively traverse and resolve the nested
|
|
631
|
+
* Helper function to recursively traverse and resolve the nested attrValue object.
|
|
654
632
|
* For example, resolve {
|
|
655
633
|
* editTypeAttributes: {
|
|
656
634
|
* value: {
|
|
@@ -665,48 +643,44 @@ export function resolveNestedTypeAttributes(
|
|
|
665
643
|
* }
|
|
666
644
|
* }
|
|
667
645
|
*/
|
|
668
|
-
function resolveNestedTypeAttributesHelper(rowData,
|
|
646
|
+
function resolveNestedTypeAttributesHelper(rowData, attrValue) {
|
|
669
647
|
let resolvedTypeAttributes = {};
|
|
670
|
-
if (
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
648
|
+
if (!(typeof attrValue === 'object' && attrValue !== null)) {
|
|
649
|
+
// Primitive value.
|
|
650
|
+
// For example, if the typeAttributes is { count: 5},
|
|
651
|
+
// 5 will be the attrValue passed in to the function.
|
|
652
|
+
// nothing needs to be resolved, just return it.
|
|
653
|
+
return attrValue === undefined ? resolvedTypeAttributes : attrValue;
|
|
654
|
+
}
|
|
655
|
+
const typeAttributesNames = Object.keys(attrValue);
|
|
656
|
+
for (let i = 0, { length } = typeAttributesNames; i < length; i += 1) {
|
|
657
|
+
const name = typeAttributesNames[i];
|
|
658
|
+
const value = attrValue[name];
|
|
659
|
+
if (value !== undefined) {
|
|
660
|
+
// since resolveNestedTypeAttributes will be creating the top level attribute
|
|
661
|
+
// and we resolve values while creating the new object, the attrValue passed in
|
|
662
|
+
// could be something like {fieldName: 'someField'}.
|
|
663
|
+
// For example, if the typeAttributes is { targetName: {fieldName: 'name'}},
|
|
664
|
+
// {fieldName: 'name'} will be the attrValue passed in to the function,
|
|
665
|
+
// so we need to check if key is 'fieldName' or not and resolve it immediately.
|
|
666
|
+
if (name === 'fieldName') {
|
|
667
|
+
resolvedTypeAttributes = rowData[value];
|
|
668
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
669
|
+
// This is the case when attrValue is something like {label: {fieldName: 'name'}}.
|
|
670
|
+
// It's an object but the value maps a field name
|
|
671
|
+
const { fieldName } = value;
|
|
672
|
+
if (fieldName) {
|
|
673
|
+
resolvedTypeAttributes[name] = rowData[fieldName];
|
|
674
|
+
} else {
|
|
675
|
+
// Nested object case, need to recursively resolve it.
|
|
676
|
+
// For example, { targetName: {value: {fieldName: 'name'}}}}.
|
|
677
|
+
resolvedTypeAttributes[name] =
|
|
678
|
+
resolveNestedTypeAttributesHelper(rowData, value);
|
|
702
679
|
}
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
// 5 will be the typeAttributesValue passed in to the function.
|
|
708
|
-
// nothing needs to be resolved, just return it.
|
|
709
|
-
return typeAttributesValue;
|
|
680
|
+
} else {
|
|
681
|
+
// Primitive value
|
|
682
|
+
resolvedTypeAttributes[name] = value;
|
|
683
|
+
}
|
|
710
684
|
}
|
|
711
685
|
}
|
|
712
686
|
|
|
@@ -722,19 +696,28 @@ function resolveNestedTypeAttributesHelper(rowData, typeAttributesValue) {
|
|
|
722
696
|
* @param {Object} dt - The datatable instance. Must be a truthy and valid datatable reference.
|
|
723
697
|
*/
|
|
724
698
|
function getFirstEditableCell(dt) {
|
|
725
|
-
const
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
699
|
+
const { state } = dt;
|
|
700
|
+
const { columns } = state;
|
|
701
|
+
const editableColumns = [];
|
|
702
|
+
for (let i = 0, { length } = columns; i < length; i += 1) {
|
|
703
|
+
const col = columns[i];
|
|
704
|
+
if (col.editable) {
|
|
705
|
+
editableColumns.push(col);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
const { length: editableColumnsLength } = editableColumns;
|
|
709
|
+
if (editableColumnsLength > 0) {
|
|
710
|
+
const { rows } = state;
|
|
711
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
712
|
+
const { key: rowKeyValue } = rows[rowIndex];
|
|
713
|
+
for (let i = 0; i < editableColumnsLength; i += 1) {
|
|
714
|
+
// Loop through the editable columns in order and examine the
|
|
715
|
+
// corresponding cells in the current row for editability,
|
|
716
|
+
// returning the first such cell that is editable.
|
|
734
717
|
const editableColumn = editableColumns[i];
|
|
735
718
|
if (isCellEditable(rows[rowIndex], editableColumn)) {
|
|
736
719
|
return {
|
|
737
|
-
rowKeyValue
|
|
720
|
+
rowKeyValue,
|
|
738
721
|
colKeyValue: editableColumn.colKeyValue,
|
|
739
722
|
};
|
|
740
723
|
}
|
|
@@ -769,11 +752,14 @@ function getCellValue(state, rowKeyValue, colKeyValue) {
|
|
|
769
752
|
*/
|
|
770
753
|
function setAriaSelectedOnAllSelectedRows(state) {
|
|
771
754
|
const { colKeyValue } = state.inlineEdit;
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
755
|
+
const { selectedRowsKeys } = state;
|
|
756
|
+
const keys = Object.keys(selectedRowsKeys);
|
|
757
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
758
|
+
const rowKeyValue = keys[i];
|
|
759
|
+
if (selectedRowsKeys[rowKeyValue]) {
|
|
760
|
+
setAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
777
763
|
}
|
|
778
764
|
|
|
779
765
|
/**
|
|
@@ -784,9 +770,12 @@ function setAriaSelectedOnAllSelectedRows(state) {
|
|
|
784
770
|
*/
|
|
785
771
|
function unsetAriaSelectedOnAllSelectedRows(state) {
|
|
786
772
|
const { colKeyValue } = state.inlineEdit;
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
773
|
+
const { selectedRowsKeys } = state;
|
|
774
|
+
const keys = Object.keys(selectedRowsKeys);
|
|
775
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
776
|
+
const rowKeyValue = keys[i];
|
|
777
|
+
if (selectedRowsKeys[rowKeyValue]) {
|
|
778
|
+
unsetAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
792
781
|
}
|