lightning-base-components 1.21.5-alpha → 1.21.7-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 +46 -4
- package/package.json +125 -3
- package/scopedImports/@salesforce-label-LightningColorPicker.a11yDefaultText.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.multiColumnSortingToast.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuColumns.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuMultiColumnSort.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuRows.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.sortingMenuTooltip.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.dependentFieldsListHeading.js +1 -1
- package/scopedImports/@salesforce-label-LightningLookup.advancedSearchMobile.js +1 -1
- package/scopedImports/@salesforce-label-LightningLookup.modalTitle.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.addRule.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.applyButton.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.cancelButton.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.clearButton.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.duplicateValueValidation.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.firstRuleHeading.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.modalTitle.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.otherRuleHeading.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.ruleLimit.js +1 -0
- package/scopedImports/@salesforce-label-LightningMultiColumnSortingModal.ruleLimitReached.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.ascending.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.descending.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.dropdownPlaceholder.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.missingValueValidation.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.moveDownTooltip.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrimitiveColumnSorter.moveUpTooltip.js +1 -0
- package/scopedImports/@salesforce-label-LightningProgressIndicator.pathCurrentStage.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.emptyStateNoResultText.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.messageWhenSearchTermTooShort.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForMoreThanOneHundredRecords.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForMultipleRecords.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.resultCountDescriptionForOneRecord.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.resultsLoading.js +1 -0
- package/scopedImports/@salesforce-label-LightningRecordPicker.searchInputHelp.js +1 -0
- package/src/lightning/accordion/accordion.js +21 -14
- package/src/lightning/accordionSection/button.slds.css +16 -15
- package/src/lightning/alert/alert.js +10 -8
- package/src/lightning/ariaObserver/ariaObserver.js +19 -5
- package/src/lightning/badge/badge.slds.css +1 -1
- package/src/lightning/baseCombobox/base-combobox.slds.css +1 -1
- package/src/lightning/baseCombobox/baseCombobox.html +2 -1
- package/src/lightning/baseCombobox/baseCombobox.js +21 -0
- package/src/lightning/baseCombobox/input-text.slds.css +5 -5
- package/src/lightning/button/button.js +5 -0
- package/src/lightning/button/button.slds.css +16 -15
- package/src/lightning/buttonIcon/__docs__/buttonIcon.md +4 -0
- package/src/lightning/buttonIcon/__examples__/basic/basic.html +17 -1
- package/src/lightning/buttonIcon/button-icon.slds.css +41 -25
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +33 -229
- package/src/lightning/buttonIconStateful/button-icon.slds.css +41 -25
- package/src/lightning/buttonIconStateful/button.slds.css +16 -15
- package/src/lightning/buttonMenu/button-icon.slds.css +41 -25
- package/src/lightning/buttonMenu/button-menu.slds.css +41 -15
- package/src/lightning/buttonMenu/button.slds.css +16 -15
- package/src/lightning/buttonMenu/buttonMenu.css +1 -1
- package/src/lightning/buttonMenu/buttonMenu.html +1 -1
- package/src/lightning/buttonMenu/buttonMenu.js +44 -4
- package/src/lightning/buttonStateful/button-stateful.slds.css +1 -4
- package/src/lightning/buttonStateful/button.slds.css +16 -15
- package/src/lightning/calendar/calendar.html +3 -4
- package/src/lightning/card/card.html +1 -1
- package/src/lightning/colorPickerCustom/colorPickerCustom.html +1 -1
- package/src/lightning/colorPickerCustom/colorPickerCustom.js +0 -9
- package/src/lightning/colorPickerCustom/input-text.slds.css +5 -5
- package/src/lightning/combobox/form-element.slds.css +5 -1
- package/src/lightning/confirm/confirm.js +10 -8
- package/src/lightning/datatable/__docs__/datatable.md +0 -3
- package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/README.md +17 -0
- package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.html +11 -0
- package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/customComponentPopupTableWrapper.js +25 -0
- package/src/lightning/datatable/__examples__disabled/customComponentPopupTableWrapper/generateData.js +15 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/customInput.html +4 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/myCustomTypePopupTable.js +17 -0
- package/src/lightning/datatable/__examples__disabled/myCustomTypePopupTable/nestedSimpleComponentParent.html +7 -0
- package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.html +31 -0
- package/src/lightning/datatable/__examples__disabled/simpleComponentPopupNested/simpleComponentPopupNested.js +36 -0
- package/src/lightning/datatable/columnWidthManager.js +19 -16
- package/src/lightning/datatable/columns.js +90 -42
- package/src/lightning/datatable/datatable.js +571 -148
- package/src/lightning/datatable/errors.js +1 -1
- package/src/lightning/datatable/indexes.js +32 -21
- package/src/lightning/datatable/infiniteLoading.js +7 -6
- package/src/lightning/datatable/inlineEdit.js +52 -64
- package/src/lightning/datatable/keyboard.js +583 -195
- package/src/lightning/datatable/renderManager.js +21 -27
- package/src/lightning/datatable/rowLevelActions.js +5 -14
- package/src/lightning/datatable/rowSelection.js +36 -17
- package/src/lightning/datatable/rowSelectionShared.js +1 -0
- package/src/lightning/datatable/rows.js +224 -132
- package/src/lightning/datatable/rowsInlining.js +473 -0
- package/src/lightning/datatable/sort.js +40 -15
- package/src/lightning/datatable/state.js +17 -4
- package/src/lightning/datatable/templates/div/div.html +807 -91
- package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +29 -3
- package/src/lightning/datatable/templates/table/table.css +29 -1
- package/src/lightning/datatable/templates/table/table.html +786 -87
- package/src/lightning/datatable/tree.js +0 -33
- package/src/lightning/datatable/utils.js +50 -0
- package/src/lightning/datatable/virtualization.js +44 -19
- package/src/lightning/datatable/wrapText.js +7 -10
- package/src/lightning/datepicker/datepicker.html +3 -1
- package/src/lightning/datepicker/datepicker.js +43 -4
- package/src/lightning/datepicker/form-element.slds.css +5 -1
- package/src/lightning/datepicker/input-text.slds.css +5 -5
- package/src/lightning/datetimepicker/datetimepicker.html +7 -1
- package/src/lightning/datetimepicker/datetimepicker.js +30 -2
- package/src/lightning/datetimepicker/form-element.slds.css +5 -1
- package/src/lightning/datetimepicker/input-text.slds.css +5 -5
- package/src/lightning/dualListbox/form-element.slds.css +5 -1
- package/src/lightning/focusTrap/focusTrap.css +7 -0
- package/src/lightning/groupedCombobox/form-element.slds.css +5 -1
- package/src/lightning/groupedCombobox/input-text.slds.css +5 -5
- package/src/lightning/helptext/button-icon.slds.css +41 -25
- package/src/lightning/helptext/form-element.slds.css +5 -1
- package/src/lightning/icon/__docs__/icon.md +0 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/account_score.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_participant.html +11 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/app_form_product_participant.html +12 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/cost_model.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/labels.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_fee.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/list_rate.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/party_profile.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/people_score.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_schedule.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_adjustment_tier.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/rate_adjustment.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/whatsapp.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +40 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/array.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/bottom_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/cant_sync.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/center_group_alignment.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/columns.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/fully_synced.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/inner_join.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/join.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/left_join.html +14 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/macros.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_in_sync.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/not_saved.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/outer_join.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/right_join.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/skill.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/sync_in_progress.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/top_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/account_score.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_participant.html +11 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/cost_model.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_fee.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/list_rate.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/party_profile.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/people_score.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/rate_adjustment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/whatsapp.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +40 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/array.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/cant_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/center_group_alignment.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/columns.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/fully_synced.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/inner_join.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/join.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/left_join.html +14 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/macros.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_in_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/not_saved.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/outer_join.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/right_join.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/skill.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/sync_in_progress.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/top_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/account_score.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_participant.html +11 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/app_form_product_participant.html +12 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/cost_model.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_fee.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/list_rate.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/party_profile.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/people_score.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_schedule.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_adjustment_tier.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/rate_adjustment.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/whatsapp.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +19 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/account_score.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_participant.html +11 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/app_form_product_participant.html +12 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/cost_model.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_fee.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/list_rate.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/party_profile.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/people_score.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_schedule.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_adjustment_tier.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/rate_adjustment.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/whatsapp.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +19 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +22 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/array.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/bottom_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/cant_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/center_group_alignment.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/columns.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/fully_synced.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/inner_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/join.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/left_join.html +14 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/macros.html +2 -2
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_in_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/not_saved.html +9 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/outer_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/right_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/skill.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/sync_in_progress.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/top_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +22 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/aggregate.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/array.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/bottom_group_alignment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/cant_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/center_group_alignment.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/columns.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/fully_synced.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/inner_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/join.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/left_join.html +14 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/macros.html +2 -2
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_in_sync.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/not_saved.html +9 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/outer_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/path_experiment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/program_cohort_member.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/record_consent.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/right_join.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/skill.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/sync_in_progress.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/top_group_alignment.html +7 -0
- package/src/lightning/iconUtils/iconColors.js +1 -1
- package/src/lightning/input/form-element.slds.css +5 -1
- package/src/lightning/input/input.html +16 -2
- package/src/lightning/input/input.js +91 -3
- package/src/lightning/input/input.js-meta.xml +3 -0
- package/src/lightning/inputAddress/addressFormat.js +25 -11
- package/src/lightning/inputAddress/fieldsLayout.js +3 -0
- package/src/lightning/inputAddress/form-element.slds.css +5 -1
- package/src/lightning/inputAddress/input-text.slds.css +5 -5
- package/src/lightning/inputAddress/inputAddress.html +1 -1
- package/src/lightning/inputAddress/inputAddress.js +27 -11
- package/src/lightning/inputLocation/form-element.slds.css +5 -1
- package/src/lightning/inputLocation/input-text.slds.css +5 -5
- package/src/lightning/inputName/form-element.slds.css +5 -1
- package/src/lightning/inputName/input-text.slds.css +5 -5
- package/src/lightning/internationalizationLibrary/address/AddressFormat.js +2 -0
- package/src/lightning/layout/__docs__/layout.md +0 -2
- package/src/lightning/lookupAddress/form-element.slds.css +5 -1
- package/src/lightning/menuItem/menu-item.slds.css +3 -1
- package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +7 -3
- package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +18 -11
- package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +1 -1
- package/src/lightning/modalBase/modalBase.css +4 -0
- package/src/lightning/modalBase/modalBase.html +16 -21
- package/src/lightning/modalBase/modalBase.js +51 -87
- package/src/lightning/modalHeader/modalHeader.html +3 -15
- package/src/lightning/modalHeader/modalHeader.js +14 -61
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.css +14 -0
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.html +55 -0
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js +430 -0
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.js-meta.xml +4 -0
- package/src/lightning/overlayManager/overlayManager.js +16 -0
- package/src/lightning/pill/pill.js +19 -13
- package/src/lightning/pillContainer/button.slds.css +16 -15
- package/src/lightning/pillContainer/pillContainer.js +2 -1
- package/src/lightning/pillContainer/standardPillContainer.html +6 -2
- package/src/lightning/positionLibrary/direction.js +19 -0
- package/src/lightning/primitiveBubble/primitiveBubble.js +33 -11
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.html +2 -2
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +8 -0
- package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.css +34 -0
- package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.html +60 -0
- package/src/lightning/primitiveColumnSorter/primitiveColumnSorter.js +107 -0
- package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +37 -4
- package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.css +5 -0
- package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.html +9 -0
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +3 -3
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +1 -1
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +6 -5
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +1 -1
- package/src/lightning/primitiveInputColor/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputColor/input-text.slds.css +5 -5
- package/src/lightning/primitiveInputColor/primitiveInputColor.html +5 -2
- package/src/lightning/primitiveInputColor/primitiveInputColor.js +2 -0
- package/src/lightning/primitiveInputFile/button.slds.css +16 -15
- package/src/lightning/primitiveInputFile/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputFile/primitiveInputFile.html +1 -1
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +1 -1
- package/src/lightning/primitiveInputSimple/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputSimple/input-text.slds.css +5 -5
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +3 -2
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +15 -0
- package/src/lightning/primitiveInputToggle/form-element.slds.css +5 -1
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +16 -14
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +1 -1
- package/src/lightning/progressBar/progress-bar.slds.css +1 -1
- package/src/lightning/progressIndicator/path.html +8 -2
- package/src/lightning/progressIndicator/progressIndicator.js +26 -2
- package/src/lightning/progressRing/progress-ring.slds.css +1 -1
- package/src/lightning/progressStep/progressStep.js +2 -1
- package/src/lightning/prompt/prompt.js +11 -9
- package/src/lightning/radioGroup/form-element.slds.css +5 -1
- package/src/lightning/radioGroup/input-radio-group.slds.css +4 -10
- package/src/lightning/select/form-element.slds.css +5 -1
- package/src/lightning/select/select.js +89 -7
- package/src/lightning/tabBar/tab-bar.slds.css +11 -0
- package/src/lightning/tabset/tabset.slds.css +1 -1
- package/src/lightning/textarea/__examples__/various/various.html +18 -1
- package/src/lightning/textarea/form-element.slds.css +5 -1
- package/src/lightning/textarea/textarea.html +1 -0
- package/src/lightning/textarea/textarea.js +25 -0
- package/src/lightning/textarea/textarea.slds.css +2 -2
- package/src/lightning/timepicker/form-element.slds.css +5 -1
- package/src/lightning/timepicker/timepicker.html +4 -1
- package/src/lightning/timepicker/timepicker.js +3 -0
- package/src/lightning/toast/button-icon.slds.css +41 -25
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +4 -15
- package/src/lightning/verticalNavigationItem/vertical-navigation-item.slds.css +1 -1
- package/src/lightning/verticalNavigationItemBadge/badge.slds.css +1 -1
- package/src/lightning/verticalNavigationItemBadge/vertical-navigation-item.slds.css +1 -1
- package/src/lightning/verticalNavigationItemIcon/vertical-navigation-item.slds.css +1 -1
- package/src/lightning/verticalNavigationOverflow/button.slds.css +16 -15
- package/src/lightning/verticalNavigationOverflow/vertical-navigation-item.slds.css +1 -1
- package/scopedImports/@salesforce-label-LightningLookup.messageWhenSearchTermTooShort.js +0 -1
- package/src/lightning/datatable/columns-shared.js +0 -12
|
@@ -17,7 +17,7 @@ export function setErrors(state, errors) {
|
|
|
17
17
|
/**
|
|
18
18
|
* Resets row-level and table-level errors in datatable state object.
|
|
19
19
|
*
|
|
20
|
-
* @param {Object}
|
|
20
|
+
* @param {Object} state - The datatable state
|
|
21
21
|
*/
|
|
22
22
|
export function resetErrors(state) {
|
|
23
23
|
state.errors = {
|
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import { generateColKeyValue } from './columns';
|
|
2
|
-
|
|
3
1
|
export const HEADER_ROW_INDEX = -1;
|
|
4
2
|
export const HEADER_ROW_KEY = 'HEADER';
|
|
5
3
|
|
|
6
4
|
export function getCellFromIndexes(state, rowIndex, colIndex) {
|
|
7
5
|
const { columns, rows } = state;
|
|
8
|
-
if (columns.length >
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
: rows[rowIndex].key,
|
|
14
|
-
colKeyValue: generateColKeyValue(columns[colIndex], colIndex),
|
|
15
|
-
};
|
|
6
|
+
if (rows.length > rowIndex && columns.length > colIndex) {
|
|
7
|
+
const rowKeyValue =
|
|
8
|
+
rowIndex === HEADER_ROW_INDEX ? HEADER_ROW_KEY : rows[rowIndex].key;
|
|
9
|
+
const { colKeyValue } = columns[colIndex];
|
|
10
|
+
return state.indexes[`${rowKeyValue}-${colKeyValue}`];
|
|
16
11
|
}
|
|
17
12
|
return undefined;
|
|
18
13
|
}
|
|
19
14
|
|
|
15
|
+
export function getCellByKeys(state, rowKeyValue, colKeyValue) {
|
|
16
|
+
return state.indexes[`${rowKeyValue}-${colKeyValue}`];
|
|
17
|
+
}
|
|
18
|
+
|
|
20
19
|
export function getRowIndexByKey(state, rowKeyValue) {
|
|
21
20
|
const row = state.indexes[rowKeyValue];
|
|
22
21
|
return row ? row.rowIndex : undefined;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
export function getRowByKey(state,
|
|
26
|
-
return state.
|
|
24
|
+
export function getRowByKey(state, rowKeyValue) {
|
|
25
|
+
return state.indexes[rowKeyValue];
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
export function
|
|
30
|
-
const
|
|
31
|
-
return state.data[rowIndex];
|
|
28
|
+
export function getUserRowByKey(state, rowKeyValue) {
|
|
29
|
+
const row = state.indexes[rowKeyValue];
|
|
30
|
+
return row ? state.data[row.rowIndex] : undefined;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export function isValidCell(state, rowKeyValue, colKeyValue) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
const row = getRowByKey(state, rowKeyValue);
|
|
39
|
-
const colIndex = state.headerIndexes[colKeyValue];
|
|
34
|
+
return state.indexes[`${rowKeyValue}-${colKeyValue}`] !== undefined;
|
|
35
|
+
}
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
export function addHeaderIndex(headerIndexes, indexes, colKeyValue, colIndex) {
|
|
38
|
+
// Add header indexes.
|
|
39
|
+
const cellKeyValue = `${HEADER_ROW_KEY}-${colKeyValue}`;
|
|
40
|
+
const headerCell = {
|
|
41
|
+
cellKeyValue,
|
|
42
|
+
colIndex,
|
|
43
|
+
colKeyValue,
|
|
44
|
+
focused: false,
|
|
45
|
+
key: colKeyValue,
|
|
46
|
+
rowIndex: HEADER_ROW_INDEX,
|
|
47
|
+
rowKeyValue: HEADER_ROW_KEY,
|
|
48
|
+
};
|
|
49
|
+
// Store in caches early so data can be referenced by other methods
|
|
50
|
+
// during initialization.
|
|
51
|
+
headerIndexes[colIndex] = headerCell;
|
|
52
|
+
indexes[cellKeyValue] = headerCell;
|
|
42
53
|
}
|
|
@@ -94,7 +94,7 @@ export function handlePrefetch() {
|
|
|
94
94
|
if (
|
|
95
95
|
state.isLoading ||
|
|
96
96
|
!state.enableInfiniteLoading ||
|
|
97
|
-
(
|
|
97
|
+
(state.enableViewportRendering &&
|
|
98
98
|
this._renderManager &&
|
|
99
99
|
!this._renderManager.hasWrapperHeight()) ||
|
|
100
100
|
!hasData(template)
|
|
@@ -137,14 +137,15 @@ function isScrollerVisible(scroller) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
|
-
* Determines if a
|
|
140
|
+
* Determines if a template has data
|
|
141
141
|
*
|
|
142
|
-
* @param {Element}
|
|
142
|
+
* @param {Element} template The parent element to check
|
|
143
143
|
* @returns {Boolean} Whether or not the element contains any data
|
|
144
144
|
*/
|
|
145
|
-
function hasData(
|
|
145
|
+
function hasData(template) {
|
|
146
146
|
return (
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
template.querySelectorAll(
|
|
148
|
+
'tbody > tr, [role="rowgroup"] > [role="row"]'
|
|
149
|
+
).length > 0
|
|
149
150
|
);
|
|
150
151
|
}
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
getActiveCellElement,
|
|
11
11
|
isActiveCellEditable,
|
|
12
12
|
NAVIGATION_DIR,
|
|
13
|
-
|
|
13
|
+
getCellElementFromEventTarget,
|
|
14
14
|
} from './keyboard';
|
|
15
|
-
import {
|
|
15
|
+
import { updateRowsAndCells } from './rows';
|
|
16
16
|
import { getStateColumnIndex } from './columns';
|
|
17
17
|
import { resetErrors } from './errors';
|
|
18
18
|
import { setAriaSelectedOnCell, unsetAriaSelectedOnCell } from './rowSelection';
|
|
@@ -21,8 +21,9 @@ import {
|
|
|
21
21
|
getSelectedRowsKeys,
|
|
22
22
|
isSelectedRow,
|
|
23
23
|
} from './rowSelectionShared';
|
|
24
|
+
import { isObjectLike } from './utils';
|
|
24
25
|
import { hasOwnProperties } from 'lightning/utilsPrivate';
|
|
25
|
-
import {
|
|
26
|
+
import { getCellByKeys, getUserRowByKey, isValidCell } from './indexes';
|
|
26
27
|
|
|
27
28
|
const IEDIT_PANEL_SELECTOR = '[data-iedit-panel="true"]';
|
|
28
29
|
const HIDE_PANEL_THRESHOLD = 5; // hide panel on scroll
|
|
@@ -36,7 +37,8 @@ const HIDE_PANEL_THRESHOLD = 5; // hide panel on scroll
|
|
|
36
37
|
* which to open the inline edit panel. Must be valid and truthy.
|
|
37
38
|
*/
|
|
38
39
|
export function handleEditCell(event) {
|
|
39
|
-
|
|
40
|
+
const cellElement = getCellElementFromEventTarget(event.target);
|
|
41
|
+
openInlineEdit(this, cellElement);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
|
@@ -161,7 +163,7 @@ export function cancelInlineEdit(dt) {
|
|
|
161
163
|
resetErrors(state);
|
|
162
164
|
state.inlineEdit.dirtyValues = {};
|
|
163
165
|
dt._draftValues = [];
|
|
164
|
-
|
|
166
|
+
updateRowsAndCells(state, _privateTypes);
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
export function closeInlineEdit(dt) {
|
|
@@ -220,7 +222,11 @@ function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
|
220
222
|
if (shouldSaveData) {
|
|
221
223
|
const panel = template.querySelector(IEDIT_PANEL_SELECTOR);
|
|
222
224
|
const isValidEditValue = panel.validity.valid;
|
|
223
|
-
const currentValue =
|
|
225
|
+
const currentValue = getCellByKeys(
|
|
226
|
+
state,
|
|
227
|
+
rowKeyValue,
|
|
228
|
+
colKeyValue
|
|
229
|
+
).value;
|
|
224
230
|
const { isMassEditChecked: updateAllSelectedRows, value: editValue } =
|
|
225
231
|
panel;
|
|
226
232
|
|
|
@@ -247,7 +253,7 @@ function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
|
247
253
|
dispatchCellChangeEvent(dt, changes);
|
|
248
254
|
|
|
249
255
|
// TODO: do we need to update all rows in the dt or just the one that was modified?
|
|
250
|
-
|
|
256
|
+
updateRowsAndCells(state, dt._privateTypes);
|
|
251
257
|
}
|
|
252
258
|
}
|
|
253
259
|
|
|
@@ -285,10 +291,10 @@ function processInlineEditFinish(dt, reason, rowKeyValue, colKeyValue) {
|
|
|
285
291
|
* @param {Object} target - The LWC component instance (lightning-primitive-cell-factory) representing the cell in the
|
|
286
292
|
* datatable for which the inline edit panel is to be opened. Must be a truthy and valid reference.
|
|
287
293
|
*/
|
|
288
|
-
function openInlineEdit(dt,
|
|
289
|
-
startPanelPositioning(dt,
|
|
294
|
+
function openInlineEdit(dt, cellElement) {
|
|
295
|
+
startPanelPositioning(dt, cellElement);
|
|
290
296
|
|
|
291
|
-
const { state, template,
|
|
297
|
+
const { state, template, _privateTypes: types } = dt;
|
|
292
298
|
const { inlineEdit: inlineEditState } = state;
|
|
293
299
|
|
|
294
300
|
if (inlineEditState.isPanelVisible) {
|
|
@@ -302,15 +308,17 @@ function openInlineEdit(dt, target) {
|
|
|
302
308
|
);
|
|
303
309
|
}
|
|
304
310
|
|
|
305
|
-
const { rowKeyValue
|
|
306
|
-
const
|
|
311
|
+
const { rowKeyValue } = cellElement.parentElement.dataset;
|
|
312
|
+
const { colKeyValue } = cellElement.dataset;
|
|
313
|
+
const cell = getCellByKeys(state, rowKeyValue, colKeyValue);
|
|
314
|
+
const { colIndex } = cell;
|
|
307
315
|
const col = state.columns[colIndex];
|
|
308
316
|
|
|
309
317
|
inlineEditState.isPanelVisible = true;
|
|
310
318
|
inlineEditState.rowKeyValue = rowKeyValue;
|
|
311
319
|
inlineEditState.colKeyValue = colKeyValue;
|
|
312
320
|
inlineEditState.columnDef = col;
|
|
313
|
-
inlineEditState.editedValue =
|
|
321
|
+
inlineEditState.editedValue = cell.value;
|
|
314
322
|
inlineEditState.massEditSelectedRows = getCurrentSelectionLength(state);
|
|
315
323
|
inlineEditState.massEditEnabled =
|
|
316
324
|
inlineEditState.massEditSelectedRows > 1 &&
|
|
@@ -323,10 +331,9 @@ function openInlineEdit(dt, target) {
|
|
|
323
331
|
inlineEditState.resolvedTypeAttributes = resolveNestedTypeAttributes(
|
|
324
332
|
state,
|
|
325
333
|
rowKeyValue,
|
|
326
|
-
|
|
334
|
+
colIndex,
|
|
327
335
|
types,
|
|
328
|
-
typeAttributes
|
|
329
|
-
colIndex
|
|
336
|
+
typeAttributes
|
|
330
337
|
);
|
|
331
338
|
}
|
|
332
339
|
|
|
@@ -368,10 +375,7 @@ export function openInlineEditOnActiveCell(dt) {
|
|
|
368
375
|
if (!isActiveCellEditable(state)) {
|
|
369
376
|
const firstEditableCell = getFirstEditableCell(dt);
|
|
370
377
|
if (firstEditableCell) {
|
|
371
|
-
state.activeCell =
|
|
372
|
-
rowKeyValue: firstEditableCell.rowKeyValue,
|
|
373
|
-
colKeyValue: firstEditableCell.colKeyValue,
|
|
374
|
-
};
|
|
378
|
+
state.activeCell = firstEditableCell;
|
|
375
379
|
setFocusAndOpenInlineEdit(dt);
|
|
376
380
|
}
|
|
377
381
|
} else {
|
|
@@ -440,7 +444,7 @@ function stopPanelPositioning(dt) {
|
|
|
440
444
|
const { _positionRelationship } = dt;
|
|
441
445
|
if (_positionRelationship) {
|
|
442
446
|
stopPositioning(_positionRelationship);
|
|
443
|
-
dt._positionRelationship =
|
|
447
|
+
dt._positionRelationship = undefined;
|
|
444
448
|
}
|
|
445
449
|
}
|
|
446
450
|
|
|
@@ -571,9 +575,8 @@ function getResolvedCellChanges(state, rowChanges) {
|
|
|
571
575
|
const colKeyValue = changeColKeys[changeColIndex];
|
|
572
576
|
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
573
577
|
if (colIndex !== -1) {
|
|
574
|
-
const
|
|
575
|
-
cellChanges[
|
|
576
|
-
colChanges[colKeyValue];
|
|
578
|
+
const { name: colName } = columns[colIndex];
|
|
579
|
+
cellChanges[colName] = colChanges[colKeyValue];
|
|
577
580
|
}
|
|
578
581
|
}
|
|
579
582
|
result.push(cellChanges);
|
|
@@ -589,20 +592,18 @@ function getResolvedCellChanges(state, rowChanges) {
|
|
|
589
592
|
*
|
|
590
593
|
* @param {Object} state - The datatable state
|
|
591
594
|
* @param {String} rowKeyValue - The row key
|
|
592
|
-
* @param {
|
|
595
|
+
* @param {Number} colIndex - The column index
|
|
593
596
|
* @param {Object} types - The type handling factory
|
|
594
597
|
* @param {Object} typeAttributes - values of typeAttributes from column definition
|
|
595
|
-
* @param {Number} colIndex - The column index
|
|
596
598
|
*
|
|
597
599
|
* @returns {Object} The resolved typeAttributes.
|
|
598
600
|
*/
|
|
599
601
|
export function resolveNestedTypeAttributes(
|
|
600
602
|
state,
|
|
601
603
|
rowKeyValue,
|
|
602
|
-
|
|
604
|
+
colIndex,
|
|
603
605
|
types,
|
|
604
|
-
typeAttributes
|
|
605
|
-
colIndex
|
|
606
|
+
typeAttributes
|
|
606
607
|
) {
|
|
607
608
|
const col = state.columns[colIndex];
|
|
608
609
|
const typeDesc = typeAttributes && types.getType(col.type);
|
|
@@ -611,16 +612,20 @@ export function resolveNestedTypeAttributes(
|
|
|
611
612
|
if (attributeNames) {
|
|
612
613
|
const resolvedTypeAttributes = {};
|
|
613
614
|
const { length: attributeNamesLength } = attributeNames;
|
|
614
|
-
const _rowData =
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
615
|
+
const _rowData = attributeNamesLength
|
|
616
|
+
? getUserRowByKey(state, rowKeyValue)
|
|
617
|
+
: undefined;
|
|
618
|
+
if (_rowData) {
|
|
619
|
+
// We only want to resolve typeAttributes based on the custom types configuration
|
|
620
|
+
// If the attribute is not in that configuration, the value of attrValue
|
|
621
|
+
// for that will be undefined. This behavior is consistent with view cell.
|
|
622
|
+
for (let i = 0; i < attributeNamesLength; i += 1) {
|
|
623
|
+
const attrName = attributeNames[i];
|
|
624
|
+
const attrValue = typeAttributes[attrName];
|
|
625
|
+
if (attrValue) {
|
|
626
|
+
resolvedTypeAttributes[attrName] =
|
|
627
|
+
resolveNestedTypeAttributesHelper(_rowData, attrValue);
|
|
628
|
+
}
|
|
624
629
|
}
|
|
625
630
|
}
|
|
626
631
|
return resolvedTypeAttributes;
|
|
@@ -646,7 +651,7 @@ export function resolveNestedTypeAttributes(
|
|
|
646
651
|
*/
|
|
647
652
|
function resolveNestedTypeAttributesHelper(rowData, attrValue) {
|
|
648
653
|
let resolvedTypeAttributes = {};
|
|
649
|
-
if (!(
|
|
654
|
+
if (!isObjectLike(attrValue)) {
|
|
650
655
|
// Primitive value.
|
|
651
656
|
// For example, if the typeAttributes is { count: 5},
|
|
652
657
|
// 5 will be the attrValue passed in to the function.
|
|
@@ -666,7 +671,7 @@ function resolveNestedTypeAttributesHelper(rowData, attrValue) {
|
|
|
666
671
|
// so we need to check if key is 'fieldName' or not and resolve it immediately.
|
|
667
672
|
if (name === 'fieldName') {
|
|
668
673
|
resolvedTypeAttributes = rowData[value];
|
|
669
|
-
} else if (
|
|
674
|
+
} else if (isObjectLike(value)) {
|
|
670
675
|
// This is the case when attrValue is something like {label: {fieldName: 'name'}}.
|
|
671
676
|
// It's an object but the value maps a field name
|
|
672
677
|
const { fieldName } = value;
|
|
@@ -710,17 +715,16 @@ function getFirstEditableCell(dt) {
|
|
|
710
715
|
if (editableColumnsLength > 0) {
|
|
711
716
|
const { rows } = state;
|
|
712
717
|
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
713
|
-
const
|
|
718
|
+
const row = rows[rowIndex];
|
|
719
|
+
const { key: rowKeyValue } = row;
|
|
714
720
|
for (let i = 0; i < editableColumnsLength; i += 1) {
|
|
715
721
|
// Loop through the editable columns in order and examine the
|
|
716
722
|
// corresponding cells in the current row for editability,
|
|
717
723
|
// returning the first such cell that is editable.
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
colKeyValue: editableColumn.colKeyValue,
|
|
723
|
-
};
|
|
724
|
+
const { colKeyValue } = editableColumns[i];
|
|
725
|
+
const cell = getCellByKeys(state, rowKeyValue, colKeyValue);
|
|
726
|
+
if (cell && cell.editable) {
|
|
727
|
+
return cell;
|
|
724
728
|
}
|
|
725
729
|
}
|
|
726
730
|
}
|
|
@@ -729,22 +733,6 @@ function getFirstEditableCell(dt) {
|
|
|
729
733
|
return undefined;
|
|
730
734
|
}
|
|
731
735
|
|
|
732
|
-
/**
|
|
733
|
-
* Returns the current value of the cell, already takes into account the dirty value
|
|
734
|
-
*
|
|
735
|
-
* @param {Object} state - state of the datatable
|
|
736
|
-
* @param {String} rowKeyValue - row key
|
|
737
|
-
* @param {String} colKeyValue - column key
|
|
738
|
-
*
|
|
739
|
-
* @returns {Object} the value for the current cell.
|
|
740
|
-
*/
|
|
741
|
-
function getCellValue(state, rowKeyValue, colKeyValue) {
|
|
742
|
-
const row = getRowByKey(state, rowKeyValue);
|
|
743
|
-
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
744
|
-
|
|
745
|
-
return row.cells[colIndex].value;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
736
|
/**
|
|
749
737
|
* Sets `aria-selected` to true on cells whose rows are selected
|
|
750
738
|
* and are in the same column as the cell being currently edited
|