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
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { assert } from 'lightning/utilsPrivate';
|
|
2
|
-
import { classSet, isObjectLike } from './utils';
|
|
3
|
-
import { getAttributesNames } from './types';
|
|
4
|
-
import {
|
|
5
|
-
getCurrentSelectionLength,
|
|
6
|
-
SELECTABLE_HEADER_TYPE,
|
|
7
|
-
} from './rowSelectionShared';
|
|
1
|
+
import { assert, isRTL } from 'lightning/utilsPrivate';
|
|
8
2
|
import {
|
|
9
3
|
getTypeAttributesValues,
|
|
10
4
|
getSubTypeAttributesValues,
|
|
11
5
|
getCellAttributesValues,
|
|
12
|
-
generateColKeyValue,
|
|
13
6
|
} from './columns';
|
|
7
|
+
import { addHeaderIndex } from './indexes';
|
|
8
|
+
import {
|
|
9
|
+
setInliningProperties,
|
|
10
|
+
updateInlineCell,
|
|
11
|
+
updateInlineClassAndStyle,
|
|
12
|
+
updateInlineCellValue,
|
|
13
|
+
} from './rowsInlining';
|
|
14
14
|
import { getRowNumberError } from './rowNumber';
|
|
15
|
+
import {
|
|
16
|
+
getCurrentSelectionLength,
|
|
17
|
+
SELECTABLE_HEADER_TYPE,
|
|
18
|
+
SORTING_MENU_HEADER_TYPE,
|
|
19
|
+
} from './rowSelectionShared';
|
|
20
|
+
import { getAttributesNames } from './types';
|
|
21
|
+
import { classSet, isObjectLike } from './utils';
|
|
15
22
|
|
|
16
23
|
const CELL_EDIT_CLASS = 'slds-cell-edit';
|
|
17
24
|
const HAS_ERROR_CLASS = 'slds-has-error';
|
|
@@ -19,6 +26,16 @@ const IS_EDITED_CLASS = 'slds-is-edited';
|
|
|
19
26
|
const ROLE_BASED_CELL_CLASS = 'cell';
|
|
20
27
|
const TREE__ITEM_CLASS = 'slds-tree__item';
|
|
21
28
|
|
|
29
|
+
function resolveAttributeValue(attrValue, rowData) {
|
|
30
|
+
if (isObjectLike(attrValue)) {
|
|
31
|
+
const { fieldName } = attrValue;
|
|
32
|
+
if (fieldName) {
|
|
33
|
+
return rowData[fieldName];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return attrValue;
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
export function setKeyField(state, value) {
|
|
23
40
|
if (typeof value === 'string') {
|
|
24
41
|
state.keyField = value;
|
|
@@ -32,8 +49,7 @@ export function setKeyField(state, value) {
|
|
|
32
49
|
}
|
|
33
50
|
|
|
34
51
|
/**
|
|
35
|
-
*
|
|
36
|
-
* and generate cells indexes map(state.indexes)
|
|
52
|
+
* Compute state.rows and state.indexes based on the current normalized (data, columns).
|
|
37
53
|
*
|
|
38
54
|
* TODO: Reduce redundant calls to this function. This is indirectly called by the
|
|
39
55
|
* setters of 'data' and 'columns'. Additionally, for the role-based table, if we are
|
|
@@ -43,28 +59,38 @@ export function setKeyField(state, value) {
|
|
|
43
59
|
* @param {Object} state - The datatable state
|
|
44
60
|
* @param {Object} types - The type handling factory
|
|
45
61
|
*/
|
|
46
|
-
export function
|
|
62
|
+
export function updateRowsAndCells(state, types, datatableId) {
|
|
47
63
|
const {
|
|
48
64
|
columns,
|
|
49
65
|
data,
|
|
50
66
|
keyField,
|
|
51
67
|
maxRowSelection,
|
|
52
|
-
|
|
53
|
-
virtualize,
|
|
68
|
+
renderModeInline,
|
|
54
69
|
rowHeight,
|
|
70
|
+
virtualize,
|
|
55
71
|
} = state;
|
|
72
|
+
const { privateCustomTypes } = types;
|
|
73
|
+
const rtl = isRTL();
|
|
56
74
|
const { length: rowCount } = data;
|
|
57
|
-
const { dirtyValues } = state.inlineEdit;
|
|
58
75
|
const { length: colCount } = columns;
|
|
59
76
|
const currentSelectionLength =
|
|
60
77
|
maxRowSelection === 1 ? 1 : getCurrentSelectionLength(state);
|
|
61
78
|
const inputType = maxRowSelection === 1 ? 'radio' : 'checkbox';
|
|
79
|
+
const isInputTypeCheckbox = inputType === 'checkbox';
|
|
62
80
|
|
|
63
81
|
let scopeCol;
|
|
64
82
|
let treeColTypeAttrs;
|
|
83
|
+
|
|
84
|
+
// Initializing all indexes.
|
|
85
|
+
const indexes = {};
|
|
86
|
+
const headerIndexes = Array(colCount);
|
|
87
|
+
|
|
65
88
|
for (let colIndex = 0; colIndex < colCount; colIndex += 1) {
|
|
66
89
|
const col = columns[colIndex];
|
|
67
|
-
const { type: columnType } = col;
|
|
90
|
+
const { colKeyValue, type: columnType } = col;
|
|
91
|
+
addHeaderIndex(headerIndexes, indexes, colKeyValue, colIndex);
|
|
92
|
+
|
|
93
|
+
// Find scopeCol
|
|
68
94
|
if (!scopeCol && col.isScopeCol && types.isValidType(columnType)) {
|
|
69
95
|
scopeCol = col;
|
|
70
96
|
}
|
|
@@ -73,51 +99,64 @@ export function updateRowsAndCellIndexes(state, types) {
|
|
|
73
99
|
}
|
|
74
100
|
}
|
|
75
101
|
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
102
|
+
// create arrays to track inlined checkbox, lookup and url cells
|
|
103
|
+
// so they can get necessary updates on re-renders
|
|
104
|
+
const checkboxCells = [];
|
|
105
|
+
const lookupCells = [];
|
|
106
|
+
const shownUrlCells = [];
|
|
80
107
|
const rows = Array(rowCount);
|
|
108
|
+
|
|
109
|
+
// Store in caches early so data can be referenced by other methods
|
|
110
|
+
// during initialization.
|
|
111
|
+
|
|
112
|
+
// Untracked state changes.
|
|
113
|
+
state.checkboxCells = checkboxCells;
|
|
114
|
+
state.headerIndexes = headerIndexes;
|
|
115
|
+
state.indexes = indexes;
|
|
116
|
+
state.lookupCells = lookupCells;
|
|
117
|
+
state.shownUrlCells = shownUrlCells;
|
|
81
118
|
// Tracked state changes.
|
|
82
119
|
state.rows = rows;
|
|
83
120
|
|
|
121
|
+
// Add row indexes.
|
|
84
122
|
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
|
|
85
123
|
const rowData = data[rowIndex];
|
|
86
124
|
const rowDataKeyField = rowData[keyField];
|
|
87
125
|
const rowKeyValue = rowDataKeyField
|
|
88
126
|
? `${rowDataKeyField}`
|
|
89
127
|
: `row-${rowIndex}`;
|
|
90
|
-
const dirtyRowData = dirtyValues[rowKeyValue];
|
|
91
|
-
const rowErrors = errorsRows && errorsRows[rowKeyValue];
|
|
92
|
-
const cellErrors = rowErrors && rowErrors.cells;
|
|
93
|
-
const errorFieldNames = rowErrors && rowErrors.fieldNames;
|
|
94
128
|
|
|
95
129
|
state.indexes[rowKeyValue] = { rowIndex };
|
|
96
130
|
|
|
97
131
|
const isRowSelected = !!state.selectedRowsKeys[rowKeyValue];
|
|
132
|
+
const ariaSelected = isRowSelected ? 'true' : false;
|
|
98
133
|
const rowNumber = rowIndex + 1;
|
|
134
|
+
const scopeColValue = scopeCol
|
|
135
|
+
? rowData[scopeCol.fieldName]
|
|
136
|
+
: undefined;
|
|
99
137
|
const cells = Array(colCount);
|
|
138
|
+
const checkboxHidden = state.hideCheckboxColumn;
|
|
100
139
|
|
|
101
140
|
const row = {
|
|
102
|
-
key: rowKeyValue,
|
|
103
|
-
cells,
|
|
104
|
-
rowIndex,
|
|
105
|
-
rowNumber, // for UTAM since methods are base-1
|
|
106
141
|
ariaRowIndex: rowIndex + 2, // aria attrs are base-1 and also count header as a row
|
|
142
|
+
ariaSelected: checkboxHidden ? null : ariaSelected,
|
|
143
|
+
cells,
|
|
144
|
+
classnames: `slds-hint-parent${
|
|
145
|
+
isRowSelected ? ' slds-is-selected' : ''
|
|
146
|
+
}`,
|
|
107
147
|
inputType,
|
|
108
148
|
isSelected: isRowSelected,
|
|
109
|
-
ariaSelected: isRowSelected ? 'true' : false,
|
|
110
149
|
isDisabled:
|
|
111
150
|
!isRowSelected &&
|
|
112
151
|
maxRowSelection !== 1 &&
|
|
113
152
|
currentSelectionLength === maxRowSelection,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
tabIndex: -1,
|
|
153
|
+
key: rowKeyValue,
|
|
154
|
+
rowIndex,
|
|
155
|
+
rowNumber, // for UTAM since methods are base-1
|
|
118
156
|
style: virtualize
|
|
119
157
|
? `position:absolute;top:${rowIndex * rowHeight}px;`
|
|
120
158
|
: '',
|
|
159
|
+
tabIndex: -1,
|
|
121
160
|
level: undefined,
|
|
122
161
|
posInSet: undefined,
|
|
123
162
|
setSize: undefined,
|
|
@@ -146,70 +185,83 @@ export function updateRowsAndCellIndexes(state, types) {
|
|
|
146
185
|
resolveAttributeValue(treeColTypeAttrs.setSize, rowData) || 1;
|
|
147
186
|
}
|
|
148
187
|
|
|
188
|
+
// Store in caches early so data can be referenced by other methods
|
|
189
|
+
// during initialization.
|
|
190
|
+
indexes[rowKeyValue] = row;
|
|
149
191
|
rows[rowIndex] = row;
|
|
150
192
|
|
|
151
193
|
// Add cell indexes.
|
|
152
194
|
for (let colIndex = 0; colIndex < colCount; colIndex += 1) {
|
|
153
195
|
const col = columns[colIndex];
|
|
154
196
|
const {
|
|
155
|
-
|
|
156
|
-
fieldName,
|
|
197
|
+
colKeyValue,
|
|
157
198
|
isScopeCol,
|
|
158
199
|
label: dataLabel,
|
|
159
200
|
type: columnType,
|
|
160
201
|
typeAttributes,
|
|
161
202
|
} = col;
|
|
162
|
-
const
|
|
203
|
+
const cellKeyValue = `${rowKeyValue}-${colKeyValue}`;
|
|
163
204
|
const columnSubType = typeAttributes
|
|
164
205
|
? typeAttributes.subType
|
|
165
206
|
: undefined;
|
|
166
|
-
const dirtyValue = dirtyRowData && dirtyRowData[colKeyValue];
|
|
167
|
-
const hasError = columnKey
|
|
168
|
-
? !!(cellErrors && cellErrors[columnKey])
|
|
169
|
-
: !!(errorFieldNames && errorFieldNames.includes(fieldName));
|
|
170
207
|
const hasTreeData = columnType === 'tree';
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
208
|
+
const privateType =
|
|
209
|
+
privateCustomTypes && privateCustomTypes.get(columnType);
|
|
210
|
+
const standardCellLayout = privateType
|
|
211
|
+
? privateType.standardCellLayout
|
|
212
|
+
: false;
|
|
174
213
|
const displayReadOnlyIcon = !!col.displayReadOnlyIcon;
|
|
175
|
-
const editable =
|
|
214
|
+
const editable = !!resolveAttributeValue(col.editable, rowData);
|
|
215
|
+
const isEditable = editable && types.isEditableType(columnType);
|
|
176
216
|
const isValidType = types.isValidType(columnType);
|
|
177
217
|
const isCheckbox = columnType === SELECTABLE_HEADER_TYPE;
|
|
218
|
+
const isSortingMenu = columnType === SORTING_MENU_HEADER_TYPE;
|
|
219
|
+
const isCustom = privateType !== undefined;
|
|
220
|
+
const isCustomBareLayout = isCustom && !standardCellLayout;
|
|
221
|
+
const isCustomStandardLayout = isCustom && standardCellLayout;
|
|
178
222
|
const isDataType = isValidType && !isScopeCol;
|
|
179
223
|
const isDataTypeScope = isValidType && isScopeCol;
|
|
180
224
|
|
|
181
225
|
// cell object creation
|
|
182
226
|
const cell = {
|
|
183
227
|
ariaReadOnly: !editable,
|
|
228
|
+
cellKeyValue,
|
|
184
229
|
class: '',
|
|
230
|
+
colIndex,
|
|
185
231
|
colKeyValue, // unique column key value
|
|
186
232
|
columnSubType,
|
|
187
233
|
columnType,
|
|
188
234
|
dataLabel,
|
|
189
|
-
describedBy: dirtyValue ? 'unsaved-cell-notification' : null,
|
|
190
235
|
displayReadOnlyIcon,
|
|
191
236
|
displayValue: rowData.displayValue || '',
|
|
237
|
+
describedBy: null,
|
|
192
238
|
editable,
|
|
193
|
-
hasError,
|
|
239
|
+
hasError: undefined,
|
|
240
|
+
hasTreeData,
|
|
194
241
|
isCheckbox,
|
|
242
|
+
isCustom,
|
|
243
|
+
isCustomBareLayout,
|
|
244
|
+
isCustomStandardLayout,
|
|
195
245
|
isDataType,
|
|
196
246
|
isDataTypeScope,
|
|
197
|
-
|
|
198
|
-
|
|
247
|
+
isEditable,
|
|
248
|
+
isRTL: rtl,
|
|
249
|
+
isSortingMenu,
|
|
250
|
+
rowIndex,
|
|
251
|
+
rowKeyValue, // unique row key value
|
|
252
|
+
rowNumber,
|
|
253
|
+
scopeColValue,
|
|
254
|
+
style: '',
|
|
199
255
|
tabIndex: -1,
|
|
200
|
-
value,
|
|
201
|
-
wrapText:
|
|
202
|
-
wrapTextMaxLines:
|
|
203
|
-
? state.wrapTextMaxLines
|
|
204
|
-
: undefined,
|
|
256
|
+
value: undefined,
|
|
257
|
+
wrapText: undefined, // wrapText state
|
|
258
|
+
wrapTextMaxLines: 0,
|
|
205
259
|
};
|
|
206
260
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
renderModeRoleBased
|
|
212
|
-
);
|
|
261
|
+
// Store in caches early so data can be referenced by other methods
|
|
262
|
+
// during initialization.
|
|
263
|
+
indexes[cellKeyValue] = cell;
|
|
264
|
+
cells[colIndex] = cell;
|
|
213
265
|
|
|
214
266
|
if (!col.internal) {
|
|
215
267
|
// Assign cell type or cell subType attributes.
|
|
@@ -219,7 +271,8 @@ export function updateRowsAndCellIndexes(state, types) {
|
|
|
219
271
|
attributeNames = getAttributesNames(columnSubType);
|
|
220
272
|
attributeValues = getSubTypeAttributesValues(col);
|
|
221
273
|
} else {
|
|
222
|
-
|
|
274
|
+
const typeDesc = types.getType(columnType);
|
|
275
|
+
attributeNames = typeDesc && typeDesc.typeAttributes;
|
|
223
276
|
attributeValues = getTypeAttributesValues(col);
|
|
224
277
|
}
|
|
225
278
|
const attributeNamesLength = attributeNames
|
|
@@ -241,7 +294,7 @@ export function updateRowsAndCellIndexes(state, types) {
|
|
|
241
294
|
// object in each row.
|
|
242
295
|
const cellAttributes = getCellAttributesValues(col);
|
|
243
296
|
const keys = Object.keys(cellAttributes);
|
|
244
|
-
for (let i = 0
|
|
297
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
245
298
|
const attrName = keys[i];
|
|
246
299
|
const attrValue = cellAttributes[attrName];
|
|
247
300
|
cell[attrName] = resolveAttributeValue(attrValue, rowData);
|
|
@@ -260,40 +313,123 @@ export function updateRowsAndCellIndexes(state, types) {
|
|
|
260
313
|
cell.typeAttribute22 = row.isExpanded === 'true';
|
|
261
314
|
}
|
|
262
315
|
}
|
|
263
|
-
// Populate row number attributes.
|
|
264
|
-
else if (columnType === 'rowNumber') {
|
|
265
|
-
const scopeColValue = rowData[scopeCol.fieldName];
|
|
266
|
-
// computes and sets the resolved typeAttribute for the row
|
|
267
|
-
// number column error state
|
|
268
|
-
cell.typeAttribute0 = getRowNumberError(
|
|
269
|
-
rowErrors,
|
|
270
|
-
scopeColValue
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
316
|
|
|
274
317
|
// adding cell indexes to state.indexes
|
|
275
318
|
// Keeping the hash for backward compatibility, but we need to have 2 indexes, 1 for columns and one for rows,
|
|
276
319
|
// because of memory usage and also at certain point we might have the data but not the columns
|
|
277
320
|
state.indexes[row.key][colKeyValue] = [rowIndex, colIndex];
|
|
278
321
|
cells[colIndex] = cell;
|
|
322
|
+
|
|
323
|
+
if (renderModeInline) {
|
|
324
|
+
setInliningProperties(
|
|
325
|
+
state,
|
|
326
|
+
cell,
|
|
327
|
+
isInputTypeCheckbox,
|
|
328
|
+
datatableId
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
// Update cell properties including class, style, and value properties.
|
|
332
|
+
updateCell(state, rowIndex, colIndex);
|
|
333
|
+
|
|
334
|
+
// Update shownUrlCells state since it's dependent on updateCell
|
|
335
|
+
if (cell.showUrlLink) {
|
|
336
|
+
shownUrlCells.push(cell);
|
|
337
|
+
}
|
|
279
338
|
}
|
|
280
339
|
}
|
|
340
|
+
|
|
341
|
+
state.hasCalledUpdateRowsAndCells = true;
|
|
281
342
|
}
|
|
282
343
|
|
|
283
344
|
/**
|
|
284
|
-
*
|
|
345
|
+
* Cells are normally updated via updateRowsAndCells().
|
|
346
|
+
* However, a smaller update can be used when modifying datatable properties
|
|
347
|
+
* such as dt.errors and dt.wrapTextMaxLines.
|
|
285
348
|
*
|
|
286
|
-
*
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
349
|
+
* @param {Object} state - The datatable state
|
|
350
|
+
*/
|
|
351
|
+
export function updateCells(state, types) {
|
|
352
|
+
if (!state.hasCalledUpdateRowsAndCells) {
|
|
353
|
+
updateRowsAndCells(state, types);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const { rows } = state;
|
|
357
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
358
|
+
for (
|
|
359
|
+
let colIndex = 0;
|
|
360
|
+
colIndex < rows[rowIndex].cells.length;
|
|
361
|
+
colIndex += 1
|
|
362
|
+
) {
|
|
363
|
+
updateCell(state, rowIndex, colIndex);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Performs a smaller update on the cell at the given rowIndex and colIndex.
|
|
370
|
+
* Used by updateCells() and updateWrapTextAndMaxLinesValuesInCells().
|
|
291
371
|
*
|
|
292
|
-
* @param {
|
|
293
|
-
* @param {
|
|
372
|
+
* @param {Object} state - The tracked datatable state
|
|
373
|
+
* @param {Object} rowIndex - The cell row index
|
|
374
|
+
* @param {Object} colIndex - The cell column index
|
|
294
375
|
*/
|
|
295
|
-
export function
|
|
296
|
-
|
|
376
|
+
export function updateCell(state, rowIndex, colIndex) {
|
|
377
|
+
const { renderModeRoleBased } = state;
|
|
378
|
+
const { rows: errorsRows } = state.errors;
|
|
379
|
+
const row = state.rows[rowIndex];
|
|
380
|
+
const rowData = state.data[rowIndex];
|
|
381
|
+
const { key: rowKeyValue } = row;
|
|
382
|
+
const dirtyRowData = state.inlineEdit.dirtyValues[rowKeyValue];
|
|
383
|
+
const rowErrors = errorsRows && errorsRows[rowKeyValue];
|
|
384
|
+
const cellErrors = rowErrors && rowErrors.cells;
|
|
385
|
+
const errorFieldNames = rowErrors && rowErrors.fieldNames;
|
|
386
|
+
const col = state.columns[colIndex];
|
|
387
|
+
const cell = row.cells[colIndex];
|
|
388
|
+
const { colKeyValue, columnKey, fieldName } = col;
|
|
389
|
+
const dirtyValue = dirtyRowData && dirtyRowData[colKeyValue];
|
|
390
|
+
const hasError = columnKey
|
|
391
|
+
? !!(cellErrors && cellErrors[columnKey])
|
|
392
|
+
: !!(errorFieldNames && errorFieldNames.includes(fieldName));
|
|
393
|
+
// value based on the fieldName
|
|
394
|
+
const value = dirtyValue === undefined ? rowData[fieldName] : dirtyValue;
|
|
395
|
+
const wrapText = state.wrapText[colKeyValue];
|
|
396
|
+
const wrapTextMaxLines = wrapText ? state.wrapTextMaxLines : undefined;
|
|
397
|
+
|
|
398
|
+
cell.hasError = hasError;
|
|
399
|
+
cell.wrapText = wrapText;
|
|
400
|
+
cell.wrapTextMaxLines = wrapTextMaxLines;
|
|
401
|
+
cell.value = value;
|
|
402
|
+
|
|
403
|
+
if (col.internal && col.type === 'rowNumber') {
|
|
404
|
+
cell.typeAttribute0 = getRowNumberError(rowErrors, cell.scopeColValue);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
let cellClass = cell.class;
|
|
408
|
+
if (cell.displayReadOnlyIcon || cell.editable) {
|
|
409
|
+
cellClass += (cellClass.length ? ' ' : '') + CELL_EDIT_CLASS;
|
|
410
|
+
}
|
|
411
|
+
if (cell.hasTreeData) {
|
|
412
|
+
cellClass += (cellClass.length ? ' ' : '') + TREE__ITEM_CLASS;
|
|
413
|
+
}
|
|
414
|
+
if (hasError) {
|
|
415
|
+
cellClass += (cellClass.length ? ' ' : '') + HAS_ERROR_CLASS;
|
|
416
|
+
}
|
|
417
|
+
if (dirtyValue !== undefined) {
|
|
418
|
+
cellClass += (cellClass.length ? ' ' : '') + IS_EDITED_CLASS;
|
|
419
|
+
cell.describedBy = 'unsaved-cell-notification';
|
|
420
|
+
}
|
|
421
|
+
if (renderModeRoleBased) {
|
|
422
|
+
cellClass += (cellClass.length ? ' ' : '') + ROLE_BASED_CELL_CLASS;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
cell.class = cellClass;
|
|
426
|
+
cell.style = computeCellStyles(cell, col, renderModeRoleBased);
|
|
427
|
+
|
|
428
|
+
if (cell.isInlined) {
|
|
429
|
+
updateInlineCell(cell);
|
|
430
|
+
updateInlineClassAndStyle(cell, cellClass);
|
|
431
|
+
updateInlineCellValue(cell, value);
|
|
432
|
+
}
|
|
297
433
|
}
|
|
298
434
|
|
|
299
435
|
/**
|
|
@@ -308,14 +444,9 @@ export function isCellEditable(rowData, col) {
|
|
|
308
444
|
* @param {Boolean} renderModeRoleBased - render mode of datatable (div || table)
|
|
309
445
|
* @returns {String} - styles to be set on the cell
|
|
310
446
|
*/
|
|
311
|
-
function computeCellStyles(
|
|
312
|
-
const columnType = col.type;
|
|
313
|
-
|
|
447
|
+
function computeCellStyles(cell, col, renderModeRoleBased) {
|
|
314
448
|
let cellStyle = '';
|
|
315
|
-
if (
|
|
316
|
-
types.isCustomType(columnType) &&
|
|
317
|
-
!types.isStandardCellLayoutForCustomType(columnType)
|
|
318
|
-
) {
|
|
449
|
+
if (cell.isCustomBareLayout) {
|
|
319
450
|
// When a custom type is not using the standard layout,
|
|
320
451
|
// remove the padding that comes with the standard layout
|
|
321
452
|
cellStyle = 'padding: 0;';
|
|
@@ -332,45 +463,6 @@ function computeCellStyles(types, col, renderModeRoleBased) {
|
|
|
332
463
|
return cellStyle;
|
|
333
464
|
}
|
|
334
465
|
|
|
335
|
-
function computeCellClassNames(
|
|
336
|
-
cell,
|
|
337
|
-
hasTreeData,
|
|
338
|
-
dirtyValue,
|
|
339
|
-
renderModeRoleBased
|
|
340
|
-
) {
|
|
341
|
-
// TODO: With the current SLDS design, the 'slds-cell-edit' class is required on a cell in cases
|
|
342
|
-
// where the read only icon is to be displayed. This is an issue with their design that will need to
|
|
343
|
-
// be addressed on their end, so once they do that we can modify this code accordingly.
|
|
344
|
-
let cellClass = '';
|
|
345
|
-
if (cell.displayReadOnlyIcon || cell.editable) {
|
|
346
|
-
cellClass += CELL_EDIT_CLASS;
|
|
347
|
-
}
|
|
348
|
-
if (hasTreeData) {
|
|
349
|
-
cellClass += (cellClass.length ? ' ' : '') + TREE__ITEM_CLASS;
|
|
350
|
-
}
|
|
351
|
-
if (cell.hasError) {
|
|
352
|
-
cellClass += (cellClass.length ? ' ' : '') + HAS_ERROR_CLASS;
|
|
353
|
-
}
|
|
354
|
-
if (dirtyValue !== undefined) {
|
|
355
|
-
cellClass += (cellClass.length ? ' ' : '') + IS_EDITED_CLASS;
|
|
356
|
-
}
|
|
357
|
-
if (renderModeRoleBased) {
|
|
358
|
-
cellClass += (cellClass.length ? ' ' : '') + ROLE_BASED_CELL_CLASS;
|
|
359
|
-
}
|
|
360
|
-
return cellClass;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function resolveAttributeValue(attrValue, rowData) {
|
|
364
|
-
if (isObjectLike(attrValue)) {
|
|
365
|
-
const { fieldName } = attrValue;
|
|
366
|
-
if (fieldName) {
|
|
367
|
-
return rowData[fieldName];
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
return attrValue;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
466
|
/**
|
|
375
467
|
* For the role-based table, we need to manage the width of each cell separately.
|
|
376
468
|
* Re-compute the cell styles so that the width of the cell is set
|
|
@@ -378,27 +470,27 @@ function resolveAttributeValue(attrValue, rowData) {
|
|
|
378
470
|
*
|
|
379
471
|
* @param {Object} state - Datatable's state object
|
|
380
472
|
*/
|
|
381
|
-
export function recomputeCellStyles(
|
|
473
|
+
export function recomputeCellStyles(state) {
|
|
382
474
|
const { columns } = state;
|
|
383
475
|
state.rows.forEach((row) => {
|
|
384
476
|
row.cells.forEach((cell, colIndex) => {
|
|
385
477
|
const colData = columns[colIndex];
|
|
386
|
-
cell.style = computeCellStyles(
|
|
478
|
+
cell.style = computeCellStyles(cell, colData, true);
|
|
387
479
|
});
|
|
388
480
|
});
|
|
389
481
|
}
|
|
390
482
|
|
|
391
483
|
/**
|
|
392
|
-
* The cells' classes are normally updated via `
|
|
393
|
-
* happens after renderMode is set since `
|
|
484
|
+
* The cells' classes are normally updated via `updateRowsAndCells()`. This ideally
|
|
485
|
+
* happens after renderMode is set since `updateRowsAndCells` requires the final
|
|
394
486
|
* renderMode value in order to set the 'cell' class on each cell.
|
|
395
487
|
*
|
|
396
|
-
* However, in some cases, it's possible that
|
|
488
|
+
* However, in some cases, it's possible that updateRowsAndCells is called
|
|
397
489
|
* before the renderMode is set (to 'role-based'). This will cause the 'cell' class to NOT be set
|
|
398
490
|
* in the individual cells because state.renderModeRoleBased will be `false` at that point.
|
|
399
491
|
* As a result, positioning of the cell content will be off.
|
|
400
492
|
*
|
|
401
|
-
* In such a case where the renderMode is 'role-based' and when the
|
|
493
|
+
* In such a case where the renderMode is 'role-based' and when the updateRowsAndCells
|
|
402
494
|
* has already been called (indicated by the presence of 'state.rows'), retroactively
|
|
403
495
|
* add the 'cell' class to each cell.
|
|
404
496
|
*
|