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,6 +1,6 @@
|
|
|
1
1
|
import { classSetToString } from 'lightning/utilsPrivate';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const CLASS_SET_PROTOTYPE = {
|
|
4
4
|
add(className) {
|
|
5
5
|
if (typeof className === 'string') {
|
|
6
6
|
this[className] = true;
|
|
@@ -22,9 +22,12 @@ const CLASSSET_PROTOTYPE = {
|
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
const NON_NEGATIVE_INTEGER_REGEXP = /^\d+$/;
|
|
26
|
+
const POSITIVE_INTEGER_REGEXP = /^[0-9]*[1-9][0-9]*$/;
|
|
27
|
+
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
* extended in future for any other
|
|
29
|
+
* Escapes double quotes. Later can be
|
|
30
|
+
* extended in future for any other use case.
|
|
28
31
|
*/
|
|
29
32
|
export function escapeDoubleQuotes(value) {
|
|
30
33
|
if (typeof value == 'string') {
|
|
@@ -52,8 +55,8 @@ export const isObjectLike = function (value) {
|
|
|
52
55
|
*/
|
|
53
56
|
export function classSet(config) {
|
|
54
57
|
return typeof config === 'string'
|
|
55
|
-
? { __proto__:
|
|
56
|
-
: Object.assign({ __proto__:
|
|
58
|
+
? { __proto__: CLASS_SET_PROTOTYPE, [config]: true }
|
|
59
|
+
: Object.assign({ __proto__: CLASS_SET_PROTOTYPE }, config);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
/**
|
|
@@ -68,24 +71,64 @@ export function clamp(num, min, max) {
|
|
|
68
71
|
return num <= min ? min : num >= max ? max : num;
|
|
69
72
|
}
|
|
70
73
|
|
|
74
|
+
export function getColDataSelector(colKeyValue) {
|
|
75
|
+
return `[data-col-key-value="${escapeDoubleQuotes(colKeyValue)}"]`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getRowDataSelector(rowKeyValue) {
|
|
79
|
+
return `[data-row-key-value="${escapeDoubleQuotes(rowKeyValue)}"]`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Gets the grid container element from the scrollerY element.
|
|
84
|
+
*
|
|
85
|
+
* @param {Node} scrollerY The scrollerY element
|
|
86
|
+
* @returns {Node} The grid container element
|
|
87
|
+
*/
|
|
88
|
+
export function getGridContainerFromScrollerY(scrollerY) {
|
|
89
|
+
const { firstElementChild: gridContainer } = scrollerY;
|
|
90
|
+
return gridContainer;
|
|
91
|
+
}
|
|
92
|
+
|
|
71
93
|
/**
|
|
72
|
-
*
|
|
94
|
+
* Gets the scrollerX element from the scrollerY element.
|
|
95
|
+
*
|
|
96
|
+
* @param {Node} scrollerY The scrollerY element
|
|
97
|
+
* @returns {Node} The scrollerX element
|
|
98
|
+
*/
|
|
99
|
+
export function getScrollerXFromScrollerY(scrollerY) {
|
|
100
|
+
const { parentElement: scrollerX } = scrollerY;
|
|
101
|
+
return scrollerX;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Gets the scrollerY element from the template.
|
|
106
|
+
*
|
|
107
|
+
* @param {Node} template The datatable template
|
|
108
|
+
* @returns {Node} The scrollerY element
|
|
109
|
+
*/
|
|
110
|
+
export function getScrollerY(template) {
|
|
111
|
+
return template.querySelector('.slds-scrollable_y');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Tests if value represents an integer greater than 0.
|
|
73
116
|
*
|
|
74
117
|
* @param {Integer} value Value to test
|
|
75
118
|
* @returns {Boolean} Whether the value is greater than 0
|
|
76
119
|
*/
|
|
77
120
|
export function isPositiveInteger(value) {
|
|
78
|
-
return
|
|
121
|
+
return POSITIVE_INTEGER_REGEXP.test(value);
|
|
79
122
|
}
|
|
80
123
|
|
|
81
124
|
/**
|
|
82
|
-
* Tests if
|
|
125
|
+
* Tests if value represents 0 or an integer greater than 0.
|
|
83
126
|
*
|
|
84
127
|
* @param {Integer} value Value to test
|
|
85
128
|
* @returns {Boolean} Whether the value is greater than or equal to 0
|
|
86
129
|
*/
|
|
87
130
|
export function isNonNegativeInteger(value) {
|
|
88
|
-
return
|
|
131
|
+
return NON_NEGATIVE_INTEGER_REGEXP.test(value);
|
|
89
132
|
}
|
|
90
133
|
|
|
91
134
|
/**
|
|
@@ -110,13 +153,13 @@ export function normalizeNumberAttribute(
|
|
|
110
153
|
let warningMessage;
|
|
111
154
|
if (numberType === 'positive') {
|
|
112
155
|
if (isPositiveInteger(value)) {
|
|
113
|
-
return parseInt(value, 10);
|
|
156
|
+
return Number.parseInt(value, 10);
|
|
114
157
|
}
|
|
115
158
|
|
|
116
159
|
warningMessage = `The attribute "${attrName}" value passed in is incorrect. "${attrName}" value should be an integer > 0.`;
|
|
117
160
|
} else if (numberType === 'non-negative') {
|
|
118
161
|
if (isNonNegativeInteger(value)) {
|
|
119
|
-
return parseInt(value, 10);
|
|
162
|
+
return Number.parseInt(value, 10);
|
|
120
163
|
}
|
|
121
164
|
|
|
122
165
|
warningMessage = `The attribute "${attrName}" value passed in is incorrect. "${attrName}" value should be an integer >= 0.`;
|
|
@@ -143,21 +186,3 @@ export function getScrollOffsetFromTableEnd(el) {
|
|
|
143
186
|
el.scrollHeight - el.parentNode.scrollTop - el.parentNode.clientHeight
|
|
144
187
|
);
|
|
145
188
|
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Utility for converting arrays and plain objects to style strings.
|
|
149
|
-
*
|
|
150
|
-
* @param {Array | Object} style The CSS style array/object
|
|
151
|
-
* @returns {String} Representing array/object as a string
|
|
152
|
-
*/
|
|
153
|
-
export function styleToString(style) {
|
|
154
|
-
if (Array.isArray(style)) {
|
|
155
|
-
return style.join(';');
|
|
156
|
-
}
|
|
157
|
-
const entries = Object.keys(style);
|
|
158
|
-
for (let i = 0, { length } = entries; i < length; i += 1) {
|
|
159
|
-
const key = entries[i];
|
|
160
|
-
entries[i] = `${key}:${style[key]}`;
|
|
161
|
-
}
|
|
162
|
-
return entries.join(';');
|
|
163
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { escapeDoubleQuotes } from './utils';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* sets an initial table height in the datatable state
|
|
@@ -311,9 +311,6 @@ function updateVirtualizeStyles(template, state, renderedRows) {
|
|
|
311
311
|
|
|
312
312
|
// update top of rendered rows based on offsets
|
|
313
313
|
renderedRows.forEach((row) => {
|
|
314
|
-
row.style =
|
|
315
|
-
position: 'absolute',
|
|
316
|
-
top: `${state.offsets[row.rowIndex]}px`,
|
|
317
|
-
});
|
|
314
|
+
row.style = `position:absolute;top:${state.offsets[row.rowIndex]}px;`;
|
|
318
315
|
});
|
|
319
316
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* number of fixed, flexible, and resized columns in the table
|
|
4
4
|
*
|
|
5
5
|
* @param {Object} columnWidthMetaData The initial column widths metadata
|
|
6
|
-
* @param {Object}
|
|
6
|
+
* @param {Object} columns The state column definitions
|
|
7
7
|
* @returns {Object} The computed metadata
|
|
8
8
|
*/
|
|
9
|
-
export function
|
|
10
|
-
const
|
|
9
|
+
export function getTotalWidthsData(columnWidthMetaData, columns) {
|
|
10
|
+
const totalWidthsData = {
|
|
11
11
|
totalFixedWidth: 0,
|
|
12
12
|
totalFixedColumns: 0,
|
|
13
13
|
totalResizedWidth: 0,
|
|
@@ -17,32 +17,23 @@ export function getTotalWidthsMetadata(columnWidthMetaData, columnDefs) {
|
|
|
17
17
|
maxColumnWidth: columnWidthMetaData.maxColumnWidth,
|
|
18
18
|
wrapTextMaxLines: columnWidthMetaData.wrapTextMaxLines,
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
for (let colIndex = 0; colIndex < columns.length; colIndex += 1) {
|
|
21
|
+
const col = columns[colIndex];
|
|
22
|
+
const { fixedWidth, initialWidth } = col;
|
|
23
|
+
if (fixedWidth) {
|
|
24
|
+
totalWidthsData.totalFixedWidth += fixedWidth;
|
|
25
|
+
totalWidthsData.totalFixedColumns += 1;
|
|
25
26
|
} else if (col.isResized) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} else if (
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
totalWidthsData.totalResizedWidth += col.columnWidth;
|
|
28
|
+
totalWidthsData.totalResizedColumns += 1;
|
|
29
|
+
} else if (initialWidth) {
|
|
30
|
+
totalWidthsData.totalResizedWidth += initialWidth;
|
|
31
|
+
totalWidthsData.totalResizedColumns += 1;
|
|
31
32
|
} else {
|
|
32
|
-
|
|
33
|
+
totalWidthsData.totalFlexibleColumns += 1;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Gets the width of a DOM element.
|
|
40
|
-
*
|
|
41
|
-
* @param {Node} element Target DOM element
|
|
42
|
-
* @returns {Number} The width of the DOM element
|
|
43
|
-
*/
|
|
44
|
-
export function getDomWidth(element) {
|
|
45
|
-
return element.offsetWidth;
|
|
35
|
+
}
|
|
36
|
+
return totalWidthsData;
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
/**
|
|
@@ -54,20 +45,12 @@ export function getDomWidth(element) {
|
|
|
54
45
|
* @param {Object} column The column object
|
|
55
46
|
* @returns {Number} The fixed width, resized width, or initial width of the column (in that priority order)
|
|
56
47
|
*/
|
|
57
|
-
export function
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
48
|
+
export function getColumnWidth(column) {
|
|
49
|
+
const { fixedWidth } = column;
|
|
50
|
+
if (fixedWidth) {
|
|
51
|
+
return fixedWidth;
|
|
61
52
|
}
|
|
62
|
-
return column.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Creates a width CSS style string from a numeric value
|
|
67
|
-
*
|
|
68
|
-
* @param {Number} pixels Number of pixels
|
|
69
|
-
* @returns {String} The CSS width definition
|
|
70
|
-
*/
|
|
71
|
-
export function buildCSSWidthStyle(pixels) {
|
|
72
|
-
return pixels > 0 ? `width:${pixels}px` : '';
|
|
53
|
+
return column.isResized
|
|
54
|
+
? column.columnWidth || column.initialWidth
|
|
55
|
+
: column.initialWidth;
|
|
73
56
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import labelClipText from '@salesforce/label/LightningDatatable.clipText';
|
|
2
2
|
import labelWrapText from '@salesforce/label/LightningDatatable.wrapText';
|
|
3
3
|
import { normalizeBoolean } from 'lightning/utilsPrivate';
|
|
4
|
-
import { getStateColumnIndex
|
|
4
|
+
import { getStateColumnIndex } from './columns';
|
|
5
5
|
import { normalizeNumberAttribute } from './utils';
|
|
6
6
|
import { getDefaultState } from './state';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const NON_WRAPPABLE_TYPES = [
|
|
8
|
+
const NON_WRAPPABLE_TYPES = new Set([
|
|
10
9
|
'action',
|
|
11
10
|
'boolean',
|
|
12
11
|
'button',
|
|
13
12
|
'button-icon',
|
|
14
13
|
'date-local',
|
|
15
14
|
'rowNumber',
|
|
16
|
-
];
|
|
15
|
+
]);
|
|
17
16
|
|
|
18
17
|
const i18n = {
|
|
19
18
|
clipText: labelClipText,
|
|
@@ -22,44 +21,26 @@ const i18n = {
|
|
|
22
21
|
|
|
23
22
|
/************************** WRAP TEXT STATE **************************/
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
* Returns a boolean representing whether or not the column should be text wrapped
|
|
27
|
-
*
|
|
28
|
-
* NOTE: Wrap text is not supported in IE, so default parameters are fine here.
|
|
29
|
-
*
|
|
30
|
-
* @param {Object} state Datatable's state object
|
|
31
|
-
* @param {String} colKeyValue The column key value to look up wrap text configuration
|
|
32
|
-
* @returns {Boolean} Whether the text is currently wrapped
|
|
33
|
-
*/
|
|
34
|
-
export function getWrapTextState(state = getDefaultState(), colKeyValue) {
|
|
35
|
-
return state.wrapText[colKeyValue] || WRAP_TEXT_DEFAULT;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
24
|
/**
|
|
39
25
|
* Sets a boolean value in state's wrapText object against the column key value
|
|
40
26
|
* representing whether or not the column is text wrapped.
|
|
41
27
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param {Object} state Datatable's state object
|
|
45
|
-
* @param {Object} columnDefinition Datatable's column definitions
|
|
28
|
+
* @param {Object} state The datatable state
|
|
29
|
+
* @param {Object} col The datatable column definition
|
|
46
30
|
*/
|
|
47
|
-
export function setWrapTextState(state = getDefaultState(),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (isWrappableType(type)) {
|
|
51
|
-
state.wrapText[colKeyValue] =
|
|
52
|
-
normalizeBoolean(wrapText) || WRAP_TEXT_DEFAULT;
|
|
31
|
+
export function setWrapTextState(state = getDefaultState(), col) {
|
|
32
|
+
if (!NON_WRAPPABLE_TYPES.has(col.type)) {
|
|
33
|
+
state.wrapText[col.colKeyValue] = normalizeBoolean(col.wrapText);
|
|
53
34
|
}
|
|
54
35
|
}
|
|
55
36
|
|
|
56
37
|
/************************** WRAP TEXT MAX LINES **************************/
|
|
57
38
|
|
|
58
39
|
/**
|
|
59
|
-
* Normalizes and sets wrapTextMaxLines in datatable
|
|
40
|
+
* Normalizes and sets wrapTextMaxLines in datatable state object.
|
|
60
41
|
* The normalized value should be a positive integer or it'll fall back to undefined.
|
|
61
42
|
*
|
|
62
|
-
* @param {Object} state
|
|
43
|
+
* @param {Object} state The datatable state
|
|
63
44
|
* @param {Integer} value The maximum lines allowed
|
|
64
45
|
*/
|
|
65
46
|
export function setWrapTextMaxLines(state, value) {
|
|
@@ -98,37 +79,34 @@ function updateWrapTextAndMaxLinesValuesInCells(state, colIndex, colKeyValue) {
|
|
|
98
79
|
* provides - Wrap Text and Clip Text.
|
|
99
80
|
* Each header action contains a label, title, action name and its selected value (checked)
|
|
100
81
|
*
|
|
101
|
-
* @param {Object} state
|
|
102
|
-
* @param {Object}
|
|
82
|
+
* @param {Object} state The datatable state
|
|
83
|
+
* @param {Object} col The datatable column definition
|
|
103
84
|
* @returns {Array} An array of wrap text actions
|
|
104
85
|
*/
|
|
105
|
-
export function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
label:
|
|
118
|
-
title:
|
|
86
|
+
export function getInternalActions(state, col) {
|
|
87
|
+
// Untracked state change.
|
|
88
|
+
// Must be done first, so isTextWrapped correctly resolves.
|
|
89
|
+
setWrapTextState(state, col);
|
|
90
|
+
// If not hidden and isWrapable, sets the internal actions.
|
|
91
|
+
if (col.hideDefaultActions || NON_WRAPPABLE_TYPES.has(col.type)) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
const isTextWrapped = state.wrapText[col.colKeyValue] || false;
|
|
95
|
+
const { clipText, wrapText } = i18n;
|
|
96
|
+
return [
|
|
97
|
+
{
|
|
98
|
+
label: wrapText,
|
|
99
|
+
title: wrapText,
|
|
119
100
|
checked: isTextWrapped,
|
|
120
101
|
name: 'wrapText',
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
title: `${i18n.clipText}`,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: clipText,
|
|
105
|
+
title: clipText,
|
|
126
106
|
checked: !isTextWrapped,
|
|
127
107
|
name: 'clipText',
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return wrapTextActions;
|
|
108
|
+
},
|
|
109
|
+
];
|
|
132
110
|
}
|
|
133
111
|
|
|
134
112
|
/**
|
|
@@ -136,18 +114,20 @@ export function getActions(state, columnDefinition) {
|
|
|
136
114
|
* needs to be changed in the state, change it to the new value and update
|
|
137
115
|
* the check mark to represent the currently selected action
|
|
138
116
|
*
|
|
139
|
-
* @param {Object}
|
|
117
|
+
* @param {Object} dt The datatable
|
|
140
118
|
* @param {String} action Action that was selected/triggered
|
|
141
119
|
* @param {String} colKeyValue Column key value
|
|
142
120
|
*/
|
|
143
|
-
export function handleTriggeredAction(
|
|
144
|
-
const
|
|
145
|
-
|
|
121
|
+
export function handleTriggeredAction(dt, action, colKeyValue) {
|
|
122
|
+
const { name } = action;
|
|
123
|
+
const isWrapText = name === 'wrapText';
|
|
124
|
+
if (isWrapText || name === 'clipText') {
|
|
125
|
+
const { state } = dt;
|
|
146
126
|
// If state should be changed
|
|
147
|
-
if (state.wrapText[colKeyValue] !==
|
|
127
|
+
if (state.wrapText[colKeyValue] !== isWrapText) {
|
|
148
128
|
state.shouldResetHeights = true;
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
// Untracked state changes.
|
|
130
|
+
state.wrapText[colKeyValue] = isWrapText;
|
|
151
131
|
updateSelectedOptionInHeaderActions(state, colKeyValue);
|
|
152
132
|
}
|
|
153
133
|
}
|
|
@@ -165,9 +145,9 @@ function updateSelectedOptionInHeaderActions(state, colKeyValue) {
|
|
|
165
145
|
if (colIndex === -1) {
|
|
166
146
|
return;
|
|
167
147
|
}
|
|
168
|
-
const columns =
|
|
169
|
-
const
|
|
170
|
-
const { internalActions } =
|
|
148
|
+
const { columns } = state;
|
|
149
|
+
const col = columns[colIndex];
|
|
150
|
+
const { internalActions } = col.actions;
|
|
171
151
|
|
|
172
152
|
for (let i = 0, { length } = internalActions; i < length; i += 1) {
|
|
173
153
|
const action = internalActions[i];
|
|
@@ -182,17 +162,5 @@ function updateSelectedOptionInHeaderActions(state, colKeyValue) {
|
|
|
182
162
|
updateWrapTextAndMaxLinesValuesInCells(state, colIndex, colKeyValue);
|
|
183
163
|
|
|
184
164
|
// Force a refresh on this column, because the wrapText checked value changed.
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/************************** HELPER FUNCTIONS **************************/
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Determines if a given column type is wrappable.
|
|
192
|
-
*
|
|
193
|
-
* @param {String} type The type to check.
|
|
194
|
-
* @returns {Boolean} Whether the given type is wrappable.
|
|
195
|
-
*/
|
|
196
|
-
function isWrappableType(type) {
|
|
197
|
-
return NON_WRAPPABLE_TYPES.indexOf(type) < 0;
|
|
165
|
+
col.actions = Object.assign({}, col.actions);
|
|
198
166
|
}
|
|
@@ -78,6 +78,8 @@ export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
|
78
78
|
|
|
79
79
|
_min;
|
|
80
80
|
_max;
|
|
81
|
+
_userMaxValue;
|
|
82
|
+
_userMinValue;
|
|
81
83
|
_displayMin;
|
|
82
84
|
_displayMax;
|
|
83
85
|
_dateStyle = DATE_STYLE.MEDIUM;
|
|
@@ -110,6 +112,17 @@ export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
setNormalisedIsoDateMin() {
|
|
116
|
+
const normalizedDate = normalizeISODate(
|
|
117
|
+
this._userMinValue,
|
|
118
|
+
this._dateStyle
|
|
119
|
+
);
|
|
120
|
+
if (normalizedDate.isoValue) {
|
|
121
|
+
this._min = normalizedDate.isoValue;
|
|
122
|
+
this._displayMin = normalizedDate.displayValue;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
113
126
|
@api
|
|
114
127
|
get min() {
|
|
115
128
|
return this._min;
|
|
@@ -119,11 +132,19 @@ export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
|
119
132
|
// normalization of the given value is possible.
|
|
120
133
|
this._min = value;
|
|
121
134
|
this._displayMin = value;
|
|
135
|
+
this._userMinValue = value;
|
|
122
136
|
|
|
123
|
-
|
|
137
|
+
this.setNormalisedIsoDateMin();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setNormalisedIsoDateMax() {
|
|
141
|
+
const normalizedDate = normalizeISODate(
|
|
142
|
+
this._userMaxValue,
|
|
143
|
+
this._dateStyle
|
|
144
|
+
);
|
|
124
145
|
if (normalizedDate.isoValue) {
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
146
|
+
this._max = normalizedDate.isoValue;
|
|
147
|
+
this._displayMax = normalizedDate.displayValue;
|
|
127
148
|
}
|
|
128
149
|
}
|
|
129
150
|
|
|
@@ -136,12 +157,9 @@ export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
|
136
157
|
// normalization of the given value is possible.
|
|
137
158
|
this._max = value;
|
|
138
159
|
this._displayMax = value;
|
|
160
|
+
this._userMaxValue = value;
|
|
139
161
|
|
|
140
|
-
|
|
141
|
-
if (normalizedDate.isoValue) {
|
|
142
|
-
this._max = normalizedDate.isoValue;
|
|
143
|
-
this._displayMax = normalizedDate.displayValue;
|
|
144
|
-
}
|
|
162
|
+
this.setNormalisedIsoDateMax();
|
|
145
163
|
}
|
|
146
164
|
|
|
147
165
|
@api
|
|
@@ -381,8 +399,13 @@ export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
|
381
399
|
validValues: [DATE_STYLE.SHORT, DATE_STYLE.MEDIUM, DATE_STYLE.LONG],
|
|
382
400
|
});
|
|
383
401
|
|
|
384
|
-
const normalizedDate = normalizeISODate(this._value, this.
|
|
402
|
+
const normalizedDate = normalizeISODate(this._value, this._dateStyle);
|
|
385
403
|
this._displayValue = normalizedDate.displayValue;
|
|
404
|
+
|
|
405
|
+
// W-14161407 min and max setters are being called before dateStyle is being set
|
|
406
|
+
// hence updating the min max values
|
|
407
|
+
this.setNormalisedIsoDateMax();
|
|
408
|
+
this.setNormalisedIsoDateMin();
|
|
386
409
|
}
|
|
387
410
|
|
|
388
411
|
constructor() {
|