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
|
@@ -60,9 +60,7 @@ export function handleEditCell(event) {
|
|
|
60
60
|
*/
|
|
61
61
|
export function handleInlineEditFinish(event) {
|
|
62
62
|
stopPanelPositioning(this);
|
|
63
|
-
|
|
64
63
|
const { reason, rowKeyValue, colKeyValue } = event.detail;
|
|
65
|
-
|
|
66
64
|
processInlineEditFinish(this, reason, rowKeyValue, colKeyValue);
|
|
67
65
|
}
|
|
68
66
|
|
|
@@ -77,11 +75,12 @@ export function handleMassCheckboxChange(event) {
|
|
|
77
75
|
if (event.detail.checked) {
|
|
78
76
|
setAriaSelectedOnAllSelectedRows(state);
|
|
79
77
|
} else {
|
|
78
|
+
const { inlineEdit: inlineEditState } = state;
|
|
80
79
|
unsetAriaSelectedOnAllSelectedRows(this.state);
|
|
81
80
|
setAriaSelectedOnCell(
|
|
82
81
|
state,
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
inlineEditState.rowKeyValue,
|
|
83
|
+
inlineEditState.colKeyValue
|
|
85
84
|
);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
@@ -98,30 +97,32 @@ export function handleMassCheckboxChange(event) {
|
|
|
98
97
|
* @returns
|
|
99
98
|
*/
|
|
100
99
|
export function handleInlineEditPanelScroll(event) {
|
|
101
|
-
const {
|
|
100
|
+
const { state } = this;
|
|
101
|
+
const { inlineEdit: inlineEditState } = state;
|
|
102
|
+
const { isPanelVisible } = inlineEditState;
|
|
102
103
|
|
|
103
104
|
if (!isPanelVisible) {
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
let delta = 0;
|
|
108
|
-
const
|
|
109
|
+
const { target: scroller } = event;
|
|
109
110
|
|
|
110
111
|
// When user scrolls horizontally
|
|
111
|
-
if (
|
|
112
|
-
const scrollX =
|
|
113
|
-
if (this.
|
|
114
|
-
this.
|
|
112
|
+
if (scroller.classList.contains('slds-scrollable_x')) {
|
|
113
|
+
const scrollX = scroller.scrollLeft;
|
|
114
|
+
if (this._lastScrollX == null) {
|
|
115
|
+
this._lastScrollX = scrollX;
|
|
115
116
|
} else {
|
|
116
|
-
delta = Math.abs(this.
|
|
117
|
+
delta = Math.abs(this._lastScrollX - scrollX);
|
|
117
118
|
}
|
|
118
119
|
} else {
|
|
119
120
|
// When user scrolls vertically
|
|
120
|
-
const scrollY =
|
|
121
|
-
if (this.
|
|
122
|
-
this.
|
|
121
|
+
const scrollY = scroller.scrollTop;
|
|
122
|
+
if (this._lastScrollY == null) {
|
|
123
|
+
this._lastScrollY = scrollY;
|
|
123
124
|
} else {
|
|
124
|
-
delta = Math.abs(this.
|
|
125
|
+
delta = Math.abs(this._lastScrollY - scrollY);
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
|
|
@@ -129,8 +130,9 @@ export function handleInlineEditPanelScroll(event) {
|
|
|
129
130
|
// reset stored scroll values, hide panel and
|
|
130
131
|
// process inline edit completion
|
|
131
132
|
if (delta > HIDE_PANEL_THRESHOLD) {
|
|
132
|
-
|
|
133
|
-
this.
|
|
133
|
+
const { rowKeyValue, colKeyValue } = inlineEditState;
|
|
134
|
+
this._lastScrollX = null;
|
|
135
|
+
this._lastScrollY = null;
|
|
134
136
|
stopPanelPositioning(this);
|
|
135
137
|
processInlineEditFinish(this, 'lost-focus', rowKeyValue, colKeyValue);
|
|
136
138
|
} else {
|
|
@@ -146,17 +148,14 @@ export function handleInlineEditPanelScroll(event) {
|
|
|
146
148
|
* Dispatches the `cellchange` event with the `draftValues` in the
|
|
147
149
|
* detail object.
|
|
148
150
|
*
|
|
149
|
-
* @param {Object}
|
|
151
|
+
* @param {Object} dt - datatable instance
|
|
150
152
|
* @param {Object} cellChange - object containing cell changes
|
|
151
153
|
*/
|
|
152
|
-
function dispatchCellChangeEvent(
|
|
153
|
-
|
|
154
|
+
function dispatchCellChangeEvent(dt, cellChange) {
|
|
155
|
+
dt.dispatchEvent(
|
|
154
156
|
new CustomEvent('cellchange', {
|
|
155
157
|
detail: {
|
|
156
|
-
draftValues: getResolvedCellChanges(
|
|
157
|
-
dtInstance.state,
|
|
158
|
-
cellChange
|
|
159
|
-
),
|
|
158
|
+
draftValues: getResolvedCellChanges(dt.state, cellChange),
|
|
160
159
|
},
|
|
161
160
|
})
|
|
162
161
|
);
|
|
@@ -175,7 +174,7 @@ export function cancelInlineEdit(dt) {
|
|
|
175
174
|
}
|
|
176
175
|
|
|
177
176
|
export function closeInlineEdit(dt) {
|
|
178
|
-
const inlineEditState = dt.state
|
|
177
|
+
const { inlineEdit: inlineEditState } = dt.state;
|
|
179
178
|
|
|
180
179
|
if (inlineEditState.isPanelVisible) {
|
|
181
180
|
processInlineEditFinish(
|
|
@@ -213,46 +212,49 @@ export function closeInlineEdit(dt) {
|
|
|
213
212
|
*
|
|
214
213
|
* If the user inline edit panel lost focus, the datatable should react accordingly.
|
|
215
214
|
*
|
|
216
|
-
* @param {Object} dt - datatable instance
|
|
215
|
+
* @param {Object} dt - The datatable instance
|
|
217
216
|
* @param {string} reason - reason to finish the edit; valid reasons are: edit-canceled | lost-focus | tab-pressed | submit-action
|
|
218
217
|
* @param {string} rowKeyValue - row key of the edited cell
|
|
219
218
|
* @param {string} colKeyValue - column key of the edited cell
|
|
220
219
|
*/
|
|
221
220
|
function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
222
|
-
const state = dt
|
|
223
|
-
const inlineEditState = state
|
|
221
|
+
const { state, template } = dt;
|
|
222
|
+
const { inlineEdit: inlineEditState } = state;
|
|
224
223
|
|
|
225
224
|
const shouldSaveData =
|
|
225
|
+
isValidCell(state, rowKeyValue, colKeyValue) &&
|
|
226
226
|
reason !== 'edit-canceled' &&
|
|
227
|
-
!(inlineEditState.massEditEnabled && reason === 'lost-focus')
|
|
228
|
-
isValidCell(dt.state, rowKeyValue, colKeyValue);
|
|
227
|
+
!(inlineEditState.massEditEnabled && reason === 'lost-focus');
|
|
229
228
|
|
|
230
229
|
if (shouldSaveData) {
|
|
231
|
-
const panel =
|
|
232
|
-
const editValue = panel.value;
|
|
230
|
+
const panel = template.querySelector(IEDIT_PANEL_SELECTOR);
|
|
233
231
|
const isValidEditValue = panel.validity.valid;
|
|
234
|
-
const updateAllSelectedRows = panel.isMassEditChecked;
|
|
235
232
|
const currentValue = getCellValue(state, rowKeyValue, colKeyValue);
|
|
233
|
+
const { isMassEditChecked: updateAllSelectedRows, value: editValue } =
|
|
234
|
+
panel;
|
|
236
235
|
|
|
237
236
|
if (
|
|
238
237
|
isValidEditValue &&
|
|
239
238
|
(editValue !== currentValue || updateAllSelectedRows)
|
|
240
239
|
) {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
const changes = {
|
|
241
|
+
[rowKeyValue]: {
|
|
242
|
+
[colKeyValue]: editValue,
|
|
243
|
+
},
|
|
244
|
+
};
|
|
244
245
|
|
|
245
246
|
if (updateAllSelectedRows) {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
const selectedRowsKeys = getSelectedRowsKeys(state);
|
|
248
|
+
for (let i = 0; i < selectedRowsKeys.length; i += 1) {
|
|
249
|
+
const otherRowKeyValue = selectedRowsKeys[i];
|
|
250
|
+
changes[otherRowKeyValue] = {
|
|
251
|
+
[colKeyValue]: editValue,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
251
254
|
}
|
|
252
255
|
|
|
253
|
-
updateDirtyValues(state,
|
|
254
|
-
|
|
255
|
-
dispatchCellChangeEvent(dt, cellChange);
|
|
256
|
+
updateDirtyValues(state, changes);
|
|
257
|
+
dispatchCellChangeEvent(dt, changes);
|
|
256
258
|
|
|
257
259
|
// TODO: do we need to update all rows in the dt or just the one that was modified?
|
|
258
260
|
updateRowsAndCellIndexes.call(dt);
|
|
@@ -260,24 +262,19 @@ function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
|
260
262
|
}
|
|
261
263
|
|
|
262
264
|
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
|
-
}
|
|
265
|
+
if (reason === 'tab-pressed-next') {
|
|
266
|
+
reactToTabForward(template, state);
|
|
267
|
+
} else if (reason === 'tab-pressed-prev') {
|
|
268
|
+
reactToTabBackward(template, state);
|
|
269
|
+
} else {
|
|
270
|
+
setFocusActiveCell(template, state, 0);
|
|
275
271
|
}
|
|
276
272
|
}
|
|
277
273
|
|
|
278
274
|
unsetAriaSelectedOnAllSelectedRows(state);
|
|
279
275
|
unsetAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
280
276
|
|
|
277
|
+
// Tracked state change.
|
|
281
278
|
inlineEditState.isPanelVisible = false;
|
|
282
279
|
}
|
|
283
280
|
|
|
@@ -302,45 +299,43 @@ function openInlineEdit(dt, target) {
|
|
|
302
299
|
startPanelPositioning(dt, target.parentElement);
|
|
303
300
|
|
|
304
301
|
const { state, template, privateTypes: types } = dt;
|
|
305
|
-
const inlineEdit = state
|
|
302
|
+
const { inlineEdit: inlineEditState } = state;
|
|
306
303
|
|
|
307
|
-
if (
|
|
304
|
+
if (inlineEditState.isPanelVisible) {
|
|
308
305
|
// A special case when we are trying to open a edit but we have one open. (click on another edit while editing)
|
|
309
306
|
// 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
307
|
processInlineEditFinish(
|
|
311
308
|
dt,
|
|
312
309
|
'lost-focus',
|
|
313
|
-
|
|
314
|
-
|
|
310
|
+
inlineEditState.rowKeyValue,
|
|
311
|
+
inlineEditState.colKeyValue
|
|
315
312
|
);
|
|
316
313
|
}
|
|
317
314
|
|
|
318
315
|
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
316
|
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
317
|
+
const col = getColumns(state)[colIndex];
|
|
318
|
+
|
|
319
|
+
inlineEditState.isPanelVisible = true;
|
|
320
|
+
inlineEditState.rowKeyValue = rowKeyValue;
|
|
321
|
+
inlineEditState.colKeyValue = colKeyValue;
|
|
322
|
+
inlineEditState.columnDef = col;
|
|
323
|
+
inlineEditState.editedValue = getCellValue(state, rowKeyValue, colKeyValue);
|
|
324
|
+
inlineEditState.massEditSelectedRows = getCurrentSelectionLength(state);
|
|
325
|
+
inlineEditState.massEditEnabled =
|
|
326
|
+
inlineEditState.massEditSelectedRows > 1 &&
|
|
327
|
+
isSelectedRow(state, rowKeyValue);
|
|
328
|
+
|
|
329
|
+
const { typeAttributes } = col || {};
|
|
330
|
+
if (typeAttributes) {
|
|
331
|
+
// Ehen the inline edit panel is opened resolve the typeAttributes if available
|
|
337
332
|
// then assign the resolved values to inlineEdit.resolvedTypeAttributes
|
|
338
|
-
|
|
333
|
+
inlineEditState.resolvedTypeAttributes = resolveNestedTypeAttributes(
|
|
339
334
|
state,
|
|
340
335
|
rowKeyValue,
|
|
341
336
|
colKeyValue,
|
|
342
337
|
types,
|
|
343
|
-
|
|
338
|
+
typeAttributes,
|
|
344
339
|
colIndex
|
|
345
340
|
);
|
|
346
341
|
}
|
|
@@ -357,8 +352,8 @@ function openInlineEdit(dt, target) {
|
|
|
357
352
|
processInlineEditFinish(
|
|
358
353
|
dt,
|
|
359
354
|
'edit-canceled',
|
|
360
|
-
|
|
361
|
-
|
|
355
|
+
inlineEditState.rowKeyValue,
|
|
356
|
+
inlineEditState.colKeyValue
|
|
362
357
|
);
|
|
363
358
|
} else {
|
|
364
359
|
// if panel can be edited, focus
|
|
@@ -378,20 +373,20 @@ function openInlineEdit(dt, target) {
|
|
|
378
373
|
* @param {Object} dt - The datatable instance. Must be a truthy and valid datatable reference.
|
|
379
374
|
*/
|
|
380
375
|
export function openInlineEditOnActiveCell(dt) {
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
if (!isActiveCellEditable(
|
|
376
|
+
const { state } = dt;
|
|
377
|
+
if (state.data && state.data.length > 0) {
|
|
378
|
+
if (!isActiveCellEditable(state)) {
|
|
384
379
|
const firstEditableCell = getFirstEditableCell(dt);
|
|
385
380
|
if (firstEditableCell) {
|
|
386
381
|
updateActiveCell(
|
|
387
|
-
|
|
382
|
+
state,
|
|
388
383
|
firstEditableCell.rowKeyValue,
|
|
389
384
|
firstEditableCell.colKeyValue
|
|
390
385
|
);
|
|
391
|
-
setFocusAndOpenInlineEdit(dt,
|
|
386
|
+
setFocusAndOpenInlineEdit(dt, state.activeCell);
|
|
392
387
|
}
|
|
393
388
|
} else {
|
|
394
|
-
setFocusAndOpenInlineEdit(dt,
|
|
389
|
+
setFocusAndOpenInlineEdit(dt, state.activeCell);
|
|
395
390
|
}
|
|
396
391
|
}
|
|
397
392
|
}
|
|
@@ -403,8 +398,9 @@ export function openInlineEditOnActiveCell(dt) {
|
|
|
403
398
|
*/
|
|
404
399
|
// eslint-disable-next-line @lwc/lwc/no-async-await
|
|
405
400
|
async function setFocusAndOpenInlineEdit(dt) {
|
|
406
|
-
|
|
407
|
-
|
|
401
|
+
const { state, template } = dt;
|
|
402
|
+
await setFocusActiveCell(template, state, 0);
|
|
403
|
+
const cell = getActiveCellElement(template, state);
|
|
408
404
|
openInlineEdit(dt, cell);
|
|
409
405
|
}
|
|
410
406
|
|
|
@@ -432,12 +428,13 @@ function startPanelPositioning(dt, target) {
|
|
|
432
428
|
// will retain previous alignment
|
|
433
429
|
stopPanelPositioning(dt);
|
|
434
430
|
|
|
435
|
-
dt.
|
|
431
|
+
dt._positionRelationship = startPositioning(dt, {
|
|
436
432
|
target,
|
|
437
|
-
element
|
|
438
|
-
dt.template
|
|
439
|
-
|
|
440
|
-
|
|
433
|
+
element() {
|
|
434
|
+
const panel = dt.template.querySelector(IEDIT_PANEL_SELECTOR);
|
|
435
|
+
return panel.getPositionedElement();
|
|
436
|
+
},
|
|
437
|
+
autoFlip: true,
|
|
441
438
|
align: {
|
|
442
439
|
horizontal: Direction.Left,
|
|
443
440
|
vertical: Direction.Top,
|
|
@@ -446,15 +443,15 @@ function startPanelPositioning(dt, target) {
|
|
|
446
443
|
horizontal: Direction.Left,
|
|
447
444
|
vertical: Direction.Top,
|
|
448
445
|
},
|
|
449
|
-
autoFlip: true,
|
|
450
446
|
});
|
|
451
447
|
});
|
|
452
448
|
}
|
|
453
449
|
|
|
454
450
|
function stopPanelPositioning(dt) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
451
|
+
const { _positionRelationship } = dt;
|
|
452
|
+
if (_positionRelationship) {
|
|
453
|
+
stopPositioning(_positionRelationship);
|
|
454
|
+
dt._positionRelationship = null;
|
|
458
455
|
}
|
|
459
456
|
}
|
|
460
457
|
|
|
@@ -462,13 +459,14 @@ function stopPanelPositioning(dt) {
|
|
|
462
459
|
* Repositions the inline edit panel. this does not realign the element,
|
|
463
460
|
* so it doesn't fix alignment when size of panel changes
|
|
464
461
|
*
|
|
465
|
-
* @param {Object} dt - datatable instance
|
|
462
|
+
* @param {Object} dt - The datatable instance
|
|
466
463
|
*/
|
|
467
464
|
function repositionPanel(dt) {
|
|
468
465
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
469
466
|
requestAnimationFrame(() => {
|
|
470
|
-
|
|
471
|
-
|
|
467
|
+
const { _positionRelationship } = dt;
|
|
468
|
+
if (_positionRelationship) {
|
|
469
|
+
_positionRelationship.reposition();
|
|
472
470
|
}
|
|
473
471
|
});
|
|
474
472
|
}
|
|
@@ -489,39 +487,40 @@ export function getDirtyValues(state) {
|
|
|
489
487
|
* Sets the dirty values in the datatable.
|
|
490
488
|
*
|
|
491
489
|
* @param {Object} state Datatable state object.
|
|
492
|
-
* @param {Array}
|
|
490
|
+
* @param {Array} values An untracked array of objects, each object describing the dirty values in the form { colName : dirtyValue }.
|
|
493
491
|
* A special key is the { [keyField]: value } pair used to identify the row containing this changed values.
|
|
494
492
|
*/
|
|
495
|
-
export function setDirtyValues(state,
|
|
493
|
+
export function setDirtyValues(state, values) {
|
|
496
494
|
const keyField = getKeyField(state);
|
|
497
|
-
const dirtyValues = Array.isArray(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
495
|
+
const dirtyValues = Array.isArray(values) ? values : [];
|
|
496
|
+
|
|
497
|
+
const result = {};
|
|
498
|
+
for (let dirtyIndex = 0; dirtyIndex < dirtyValues.length; dirtyIndex += 1) {
|
|
499
|
+
const rowValues = dirtyValues[dirtyIndex];
|
|
500
|
+
const colChanges = getCellChangesFromCustomer(state, rowValues);
|
|
501
|
+
delete colChanges[keyField];
|
|
502
|
+
result[rowValues[keyField]] = colChanges;
|
|
503
|
+
}
|
|
504
|
+
state.inlineEdit.dirtyValues = result;
|
|
507
505
|
}
|
|
508
506
|
|
|
509
507
|
/**
|
|
510
508
|
* Updates the dirty values specified in rowColKeyValues
|
|
511
509
|
*
|
|
512
510
|
* @param {Object} state - state of the datatable
|
|
513
|
-
* @param {Object}
|
|
511
|
+
* @param {Object} changes - An object in the form of { rowKeyValue: { colKeyValue1: value, ..., colKeyValueN: value } ... }
|
|
514
512
|
*/
|
|
515
|
-
function updateDirtyValues(state,
|
|
513
|
+
function updateDirtyValues(state, changes) {
|
|
516
514
|
const dirtyValues = state.inlineEdit.dirtyValues;
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
515
|
+
const rowKeys = Object.keys(changes);
|
|
516
|
+
for (let rowKeyIndex = 0; rowKeyIndex < rowKeys.length; rowKeyIndex += 1) {
|
|
517
|
+
const rowKeyValue = rowKeys[rowKeyIndex];
|
|
518
|
+
if (!Object.prototype.hasOwnProperty.call(dirtyValues, rowKeyValue)) {
|
|
519
|
+
dirtyValues[rowKeyValue] = {};
|
|
521
520
|
}
|
|
522
521
|
|
|
523
|
-
Object.assign(dirtyValues[
|
|
524
|
-
}
|
|
522
|
+
Object.assign(dirtyValues[rowKeyValue], changes[rowKeyValue]);
|
|
523
|
+
}
|
|
525
524
|
}
|
|
526
525
|
|
|
527
526
|
/**
|
|
@@ -530,21 +529,26 @@ function updateDirtyValues(state, rowColKeyValues) {
|
|
|
530
529
|
* { <colKeyValue: "<editedValue>"> }; Ex. { "name-text-2": "My changes" }
|
|
531
530
|
*
|
|
532
531
|
* @param {Object} state - datatable's state object
|
|
533
|
-
* @param {Object}
|
|
532
|
+
* @param {Object} rowValues - internal representation of changes in a row
|
|
534
533
|
* @returns {Object} - changes in a column that can be referenced by the column key
|
|
535
534
|
*/
|
|
536
|
-
function getCellChangesFromCustomer(state,
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
535
|
+
function getCellChangesFromCustomer(state, rowValues) {
|
|
536
|
+
const columns = getColumns(state);
|
|
537
|
+
const colKeys = Object.keys(rowValues);
|
|
538
|
+
const colChanges = {};
|
|
539
|
+
for (
|
|
540
|
+
let colKeysIndex = 0, { length: colKeysLength } = colKeys;
|
|
541
|
+
colKeysIndex < colKeysLength;
|
|
542
|
+
colKeysIndex += 1
|
|
543
|
+
) {
|
|
544
|
+
const externalColKeyValue = colKeys[colKeysIndex];
|
|
545
|
+
const colIndex = getColumnIndexByColumnKey(state, externalColKeyValue);
|
|
546
|
+
if (colIndex >= 0) {
|
|
547
|
+
const colKey = columns[colIndex].colKeyValue;
|
|
548
|
+
colChanges[colKey] = rowValues[externalColKeyValue];
|
|
544
549
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}, {});
|
|
550
|
+
}
|
|
551
|
+
return colChanges;
|
|
548
552
|
}
|
|
549
553
|
|
|
550
554
|
/**
|
|
@@ -553,19 +557,28 @@ function getCellChangesFromCustomer(state, changes) {
|
|
|
553
557
|
* { <columnName>: "<changes>"} -> Ex. { name: "My changes" }
|
|
554
558
|
*
|
|
555
559
|
* @param {Object} state - Datatable state
|
|
556
|
-
* @param {Object}
|
|
560
|
+
* @param {Object} colChanges - The internal representation of changes in a row
|
|
557
561
|
* @returns {Object} - the list of customer changes in a column
|
|
558
562
|
*/
|
|
559
|
-
function getCellChangesByColumn(state,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
563
|
+
function getCellChangesByColumn(state, colChanges) {
|
|
564
|
+
const columns = getColumns(state);
|
|
565
|
+
const changeColKeys = Object.keys(colChanges);
|
|
566
|
+
const { length: changeColCount } = changeColKeys;
|
|
567
|
+
const cellChanges = {};
|
|
568
|
+
for (
|
|
569
|
+
let changeColIndex = 0;
|
|
570
|
+
changeColIndex < changeColCount;
|
|
571
|
+
changeColIndex += 1
|
|
572
|
+
) {
|
|
573
|
+
const colKeyValue = changeColKeys[changeColIndex];
|
|
574
|
+
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
575
|
+
if (colIndex !== -1) {
|
|
576
|
+
const col = columns[colIndex];
|
|
577
|
+
cellChanges[col.columnKey || col.fieldName] =
|
|
578
|
+
colChanges[colKeyValue];
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return cellChanges;
|
|
569
582
|
}
|
|
570
583
|
|
|
571
584
|
/**
|
|
@@ -578,25 +591,31 @@ function getCellChangesByColumn(state, changes) {
|
|
|
578
591
|
* The keyField can be used to identify the row.
|
|
579
592
|
*
|
|
580
593
|
* @param {Object} state - datatable state object
|
|
581
|
-
* @param {Object}
|
|
594
|
+
* @param {Object} rowChanges - list of cell changes to be resolved
|
|
582
595
|
* @returns {Array} - array containing changes and identifiers of column and row where the changes
|
|
583
596
|
* should be applied
|
|
584
597
|
*/
|
|
585
|
-
function getResolvedCellChanges(state,
|
|
598
|
+
function getResolvedCellChanges(state, rowChanges) {
|
|
586
599
|
const keyField = getKeyField(state);
|
|
600
|
+
const result = [];
|
|
601
|
+
const changeRowKeys = Object.keys(rowChanges);
|
|
602
|
+
for (
|
|
603
|
+
let changeRowIndex = 0, { length: changeRowCount } = changeRowKeys;
|
|
604
|
+
changeRowIndex < changeRowCount;
|
|
605
|
+
changeRowIndex += 1
|
|
606
|
+
) {
|
|
607
|
+
const rowKeyValue = changeRowKeys[changeRowIndex];
|
|
608
|
+
const colChanges = rowChanges[rowKeyValue];
|
|
587
609
|
|
|
588
|
-
return Object.keys(changes).reduce((result, rowKey) => {
|
|
589
610
|
// Get the changes made by column
|
|
590
|
-
const cellChanges = getCellChangesByColumn(state,
|
|
591
|
-
|
|
611
|
+
const cellChanges = getCellChangesByColumn(state, colChanges);
|
|
592
612
|
if (Object.keys(cellChanges).length > 0) {
|
|
593
613
|
// Add identifier for which row has change
|
|
594
|
-
cellChanges[keyField] =
|
|
614
|
+
cellChanges[keyField] = rowKeyValue;
|
|
595
615
|
result.push(cellChanges);
|
|
596
616
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}, []);
|
|
617
|
+
}
|
|
618
|
+
return result;
|
|
600
619
|
}
|
|
601
620
|
|
|
602
621
|
/************************** TYPE ATTRIBUTES RESOLUTION **************************/
|
|
@@ -608,8 +627,8 @@ function getResolvedCellChanges(state, changes) {
|
|
|
608
627
|
* @param {String} rowKeyValue - row key
|
|
609
628
|
* @param {String} colKeyValue - column key
|
|
610
629
|
* @param {object} types - types
|
|
611
|
-
* @param {object}
|
|
612
|
-
* @param {number}
|
|
630
|
+
* @param {object} typeAttributes - values of typeAttributes from column definition
|
|
631
|
+
* @param {number} colIndex - The column index
|
|
613
632
|
*
|
|
614
633
|
* @returns {Object} the resolved typeAttributes.
|
|
615
634
|
*/
|
|
@@ -618,35 +637,31 @@ export function resolveNestedTypeAttributes(
|
|
|
618
637
|
rowKeyValue,
|
|
619
638
|
colKeyValue,
|
|
620
639
|
types,
|
|
621
|
-
|
|
622
|
-
|
|
640
|
+
typeAttributes,
|
|
641
|
+
colIndex
|
|
623
642
|
) {
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
643
|
+
const col = state.columns[colIndex];
|
|
644
|
+
const typeDesc = typeAttributes && types.getType(col.type);
|
|
645
|
+
const attributeNames = typeDesc && typeDesc.typeAttributes;
|
|
646
|
+
// Check if attrValue and typeAttributes are available.
|
|
647
|
+
if (attributeNames) {
|
|
648
|
+
const resolvedTypeAttributes = {};
|
|
649
|
+
const { length: attributeNamesLength } = attributeNames;
|
|
650
|
+
const _rowData = getUserRowByCellKeys(state, rowKeyValue, colKeyValue);
|
|
631
651
|
// We only want to resolve typeAttributes based on the custom types configuration
|
|
632
652
|
// If the attribute is not in that configuration, the value of typeAttributesValues
|
|
633
653
|
// 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
|
-
);
|
|
654
|
+
for (let i = 0; i < attributeNamesLength; i += 1) {
|
|
655
|
+
const attrName = attributeNames[i];
|
|
656
|
+
const attrValue = typeAttributes[attrName];
|
|
657
|
+
if (attrValue) {
|
|
658
|
+
resolvedTypeAttributes[attrName] =
|
|
659
|
+
resolveNestedTypeAttributesHelper(_rowData, attrValue);
|
|
645
660
|
}
|
|
646
|
-
}
|
|
661
|
+
}
|
|
647
662
|
return resolvedTypeAttributes;
|
|
648
663
|
}
|
|
649
|
-
return
|
|
664
|
+
return typeAttributes;
|
|
650
665
|
}
|
|
651
666
|
|
|
652
667
|
/**
|
|
@@ -665,48 +680,44 @@ export function resolveNestedTypeAttributes(
|
|
|
665
680
|
* }
|
|
666
681
|
* }
|
|
667
682
|
*/
|
|
668
|
-
function resolveNestedTypeAttributesHelper(rowData,
|
|
683
|
+
function resolveNestedTypeAttributesHelper(rowData, attrValue) {
|
|
669
684
|
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
|
-
}
|
|
685
|
+
if (!isObjectLike(attrValue)) {
|
|
686
|
+
// Primitive value.
|
|
687
|
+
// For example, if the typeAttributes is { count: 5},
|
|
688
|
+
// 5 will be the attrValue passed in to the function.
|
|
689
|
+
// nothing needs to be resolved, just return it.
|
|
690
|
+
return attrValue === undefined ? resolvedTypeAttributes : attrValue;
|
|
691
|
+
}
|
|
692
|
+
const typeAttributesNames = Object.keys(attrValue);
|
|
693
|
+
for (let i = 0, { length } = typeAttributesNames; i < length; i += 1) {
|
|
694
|
+
const name = typeAttributesNames[i];
|
|
695
|
+
const value = attrValue[name];
|
|
696
|
+
if (value !== undefined) {
|
|
697
|
+
// since resolveNestedTypeAttributes will be creating the top level attribute
|
|
698
|
+
// and we resolve values while creating the new object, the attrValue passed in
|
|
699
|
+
// could be something like {fieldName: 'someField'}.
|
|
700
|
+
// For example, if the typeAttributes is { targetName: {fieldName: 'name'}},
|
|
701
|
+
// {fieldName: 'name'} will be the attrValue passed in to the function,
|
|
702
|
+
// so we need to check if key is 'fieldName' or not and resolve it immediately.
|
|
703
|
+
if (name === 'fieldName') {
|
|
704
|
+
resolvedTypeAttributes = rowData[value];
|
|
705
|
+
} else if (isObjectLike(value)) {
|
|
706
|
+
// This is the case when attrValue is something like {label: {fieldName: 'name'}}.
|
|
707
|
+
// It's an object but the value maps a field name
|
|
708
|
+
const { fieldName } = value;
|
|
709
|
+
if (fieldName) {
|
|
710
|
+
resolvedTypeAttributes[name] = rowData[fieldName];
|
|
711
|
+
} else {
|
|
712
|
+
// Nested object case, need to recursively resolve it.
|
|
713
|
+
// For example, { targetName: {value: {fieldName: 'name'}}}}.
|
|
714
|
+
resolvedTypeAttributes[name] =
|
|
715
|
+
resolveNestedTypeAttributesHelper(rowData, value);
|
|
702
716
|
}
|
|
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;
|
|
717
|
+
} else {
|
|
718
|
+
// Primitive value
|
|
719
|
+
resolvedTypeAttributes[name] = value;
|
|
720
|
+
}
|
|
710
721
|
}
|
|
711
722
|
}
|
|
712
723
|
|
|
@@ -722,19 +733,22 @@ function resolveNestedTypeAttributesHelper(rowData, typeAttributesValue) {
|
|
|
722
733
|
* @param {Object} dt - The datatable instance. Must be a truthy and valid datatable reference.
|
|
723
734
|
*/
|
|
724
735
|
function getFirstEditableCell(dt) {
|
|
736
|
+
const { state } = dt;
|
|
725
737
|
const columns = getColumns(dt.state);
|
|
726
738
|
const editableColumns = getEditableColumns(columns);
|
|
727
|
-
|
|
728
|
-
if (
|
|
729
|
-
const rows =
|
|
730
|
-
for (let rowIndex = 0; rowIndex < rows.length; rowIndex
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
//
|
|
739
|
+
const { length: editableColumnsLength } = editableColumns;
|
|
740
|
+
if (editableColumnsLength > 0) {
|
|
741
|
+
const { rows } = state;
|
|
742
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
743
|
+
const { key: rowKeyValue } = rows[rowIndex];
|
|
744
|
+
for (let i = 0; i < editableColumnsLength; i += 1) {
|
|
745
|
+
// Loop through the editable columns in order and examine the
|
|
746
|
+
// corresponding cells in the current row for editability,
|
|
747
|
+
// returning the first such cell that is editable.
|
|
734
748
|
const editableColumn = editableColumns[i];
|
|
735
749
|
if (isCellEditable(rows[rowIndex], editableColumn)) {
|
|
736
750
|
return {
|
|
737
|
-
rowKeyValue
|
|
751
|
+
rowKeyValue,
|
|
738
752
|
colKeyValue: editableColumn.colKeyValue,
|
|
739
753
|
};
|
|
740
754
|
}
|
|
@@ -769,11 +783,14 @@ function getCellValue(state, rowKeyValue, colKeyValue) {
|
|
|
769
783
|
*/
|
|
770
784
|
function setAriaSelectedOnAllSelectedRows(state) {
|
|
771
785
|
const { colKeyValue } = state.inlineEdit;
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
786
|
+
const selectedRowsKeys = getSelectedRowsKeys(state);
|
|
787
|
+
const keys = Object.keys(selectedRowsKeys);
|
|
788
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
789
|
+
const rowKeyValue = keys[i];
|
|
790
|
+
if (selectedRowsKeys[rowKeyValue]) {
|
|
791
|
+
setAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
777
794
|
}
|
|
778
795
|
|
|
779
796
|
/**
|
|
@@ -784,9 +801,12 @@ function setAriaSelectedOnAllSelectedRows(state) {
|
|
|
784
801
|
*/
|
|
785
802
|
function unsetAriaSelectedOnAllSelectedRows(state) {
|
|
786
803
|
const { colKeyValue } = state.inlineEdit;
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
804
|
+
const selectedRowsKeys = getSelectedRowsKeys(state);
|
|
805
|
+
const keys = Object.keys(selectedRowsKeys);
|
|
806
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
807
|
+
const rowKeyValue = keys[i];
|
|
808
|
+
if (selectedRowsKeys[rowKeyValue]) {
|
|
809
|
+
unsetAriaSelectedOnCell(state, rowKeyValue, colKeyValue);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
792
812
|
}
|