lightning-base-components 1.21.6-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 +45 -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/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 +1 -0
- 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 +74 -25
- package/src/lightning/datatable/datatable.js +493 -133
- package/src/lightning/datatable/errors.js +1 -1
- package/src/lightning/datatable/indexes.js +32 -19
- package/src/lightning/datatable/infiniteLoading.js +6 -5
- package/src/lightning/datatable/inlineEdit.js +45 -59
- package/src/lightning/datatable/keyboard.js +571 -160
- package/src/lightning/datatable/renderManager.js +12 -9
- 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 +132 -24
- package/src/lightning/datatable/rowsInlining.js +473 -0
- package/src/lightning/datatable/sort.js +8 -4
- package/src/lightning/datatable/state.js +12 -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/utils.js +39 -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 +31 -1
- package/src/lightning/datepicker/form-element.slds.css +1 -0
- 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 +1 -0
- package/src/lightning/datetimepicker/input-text.slds.css +5 -5
- package/src/lightning/dualListbox/form-element.slds.css +1 -0
- package/src/lightning/focusTrap/focusTrap.css +7 -0
- package/src/lightning/groupedCombobox/form-element.slds.css +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/src/lightning/inputLocation/input-text.slds.css +5 -5
- package/src/lightning/inputName/form-element.slds.css +1 -0
- 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 +1 -0
- 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 +46 -65
- 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 +7 -0
- 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 +36 -3
- package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.css +5 -0
- package/src/lightning/primitiveHeaderFactory/sortingMenuHeader.html +9 -0
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.html +1 -1
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +1 -1
- package/src/lightning/primitiveInputSimple/form-element.slds.css +1 -0
- 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 +1 -0
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +16 -14
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +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 +1 -0
- package/src/lightning/radioGroup/input-radio-group.slds.css +4 -10
- package/src/lightning/select/form-element.slds.css +1 -0
- 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/form-element.slds.css +1 -0
- package/src/lightning/textarea/textarea.html +1 -0
- package/src/lightning/textarea/textarea.slds.css +2 -2
- package/src/lightning/timepicker/form-element.slds.css +1 -0
- 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/verticalNavigationOverflow/button.slds.css +16 -15
- package/scopedImports/@salesforce-label-LightningLookup.messageWhenSearchTermTooShort.js +0 -1
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import labelEdit from '@salesforce/label/LightningDatatable.edit';
|
|
2
|
+
import labelEditHasError from '@salesforce/label/LightningDatatable.editHasError';
|
|
3
|
+
import labelEmailLabel from '@salesforce/label/LightningFormattedEmail.emailIconLabel';
|
|
4
|
+
import labelFalse from '@salesforce/label/LightningDatatable.false';
|
|
5
|
+
import labelSelectItem from '@salesforce/label/LightningDatatable.selectItem';
|
|
6
|
+
import labelTrue from '@salesforce/label/LightningDatatable.true';
|
|
7
|
+
import {
|
|
8
|
+
dateTimeFormat,
|
|
9
|
+
numberFormat,
|
|
10
|
+
toDate,
|
|
11
|
+
} from 'lightning/internationalizationLibrary';
|
|
12
|
+
import {
|
|
13
|
+
isTextIgnoreRTL,
|
|
14
|
+
isValidPhone,
|
|
15
|
+
makeAbsoluteUrl,
|
|
16
|
+
parseToFormattedLinkifiedParts,
|
|
17
|
+
toFormattedLocation,
|
|
18
|
+
toFormattedNumber,
|
|
19
|
+
toFormattedDate,
|
|
20
|
+
toNorthAmericanPhoneNumber,
|
|
21
|
+
} from 'lightning/utilsPrivate';
|
|
22
|
+
import { TOOLTIP_ALLOWANCE } from './rowNumber';
|
|
23
|
+
import { getDefaultState } from './state';
|
|
24
|
+
|
|
25
|
+
const CELL_MARGIN_LEFT_CLASS = 'slds-m-left_x-small';
|
|
26
|
+
const CELL_WRAP = 'slds-cell-wrap';
|
|
27
|
+
const GRID_CLASS = 'slds-grid';
|
|
28
|
+
const GRID_ALIGN_END_CLASS = 'slds-grid_align-end';
|
|
29
|
+
const GRID_ALIGN_SPREAD_CLASS = 'slds-grid_align-spread';
|
|
30
|
+
const HYPHENATE_CLASS = 'slds-hyphenate';
|
|
31
|
+
const LINE_CLAMP_CLASS = 'slds-line-clamp';
|
|
32
|
+
const LTR_CONTENT_IN_RTL_CLASS = 'ltr-content-in-rtl';
|
|
33
|
+
const NO_SPACE_CLASS = 'slds-no-space';
|
|
34
|
+
const TRUNCATE_CLASS = 'slds-truncate';
|
|
35
|
+
|
|
36
|
+
const { keyboardMode: DEFAULT_KEYBOARD_MODE } = getDefaultState();
|
|
37
|
+
|
|
38
|
+
const i18n = {
|
|
39
|
+
edit: labelEdit,
|
|
40
|
+
editHasError: labelEditHasError,
|
|
41
|
+
emailLabel: labelEmailLabel,
|
|
42
|
+
false: labelFalse,
|
|
43
|
+
selectItem: labelSelectItem,
|
|
44
|
+
true: labelTrue,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const noopHandler = () => {};
|
|
48
|
+
|
|
49
|
+
const BASE_INLINING_PROPS = {
|
|
50
|
+
isInlined: true,
|
|
51
|
+
actionableElementsCount: 0,
|
|
52
|
+
computedCellDivClass: '',
|
|
53
|
+
computedCellDivStyle: '',
|
|
54
|
+
computedMarginClassWhenLeftIconExists: '',
|
|
55
|
+
computedWrapperClass: '',
|
|
56
|
+
currentInputIndex: 0,
|
|
57
|
+
editIconAssistiveText: '',
|
|
58
|
+
hasFocus: false,
|
|
59
|
+
hasLeftIcon: false,
|
|
60
|
+
hasRightIcon: false,
|
|
61
|
+
internalTabIndex: -1,
|
|
62
|
+
isRTL: false, // url, email, phone
|
|
63
|
+
mode: DEFAULT_KEYBOARD_MODE,
|
|
64
|
+
shouldDisplayReadOnlyIcon: false,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Adds all properties to cell required to inline the given type
|
|
69
|
+
*
|
|
70
|
+
* @param {Object} state - The datatable state
|
|
71
|
+
* @param {Object} cell - The datatable cell
|
|
72
|
+
* @param {Boolean} isInputTypeCheckbox - Whether input is using checkbox type
|
|
73
|
+
* @param {String} datatableId - Unique id for the datatable
|
|
74
|
+
*/
|
|
75
|
+
export function setInliningProperties(
|
|
76
|
+
state,
|
|
77
|
+
cell,
|
|
78
|
+
isInputTypeCheckbox,
|
|
79
|
+
datatableId
|
|
80
|
+
) {
|
|
81
|
+
const { columnSubType, columnType, isCheckbox, isCustom } = cell;
|
|
82
|
+
|
|
83
|
+
// boolean
|
|
84
|
+
if ('boolean' === columnType || 'boolean' === columnSubType) {
|
|
85
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
86
|
+
isBoolean: true,
|
|
87
|
+
isChecked: false,
|
|
88
|
+
booleanCellAssistiveText: '',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// checkbox
|
|
92
|
+
else if (isCheckbox && isInputTypeCheckbox) {
|
|
93
|
+
const { rowNumber } = cell;
|
|
94
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
95
|
+
checkboxId: `${datatableId}-check-id-${rowNumber}`,
|
|
96
|
+
checkboxLabelId: `check-button-label-${rowNumber}`,
|
|
97
|
+
checkboxName: `${datatableId}-options-${rowNumber}`,
|
|
98
|
+
checkboxSelectItemAssistiveText: `${i18n.selectItem} ${rowNumber}`,
|
|
99
|
+
});
|
|
100
|
+
state.checkboxCells.push(cell);
|
|
101
|
+
}
|
|
102
|
+
// radio
|
|
103
|
+
else if (isCheckbox) {
|
|
104
|
+
// radio inputs are not inlined
|
|
105
|
+
Object.assign(cell, { isInlined: false });
|
|
106
|
+
}
|
|
107
|
+
// custom
|
|
108
|
+
else if (isCustom) {
|
|
109
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
110
|
+
keyboardMode: '', // should be defined
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// currency
|
|
114
|
+
else if ('currency' === columnType || 'currency' === columnSubType) {
|
|
115
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
116
|
+
isCurrency: true,
|
|
117
|
+
currencyValue: '',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// date-local
|
|
121
|
+
else if ('date-local' === columnType || 'date-local' === columnSubType) {
|
|
122
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
123
|
+
isDateLocal: true,
|
|
124
|
+
dateLocalValue: '',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// date
|
|
128
|
+
else if ('date' === columnType || 'date' === columnSubType) {
|
|
129
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
130
|
+
isDateTime: true,
|
|
131
|
+
dateTimeValue: '',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
// email
|
|
135
|
+
else if ('email' === columnType || 'email' === columnSubType) {
|
|
136
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
137
|
+
isEmail: true,
|
|
138
|
+
emailIconAssistiveText: '',
|
|
139
|
+
emailIconHidden: false,
|
|
140
|
+
emailLabel: '',
|
|
141
|
+
showEmailLink: false,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// location
|
|
145
|
+
else if ('location' === columnType || 'location' === columnSubType) {
|
|
146
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
147
|
+
isLocation: true,
|
|
148
|
+
locationValue: '',
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// lookup
|
|
152
|
+
else if ('reference' === columnType || 'reference' === columnSubType) {
|
|
153
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
154
|
+
isLookup: true,
|
|
155
|
+
_handleLookupAnchorClick: noopHandler,
|
|
156
|
+
handleLookupAnchorClick: (event) => {
|
|
157
|
+
cell._handleLookupAnchorClick(event);
|
|
158
|
+
},
|
|
159
|
+
lookupIsNavigable: false,
|
|
160
|
+
lookupLink: '',
|
|
161
|
+
lookupValue: cell.typeAttribute0,
|
|
162
|
+
});
|
|
163
|
+
state.lookupCells.push(cell);
|
|
164
|
+
}
|
|
165
|
+
// number
|
|
166
|
+
else if ('number' === columnType || 'number' === columnSubType) {
|
|
167
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
168
|
+
isNumber: true,
|
|
169
|
+
numberValue: '',
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
// percent
|
|
173
|
+
else if ('percent' === columnType || 'percent' === columnSubType) {
|
|
174
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
175
|
+
isPercent: true,
|
|
176
|
+
percentValue: '',
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
// phone
|
|
180
|
+
else if ('phone' === columnType || 'phone' === columnSubType) {
|
|
181
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
182
|
+
isPhone: true,
|
|
183
|
+
phoneLabel: '',
|
|
184
|
+
phoneLink: '',
|
|
185
|
+
showPhoneLink: false,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// row number
|
|
189
|
+
else if ('rowNumber' === columnType || 'rowNumber' === columnSubType) {
|
|
190
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
191
|
+
isRowNumber: true,
|
|
192
|
+
computedRowNumberStyle: '',
|
|
193
|
+
rowHasError: false,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
// text
|
|
197
|
+
else if ('text' === columnType || 'text' === columnSubType) {
|
|
198
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
199
|
+
isText: true,
|
|
200
|
+
ignoreRTL: false,
|
|
201
|
+
shouldFormatText: false,
|
|
202
|
+
textParts: undefined,
|
|
203
|
+
textValue: undefined,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
// url
|
|
207
|
+
else if ('url' === columnType || 'url' === columnSubType) {
|
|
208
|
+
Object.assign(cell, BASE_INLINING_PROPS, {
|
|
209
|
+
isURL: true,
|
|
210
|
+
_handleUrlAnchorClick: undefined,
|
|
211
|
+
handlUrlAnchorClick: undefined,
|
|
212
|
+
showUrlLink: false,
|
|
213
|
+
urlLabel: '',
|
|
214
|
+
urlLink: '',
|
|
215
|
+
urlTarget: '',
|
|
216
|
+
urlTooltip: '',
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Use to calculate a small subset of cell properties
|
|
223
|
+
*
|
|
224
|
+
* @param {Object} state - The datatable state
|
|
225
|
+
* @param {Boolean} hasError - Whether an error is present on the cell
|
|
226
|
+
*/
|
|
227
|
+
export function updateInlineCell(cell) {
|
|
228
|
+
if (cell.isEditable) {
|
|
229
|
+
cell.editIconAssistiveText = `${i18n.edit} ${cell.dataLabel}${
|
|
230
|
+
cell.hasError ? ` ${i18n.editHasError}` : ''
|
|
231
|
+
}`;
|
|
232
|
+
} else {
|
|
233
|
+
cell.shouldDisplayReadOnlyIcon = cell.displayReadOnlyIcon;
|
|
234
|
+
}
|
|
235
|
+
if (cell.iconName) {
|
|
236
|
+
const { iconPosition } = cell;
|
|
237
|
+
if (iconPosition === 'right') {
|
|
238
|
+
cell.hasRightIcon = true;
|
|
239
|
+
} else if (!iconPosition || iconPosition === 'left') {
|
|
240
|
+
cell.hasLeftIcon = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (cell.isRowNumber) {
|
|
244
|
+
const { typeAttribute0: error } = cell;
|
|
245
|
+
const rowHasError = !!(error && error.title && error.messages);
|
|
246
|
+
cell.computedRowNumberStyle = rowHasError
|
|
247
|
+
? ''
|
|
248
|
+
: `padding-left: ${TOOLTIP_ALLOWANCE}px;`;
|
|
249
|
+
cell.rowHasError = rowHasError;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Use to calculate the class and style for an inlined cell
|
|
255
|
+
*
|
|
256
|
+
* @param {Object} cell - The datatable cell
|
|
257
|
+
* @param {String} cellClass - Class string calculated for cell so far
|
|
258
|
+
*/
|
|
259
|
+
export function updateInlineClassAndStyle(cell, cellClass) {
|
|
260
|
+
let computedCellDivClass = '';
|
|
261
|
+
let computedCellDivStyle = '';
|
|
262
|
+
const { alignment, columnType, hasTreeData, wrapText } = cell;
|
|
263
|
+
if (wrapText) {
|
|
264
|
+
cellClass += (cellClass.length ? ' ' : '') + CELL_WRAP;
|
|
265
|
+
computedCellDivClass += HYPHENATE_CLASS;
|
|
266
|
+
const { wrapTextMaxLines } = cell;
|
|
267
|
+
if (wrapTextMaxLines) {
|
|
268
|
+
computedCellDivClass += ` ${LINE_CLAMP_CLASS}`;
|
|
269
|
+
computedCellDivStyle = `--lwc-lineClamp: ${wrapTextMaxLines};`;
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
computedCellDivClass += TRUNCATE_CLASS;
|
|
273
|
+
}
|
|
274
|
+
if (
|
|
275
|
+
cell.isRTL &&
|
|
276
|
+
// is LTR type
|
|
277
|
+
(columnType === 'url' ||
|
|
278
|
+
columnType === 'email' ||
|
|
279
|
+
columnType === 'phone')
|
|
280
|
+
) {
|
|
281
|
+
computedCellDivClass += ` ${LTR_CONTENT_IN_RTL_CLASS}`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
let computedMarginClassWhenLeftIconExists = '';
|
|
285
|
+
if (cell.iconName) {
|
|
286
|
+
const { iconPosition } = cell;
|
|
287
|
+
if (!iconPosition || iconPosition === 'left') {
|
|
288
|
+
computedMarginClassWhenLeftIconExists = CELL_MARGIN_LEFT_CLASS;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
let computedWrapperClass = GRID_CLASS;
|
|
293
|
+
if (
|
|
294
|
+
alignment === 'right' ||
|
|
295
|
+
// Numbers are aligned right.
|
|
296
|
+
columnType === 'currency' ||
|
|
297
|
+
columnType === 'number' ||
|
|
298
|
+
columnType === 'percent'
|
|
299
|
+
) {
|
|
300
|
+
computedWrapperClass += ` ${GRID_ALIGN_END_CLASS}`;
|
|
301
|
+
} else if (
|
|
302
|
+
!alignment ||
|
|
303
|
+
alignment === 'left' ||
|
|
304
|
+
(alignment !== 'center' && alignment !== 'right')
|
|
305
|
+
) {
|
|
306
|
+
computedWrapperClass += ` ${GRID_ALIGN_SPREAD_CLASS}`;
|
|
307
|
+
}
|
|
308
|
+
if (hasTreeData) {
|
|
309
|
+
computedWrapperClass += ` ${NO_SPACE_CLASS}`;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
cell.class = cellClass;
|
|
313
|
+
cell.computedCellDivClass = computedCellDivClass;
|
|
314
|
+
cell.computedCellDivStyle = computedCellDivStyle;
|
|
315
|
+
cell.computedMarginClassWhenLeftIconExists =
|
|
316
|
+
computedMarginClassWhenLeftIconExists;
|
|
317
|
+
cell.computedWrapperClass = computedWrapperClass;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Updates the value-related attributes for an inlined datatable cell
|
|
322
|
+
*
|
|
323
|
+
* @param {Object} cell - The datatable cell
|
|
324
|
+
* @param {String} value - Current cell value
|
|
325
|
+
*/
|
|
326
|
+
export function updateInlineCellValue(cell, value) {
|
|
327
|
+
if (cell.isBoolean) {
|
|
328
|
+
cell.isChecked = !!value;
|
|
329
|
+
cell.booleanCellAssistiveText = value ? i18n.true : i18n.false;
|
|
330
|
+
} else if (cell.isCurrency) {
|
|
331
|
+
cell.currencyValue = toFormattedNumber(
|
|
332
|
+
{
|
|
333
|
+
value,
|
|
334
|
+
formatStyle: 'currency',
|
|
335
|
+
currencyCode: cell.typeAttribute0,
|
|
336
|
+
currencyDisplayAs: cell.typeAttribute1,
|
|
337
|
+
minimumIntegerDigits: cell.typeAttribute2,
|
|
338
|
+
minimumFractionDigits: cell.typeAttribute3,
|
|
339
|
+
maximumFractionDigits: cell.typeAttribute4,
|
|
340
|
+
minimumSignificantDigits: cell.typeAttribute5,
|
|
341
|
+
maximumSignificantDigits: cell.typeAttribute6,
|
|
342
|
+
},
|
|
343
|
+
numberFormat
|
|
344
|
+
);
|
|
345
|
+
} else if (cell.isDateLocal) {
|
|
346
|
+
cell.dateLocalValue = toFormattedDate(
|
|
347
|
+
{
|
|
348
|
+
value,
|
|
349
|
+
day: cell.typeAttribute0 || 'numeric',
|
|
350
|
+
month: cell.typeAttribute1 || 'short',
|
|
351
|
+
year: cell.typeAttribute2 || 'numeric',
|
|
352
|
+
timeZone: 'UTC',
|
|
353
|
+
},
|
|
354
|
+
dateTimeFormat
|
|
355
|
+
);
|
|
356
|
+
} else if (cell.isDateTime) {
|
|
357
|
+
cell.dateTimeValue = toFormattedDate(
|
|
358
|
+
{
|
|
359
|
+
// Supported values can be passed directly to lightning-formatted-date-time but
|
|
360
|
+
// non-supported formats need to be passed through Date constructor to avoid
|
|
361
|
+
// customer breakages for the time being. Ideally the use of toDate here will be
|
|
362
|
+
// temporary and we can remove use of the Date constructor in the future
|
|
363
|
+
value: toDate(value),
|
|
364
|
+
day: cell.typeAttribute0,
|
|
365
|
+
era: cell.typeAttribute1,
|
|
366
|
+
hour: cell.typeAttribute2,
|
|
367
|
+
hour12: cell.typeAttribute3,
|
|
368
|
+
minute: cell.typeAttribute4,
|
|
369
|
+
month: cell.typeAttribute5,
|
|
370
|
+
second: cell.typeAttribute6,
|
|
371
|
+
timeZone: cell.typeAttribute7,
|
|
372
|
+
timeZoneName: cell.typeAttribute8,
|
|
373
|
+
weekday: cell.typeAttribute9,
|
|
374
|
+
year: cell.typeAttribute10,
|
|
375
|
+
},
|
|
376
|
+
dateTimeFormat
|
|
377
|
+
);
|
|
378
|
+
} else if (cell.isEmail) {
|
|
379
|
+
let emailIconAssistiveText = '';
|
|
380
|
+
const emailLabel = value ? value.trim() : '';
|
|
381
|
+
const showEmailLink = !!emailLabel;
|
|
382
|
+
if (showEmailLink) {
|
|
383
|
+
emailIconAssistiveText = i18n.emailLabel;
|
|
384
|
+
}
|
|
385
|
+
cell.emailIconAssistiveText = emailIconAssistiveText;
|
|
386
|
+
cell.emailLabel = emailLabel;
|
|
387
|
+
cell.showEmailLink = showEmailLink;
|
|
388
|
+
} else if (cell.isLocation) {
|
|
389
|
+
cell.locationValue = toFormattedLocation(value);
|
|
390
|
+
} else if (cell.isNumber) {
|
|
391
|
+
cell.numberValue = toFormattedNumber(
|
|
392
|
+
{
|
|
393
|
+
value,
|
|
394
|
+
minimumIntegerDigits: cell.typeAttribute0,
|
|
395
|
+
minimumFractionDigits: cell.typeAttribute1,
|
|
396
|
+
maximumFractionDigits: cell.typeAttribute2,
|
|
397
|
+
minimumSignificantDigits: cell.typeAttribute3,
|
|
398
|
+
maximumSignificantDigits: cell.typeAttribute4,
|
|
399
|
+
},
|
|
400
|
+
numberFormat
|
|
401
|
+
);
|
|
402
|
+
} else if (cell.isPercent) {
|
|
403
|
+
cell.percentValue = toFormattedNumber(
|
|
404
|
+
{
|
|
405
|
+
value,
|
|
406
|
+
formatStyle: 'percent',
|
|
407
|
+
minimumIntegerDigits: cell.typeAttribute0,
|
|
408
|
+
minimumFractionDigits: cell.typeAttribute1,
|
|
409
|
+
maximumFractionDigits: cell.typeAttribute2,
|
|
410
|
+
minimumSignificantDigits: cell.typeAttribute3,
|
|
411
|
+
maximumSignificantDigits: cell.typeAttribute4,
|
|
412
|
+
},
|
|
413
|
+
numberFormat
|
|
414
|
+
);
|
|
415
|
+
} else if (cell.isPhone) {
|
|
416
|
+
let phoneLabel = '';
|
|
417
|
+
let phoneLink = '';
|
|
418
|
+
const showPhoneLink = isValidPhone(value);
|
|
419
|
+
if (showPhoneLink) {
|
|
420
|
+
phoneLabel = toNorthAmericanPhoneNumber(value);
|
|
421
|
+
phoneLink = `tel:${value}`;
|
|
422
|
+
}
|
|
423
|
+
cell.phoneLabel = phoneLabel;
|
|
424
|
+
cell.phoneLink = phoneLink;
|
|
425
|
+
cell.showPhoneLink = showPhoneLink;
|
|
426
|
+
} else if (cell.isText) {
|
|
427
|
+
const { typeAttribute0: linkify } = cell;
|
|
428
|
+
const shouldFormatText = linkify
|
|
429
|
+
? typeof value === 'string' && value !== ''
|
|
430
|
+
: false;
|
|
431
|
+
cell.ignoreRTL = cell.isRTL && isTextIgnoreRTL(value);
|
|
432
|
+
cell.shouldFormatText = shouldFormatText;
|
|
433
|
+
cell.textParts = shouldFormatText
|
|
434
|
+
? parseToFormattedLinkifiedParts(value, true)
|
|
435
|
+
: [];
|
|
436
|
+
// W-7860598 some team rely on text column support for primitive type.
|
|
437
|
+
// W-7752316 customer use compound field for text column, to avoid [object Object]
|
|
438
|
+
// Check if value is object or null and return '';
|
|
439
|
+
cell.textValue = typeof value === 'object' ? '' : value;
|
|
440
|
+
} else if (cell.isURL) {
|
|
441
|
+
let _handleUrlAnchorClick;
|
|
442
|
+
let handleUrlAnchorClick;
|
|
443
|
+
let urlLabel = '';
|
|
444
|
+
let urlLink = '';
|
|
445
|
+
let urlTarget = '';
|
|
446
|
+
let urlTooltip = '';
|
|
447
|
+
const showUrlLink =
|
|
448
|
+
value !== null && value !== undefined && value !== '';
|
|
449
|
+
if (showUrlLink) {
|
|
450
|
+
let { typeAttribute0, typeAttribute2 } = cell;
|
|
451
|
+
_handleUrlAnchorClick = noopHandler;
|
|
452
|
+
handleUrlAnchorClick = (event) => {
|
|
453
|
+
cell._handleUrlAnchorClick(event);
|
|
454
|
+
};
|
|
455
|
+
urlLink = makeAbsoluteUrl(value);
|
|
456
|
+
urlLabel =
|
|
457
|
+
typeAttribute0 !== null &&
|
|
458
|
+
typeAttribute0 !== undefined &&
|
|
459
|
+
typeAttribute0 !== ''
|
|
460
|
+
? typeAttribute0
|
|
461
|
+
: urlLink;
|
|
462
|
+
urlTarget = cell.typeAttribute1 || '_self';
|
|
463
|
+
urlTooltip = typeAttribute2 === '' ? '' : typeAttribute2 || value;
|
|
464
|
+
}
|
|
465
|
+
cell._handleUrlAnchorClick = _handleUrlAnchorClick;
|
|
466
|
+
cell.handleUrlAnchorClick = handleUrlAnchorClick;
|
|
467
|
+
cell.showUrlLink = showUrlLink;
|
|
468
|
+
cell.urlLabel = urlLabel;
|
|
469
|
+
cell.urlLink = urlLink;
|
|
470
|
+
cell.urlTarget = urlTarget;
|
|
471
|
+
cell.urlTooltip = urlTooltip;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
@@ -91,11 +91,15 @@ export function updateSorting(state) {
|
|
|
91
91
|
col.sorted = true;
|
|
92
92
|
col.sortAriaLabel =
|
|
93
93
|
sortedDirection === 'desc' ? 'descending' : 'ascending';
|
|
94
|
-
col.sortedDirection =
|
|
94
|
+
col.sortedDirection = isSortedByArray
|
|
95
|
+
? sortedDirection[sortedBy.indexOf(col.name)]
|
|
96
|
+
: sortedDirection;
|
|
95
97
|
|
|
96
|
-
// If sortedBy is an array, set col.sorted to the index in the array
|
|
97
|
-
// Otherwise, set it to true
|
|
98
|
-
col.sorted = isSortedByArray
|
|
98
|
+
// If sortedBy is an array, set col.sorted to the index in the array + 1 because
|
|
99
|
+
// 0 index is considered falsely in javascript Otherwise, set it to true
|
|
100
|
+
col.sorted = isSortedByArray
|
|
101
|
+
? sortedBy.indexOf(col.name) + 1
|
|
102
|
+
: true;
|
|
99
103
|
} else {
|
|
100
104
|
col.sorted = false;
|
|
101
105
|
col.sortAriaLabel = col.sortable ? 'other' : null;
|
|
@@ -6,29 +6,36 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @returns {Object} Intial state of the datatable
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export function getDefaultState() {
|
|
10
10
|
return {
|
|
11
11
|
// columns
|
|
12
12
|
columns: [],
|
|
13
13
|
hadTreeDataTypePreviously: false,
|
|
14
14
|
hideCheckboxColumn: false,
|
|
15
|
+
showActionsMenu: false,
|
|
15
16
|
treeColumn: undefined,
|
|
16
17
|
|
|
17
18
|
// rows
|
|
18
19
|
data: [],
|
|
20
|
+
hasCalledUpdateRowsAndCells: false,
|
|
19
21
|
keyField: undefined,
|
|
20
22
|
rows: [],
|
|
21
|
-
|
|
23
|
+
checkboxCells: [],
|
|
24
|
+
lookupCells: [],
|
|
25
|
+
shownUrlCells: [],
|
|
22
26
|
|
|
23
27
|
// row selection
|
|
24
28
|
selectedRowsKeys: {},
|
|
25
29
|
lastSelectedRowKey: undefined,
|
|
26
30
|
maxRowSelection: undefined,
|
|
27
31
|
|
|
28
|
-
headerIndexes: {},
|
|
29
32
|
hideTableHeader: false,
|
|
30
33
|
wrapTableHeader: false,
|
|
31
34
|
|
|
35
|
+
// indexes:
|
|
36
|
+
headerIndexes: [],
|
|
37
|
+
indexes: {}, // cannot use a Map because they aren't trackable
|
|
38
|
+
|
|
32
39
|
// keyboard
|
|
33
40
|
keyboardMode: 'NAVIGATION',
|
|
34
41
|
rowMode: false,
|
|
@@ -57,6 +64,7 @@ export const getDefaultState = function () {
|
|
|
57
64
|
isLoading: false,
|
|
58
65
|
|
|
59
66
|
// table render mode
|
|
67
|
+
renderModeInline: false,
|
|
60
68
|
renderModeRoleBased: false,
|
|
61
69
|
|
|
62
70
|
// viewport rendering and virtualization
|
|
@@ -96,4 +104,4 @@ export const getDefaultState = function () {
|
|
|
96
104
|
// table rendered flag
|
|
97
105
|
hasRenderedFirstTime: false,
|
|
98
106
|
};
|
|
99
|
-
}
|
|
107
|
+
}
|