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
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { api } from 'lwc';
|
|
2
2
|
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
3
|
-
import { getRealDOMId
|
|
4
|
-
import { secure } from 'lightning/overlayUtils';
|
|
5
|
-
import closeButtonAltText from '@salesforce/label/LightningModalBase.cancelandclose';
|
|
3
|
+
import { getRealDOMId } from 'lightning/utilsPrivate';
|
|
6
4
|
|
|
7
5
|
// selectors
|
|
8
6
|
const modalHeaderSelector = '.slds-modal__header';
|
|
9
7
|
const labelSelector = '[data-label]';
|
|
10
8
|
const slotWrapperSelector = '[data-slot-wrapper]';
|
|
11
9
|
const defaultSlotSelector = '[data-default-slot]';
|
|
12
|
-
const headerCloseButtonSelector = '[data-header-close-button]';
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* Creates a header to display the heading and tagline at the top of a modal.
|
|
@@ -19,13 +16,25 @@ export default class LightningModalHeader extends LightningShadowBaseClass {
|
|
|
19
16
|
initialRender = true;
|
|
20
17
|
initialSlotRender = true;
|
|
21
18
|
unregisterCallback = null;
|
|
22
|
-
headerCloseButtonAltText = closeButtonAltText;
|
|
23
19
|
|
|
24
20
|
/**
|
|
25
21
|
* Text to display as the heading at the top of the modal
|
|
26
22
|
*/
|
|
27
23
|
@api label = '';
|
|
28
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Handle the default slot change event
|
|
27
|
+
* Always register with parent every slot change
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
handleDefaultSlotChange() {
|
|
31
|
+
// Set this once so that parent can know slot has rendered
|
|
32
|
+
if (this.initialSlotRender) {
|
|
33
|
+
this.initialSlotRender = false;
|
|
34
|
+
}
|
|
35
|
+
this.registerWithParent();
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
/**
|
|
30
39
|
* Get the height of outer wrapper of modal header
|
|
31
40
|
* @returns {number} represents a height value in pixels
|
|
@@ -116,62 +125,6 @@ export default class LightningModalHeader extends LightningShadowBaseClass {
|
|
|
116
125
|
return (this.label && this.label.trim().length > 0) || false;
|
|
117
126
|
}
|
|
118
127
|
|
|
119
|
-
/**
|
|
120
|
-
* Get the lightning-button-icon (close button element)
|
|
121
|
-
* @returns {(HTMLElement|null)}
|
|
122
|
-
* @private
|
|
123
|
-
*/
|
|
124
|
-
get headerCloseButton() {
|
|
125
|
-
return this.template.querySelector(headerCloseButtonSelector);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Handle the default slot change event
|
|
130
|
-
* Always register with parent every slot change
|
|
131
|
-
* @private
|
|
132
|
-
*/
|
|
133
|
-
handleDefaultSlotChange() {
|
|
134
|
-
// Set this once so that parent can know slot has rendered
|
|
135
|
-
if (this.initialSlotRender) {
|
|
136
|
-
this.initialSlotRender = false;
|
|
137
|
-
}
|
|
138
|
-
this.registerWithParent();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Toggle set disabled on the <lightning-button-icon> present inside lightning-modal-header
|
|
143
|
-
* @param e
|
|
144
|
-
*/
|
|
145
|
-
handlePrivateModalHeaderDisableClose(e) {
|
|
146
|
-
if (!e?.detail?.[secure]) {
|
|
147
|
-
console.error(
|
|
148
|
-
'Invalid access to privatemodalheaderdisableclose event'
|
|
149
|
-
);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
e.stopPropagation();
|
|
153
|
-
|
|
154
|
-
const closeButtonDisable = e.detail?.disableClose ? 'disabled' : null;
|
|
155
|
-
|
|
156
|
-
synchronizeAttrs(this.headerCloseButton, {
|
|
157
|
-
disabled: closeButtonDisable,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Handle close click on close <lightning-button-icon>
|
|
163
|
-
*/
|
|
164
|
-
handleModalHeaderClose() {
|
|
165
|
-
const closeEvt = new CustomEvent('privatemodalheaderclose', {
|
|
166
|
-
bubbles: true,
|
|
167
|
-
composed: true,
|
|
168
|
-
detail: {
|
|
169
|
-
[secure]: true,
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
this.dispatchEvent(closeEvt);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
128
|
/**
|
|
176
129
|
* Register modalHeader with modal parent, including callbacks to
|
|
177
130
|
* unregister the modal header
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@import 'lightning/sldsCommon';
|
|
2
|
+
@import 'lightning/sldsUtilsHyphenation';
|
|
3
|
+
|
|
4
|
+
[part="columnadder"] {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 0.5rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
[part="modal-body"] {
|
|
13
|
+
height: 19rem;
|
|
14
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lightning-modal-header label={i18n.modalTitle}>
|
|
3
|
+
</lightning-modal-header>
|
|
4
|
+
<lightning-modal-body class="modal_headerless">
|
|
5
|
+
<div part="modal-body">
|
|
6
|
+
<template iterator:it={rulesWithData}>
|
|
7
|
+
<lightning-primitive-column-sorter
|
|
8
|
+
key={it.value.key}
|
|
9
|
+
index={it.index}
|
|
10
|
+
rule={it.value}
|
|
11
|
+
columns={processedColumns}
|
|
12
|
+
first-rule={it.first}
|
|
13
|
+
last-rule={it.last}
|
|
14
|
+
ondelete={handleDeleteRule}
|
|
15
|
+
onselection={handleSelectionChange}
|
|
16
|
+
onmoveup={handleRuleMovement}
|
|
17
|
+
onmovedown={handleRuleMovement}>
|
|
18
|
+
</lightning-primitive-column-sorter>
|
|
19
|
+
</template>
|
|
20
|
+
<div part="columnadder">
|
|
21
|
+
<lightning-button
|
|
22
|
+
variant="base"
|
|
23
|
+
label={i18n.addRule}
|
|
24
|
+
icon-name="utility:add"
|
|
25
|
+
onclick={handleAddRule}
|
|
26
|
+
disabled={isAddRuleButtonDisabled}
|
|
27
|
+
class="slds-m-left_x-small">
|
|
28
|
+
</lightning-button>
|
|
29
|
+
<div style={ruleLimitTextStyle}>{ruleLimitText}</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</lightning-modal-body>
|
|
33
|
+
<lightning-modal-footer class="slds-modal__footer_directional">
|
|
34
|
+
<lightning-button
|
|
35
|
+
class="slds-button"
|
|
36
|
+
variant="neutral"
|
|
37
|
+
label={i18n.clearButton}
|
|
38
|
+
onclick={clearRules}
|
|
39
|
+
disabled={isClearButtonDisabled}
|
|
40
|
+
></lightning-button>
|
|
41
|
+
<lightning-button
|
|
42
|
+
class="slds-button"
|
|
43
|
+
variant="neutral"
|
|
44
|
+
label={i18n.cancelButton}
|
|
45
|
+
onclick={cancelRules}
|
|
46
|
+
></lightning-button>
|
|
47
|
+
<lightning-button
|
|
48
|
+
class="slds-button"
|
|
49
|
+
variant="brand"
|
|
50
|
+
label={i18n.applyButton}
|
|
51
|
+
onclick={applyRules}
|
|
52
|
+
disabled={isApplyButtonDisabled}
|
|
53
|
+
></lightning-button>
|
|
54
|
+
</lightning-modal-footer>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import LightningModal from 'lightning/modal';
|
|
2
|
+
import Toast from 'lightning/toast';
|
|
3
|
+
import { track, api } from 'lwc';
|
|
4
|
+
import modalTitle from '@salesforce/label/LightningMultiColumnSortingModal.modalTitle';
|
|
5
|
+
import firstRuleHeading from '@salesforce/label/LightningMultiColumnSortingModal.firstRuleHeading';
|
|
6
|
+
import otherRuleHeading from '@salesforce/label/LightningMultiColumnSortingModal.otherRuleHeading';
|
|
7
|
+
import addRule from '@salesforce/label/LightningMultiColumnSortingModal.addRule';
|
|
8
|
+
import ruleLimit from '@salesforce/label/LightningMultiColumnSortingModal.ruleLimit';
|
|
9
|
+
import ruleLimitReached from '@salesforce/label/LightningMultiColumnSortingModal.ruleLimitReached';
|
|
10
|
+
import clearButton from '@salesforce/label/LightningMultiColumnSortingModal.clearButton';
|
|
11
|
+
import cancelButton from '@salesforce/label/LightningMultiColumnSortingModal.cancelButton';
|
|
12
|
+
import applyButton from '@salesforce/label/LightningMultiColumnSortingModal.applyButton';
|
|
13
|
+
import duplicateValueValidation from '@salesforce/label/LightningMultiColumnSortingModal.duplicateValueValidation';
|
|
14
|
+
import multiColumnSortingToast from '@salesforce/label/LightningDatatable.multiColumnSortingToast';
|
|
15
|
+
import ascending from '@salesforce/label/LightningPrimitiveColumnSorter.ascending';
|
|
16
|
+
import descending from '@salesforce/label/LightningPrimitiveColumnSorter.descending';
|
|
17
|
+
import { generateUniqueId } from 'lightning/inputUtils';
|
|
18
|
+
import { formatLabel } from 'lightning/utils';
|
|
19
|
+
const i18n = {
|
|
20
|
+
modalTitle,
|
|
21
|
+
firstRuleHeading,
|
|
22
|
+
otherRuleHeading,
|
|
23
|
+
addRule,
|
|
24
|
+
ruleLimit,
|
|
25
|
+
ruleLimitReached,
|
|
26
|
+
clearButton,
|
|
27
|
+
cancelButton,
|
|
28
|
+
applyButton,
|
|
29
|
+
duplicateValueValidation,
|
|
30
|
+
multiColumnSortingToast,
|
|
31
|
+
ascending,
|
|
32
|
+
descending,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// represents a rule that has not been configured with sorting settings
|
|
36
|
+
const getEmptyRule = () => ({
|
|
37
|
+
selectedColumn: undefined,
|
|
38
|
+
sortOrder: 'asc', // default sort order is set to 'ascending'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// base state: two rules that are not configured with sorting settings
|
|
42
|
+
const initialRules = [getEmptyRule(), getEmptyRule()];
|
|
43
|
+
|
|
44
|
+
export default class MultiColumnSortingModal extends LightningModal {
|
|
45
|
+
// lightning-datatable instance
|
|
46
|
+
@api dtInstance;
|
|
47
|
+
size = 'small';
|
|
48
|
+
@track rules = initialRules;
|
|
49
|
+
|
|
50
|
+
// variable track if validation errors are present
|
|
51
|
+
validInputs = true;
|
|
52
|
+
_modalBody;
|
|
53
|
+
_scrollToBottom = false;
|
|
54
|
+
|
|
55
|
+
get i18n() {
|
|
56
|
+
return i18n;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* On initial load, the modal will create rules based on the passed in attributes:
|
|
61
|
+
* 'sortedBy' and 'sortedDirection'
|
|
62
|
+
*/
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
const { sortedBy, sortedDirection } = this.dtInstance;
|
|
65
|
+
this.clearRules(); // reset rules
|
|
66
|
+
if (Array.isArray(sortedBy) || Array.isArray(sortedDirection)) {
|
|
67
|
+
if (
|
|
68
|
+
sortedBy &&
|
|
69
|
+
sortedDirection &&
|
|
70
|
+
sortedBy.length === sortedDirection.length
|
|
71
|
+
) {
|
|
72
|
+
let length = Math.min(sortedBy.length, 5); // 5 rules is the max limit
|
|
73
|
+
// Create rules based on sortedBy and sortedDirection
|
|
74
|
+
for (let i = 0; i < length; i += 1) {
|
|
75
|
+
this.rules[i] = {
|
|
76
|
+
selectedColumn: sortedBy[i],
|
|
77
|
+
sortOrder: sortedDirection[i],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
// set `isDupe` property on this.rules so renderedCallback can report validity
|
|
81
|
+
this.setDuplicates(this.rules);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
renderedCallback() {
|
|
87
|
+
const { comboboxInputs, rules } = this;
|
|
88
|
+
const duplicateEntryExists = rules.some((rule) => rule.isDupe);
|
|
89
|
+
|
|
90
|
+
const lastRuleSelected =
|
|
91
|
+
rules.length >= 2 &&
|
|
92
|
+
rules[rules.length - 1].selectedColumn !== undefined;
|
|
93
|
+
|
|
94
|
+
// report validity if user has clicked on apply button, if there is a duplicate entry, or if the
|
|
95
|
+
// last rule was selected
|
|
96
|
+
if (
|
|
97
|
+
this.validationThroughApplyButton ||
|
|
98
|
+
duplicateEntryExists ||
|
|
99
|
+
lastRuleSelected
|
|
100
|
+
) {
|
|
101
|
+
if (duplicateEntryExists) {
|
|
102
|
+
comboboxInputs.forEach((combobox, index) => {
|
|
103
|
+
combobox.setCustomValidity(
|
|
104
|
+
rules[index].isDupe
|
|
105
|
+
? this.i18n.duplicateValueValidation
|
|
106
|
+
: ''
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
this.reportValidity(comboboxInputs);
|
|
111
|
+
this.validationThroughApplyButton = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// scroll to appropriate element
|
|
115
|
+
this.handleScrolling();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// getter to get all `lightning-primitive-column-sorter` elements
|
|
119
|
+
get columnSorters() {
|
|
120
|
+
return Array.from(
|
|
121
|
+
this.template.querySelectorAll('lightning-primitive-column-sorter')
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// getter to get all `lightning-combobox` elements from all the `lightning-primitive-column-sorter` elements
|
|
126
|
+
get comboboxInputs() {
|
|
127
|
+
return this.columnSorters.map((sorter) => sorter.combobox);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// getter to get the `lightning-modal-body's` `[part='modal-body']`
|
|
131
|
+
get modalBody() {
|
|
132
|
+
if (!this._modalBody) {
|
|
133
|
+
this._modalBody = this.template.querySelector(
|
|
134
|
+
'lightning-modal-body'
|
|
135
|
+
).shadowRoot.firstChild;
|
|
136
|
+
}
|
|
137
|
+
return this._modalBody;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
get rulesWithData() {
|
|
141
|
+
const { rules } = this;
|
|
142
|
+
return rules.map((rule, index) => ({
|
|
143
|
+
key: generateUniqueId('sorter'),
|
|
144
|
+
...rule, // sortOrder and selectedColumn
|
|
145
|
+
heading:
|
|
146
|
+
index === 0 ? i18n.firstRuleHeading : i18n.otherRuleHeading,
|
|
147
|
+
unselectedInitialRules:
|
|
148
|
+
rules.length <= 2 &&
|
|
149
|
+
(rules[0].selectedColumn === undefined ||
|
|
150
|
+
rules[1].selectedColumn === undefined), // used to disable up/down movement when only 1 out of 2 rules are configured
|
|
151
|
+
disabledTrash: rules.length < 3, // user should not be able to delete rules if there are only 2
|
|
152
|
+
// if first two rules are not selected, the second rule should have disabled input
|
|
153
|
+
disableInputs:
|
|
154
|
+
index === 1 &&
|
|
155
|
+
rules[index - 1].selectedColumn === undefined &&
|
|
156
|
+
rules[index].selectedColumn === undefined,
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* an additional 'value' property needs to be added for `lightning-combobox` in the
|
|
162
|
+
* `primitive-column-sorter` to function properly
|
|
163
|
+
*/
|
|
164
|
+
get processedColumns() {
|
|
165
|
+
const filteredColumns = this.dtInstance.columns.filter(
|
|
166
|
+
(column) => column.label && column.sortable
|
|
167
|
+
);
|
|
168
|
+
const processedColumns = filteredColumns.map((column) => {
|
|
169
|
+
return {
|
|
170
|
+
...column,
|
|
171
|
+
value: column.fieldName, // Set the 'value' property to the same value as 'fieldName'
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
return processedColumns;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Text to indicate if the sorting rule limit has been reached.
|
|
179
|
+
*/
|
|
180
|
+
get ruleLimitText() {
|
|
181
|
+
if (this.rules.length >= 5) {
|
|
182
|
+
return i18n.ruleLimitReached;
|
|
183
|
+
}
|
|
184
|
+
return i18n.ruleLimit;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* inline style for the rule limit text;
|
|
189
|
+
*/
|
|
190
|
+
get ruleLimitTextStyle() {
|
|
191
|
+
return this.ruleLimitText === i18n.ruleLimitReached
|
|
192
|
+
? 'color:#8C4B02;'
|
|
193
|
+
: '';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Disable the add new rule button
|
|
198
|
+
*/
|
|
199
|
+
get isAddRuleButtonDisabled() {
|
|
200
|
+
const unselectedRuleExists = this.rules.some(
|
|
201
|
+
(rule) => rule.selectedColumn === undefined
|
|
202
|
+
);
|
|
203
|
+
return (
|
|
204
|
+
unselectedRuleExists || this.rules.length >= 5 || !this.validInputs
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Disable the apply button
|
|
210
|
+
*/
|
|
211
|
+
get isApplyButtonDisabled() {
|
|
212
|
+
const rulesWithSelectedColumns = this.rules.filter(
|
|
213
|
+
(rule) => rule.selectedColumn !== undefined
|
|
214
|
+
);
|
|
215
|
+
return rulesWithSelectedColumns.length < 2 || !this.validInputs;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Disable the clear button
|
|
220
|
+
*/
|
|
221
|
+
get isClearButtonDisabled() {
|
|
222
|
+
return (
|
|
223
|
+
this.rules[0].selectedColumn === undefined ||
|
|
224
|
+
this.rules[1].selectedColumn === undefined
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Handles adding a new rule from the 'add rule' button
|
|
230
|
+
*/
|
|
231
|
+
handleAddRule() {
|
|
232
|
+
this._scrollToBottom = true; // scroll to new rule
|
|
233
|
+
this.rules.push(getEmptyRule());
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Handles the 'delete' event which is dispatched from `primitive-column-sorter` elements
|
|
238
|
+
*/
|
|
239
|
+
handleDeleteRule(event) {
|
|
240
|
+
const ruleIndexToDelete = event.target.index;
|
|
241
|
+
this.rules.splice(ruleIndexToDelete, 1);
|
|
242
|
+
// Update 'isDupe' property
|
|
243
|
+
this.setDuplicates(this.rules);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Handles the 'selection' event which is dispatched from `primitive-column-sorter` elements
|
|
248
|
+
*/
|
|
249
|
+
handleSelectionChange(event) {
|
|
250
|
+
const { index, selectedColumn, sortOrder } = event.detail;
|
|
251
|
+
// Get the existing rule object at the specified index
|
|
252
|
+
const existingRule = this.rules[index];
|
|
253
|
+
if (existingRule) {
|
|
254
|
+
const newColumnSelection =
|
|
255
|
+
existingRule.selectedColumn !== selectedColumn;
|
|
256
|
+
// Update the existing rule object with the new selectedColumn and sortOrder
|
|
257
|
+
existingRule.selectedColumn = selectedColumn;
|
|
258
|
+
existingRule.sortOrder = sortOrder;
|
|
259
|
+
if (newColumnSelection) {
|
|
260
|
+
// Update 'isDupe' property
|
|
261
|
+
this.setDuplicates(this.rules, index);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Handles the 'moveup' or 'movedown' event which is dispatched from `primitive-column-sorter` elements
|
|
268
|
+
*/
|
|
269
|
+
handleRuleMovement(event) {
|
|
270
|
+
const { rules } = this;
|
|
271
|
+
const dir = event.type;
|
|
272
|
+
const ruleIndexToMove = event.target.index;
|
|
273
|
+
const ruleIndexToSwitch =
|
|
274
|
+
dir === 'moveup' ? ruleIndexToMove - 1 : ruleIndexToMove + 1;
|
|
275
|
+
|
|
276
|
+
// Switch rules
|
|
277
|
+
const tempRule = rules[ruleIndexToMove];
|
|
278
|
+
rules[ruleIndexToMove] = rules[ruleIndexToSwitch];
|
|
279
|
+
rules[ruleIndexToSwitch] = tempRule;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Dispatches the 'privateupdatecolsort' custom event to send selected data to parent component
|
|
284
|
+
* Also extracts sorting orders and columns from rules and cleaning anything 'undefined'
|
|
285
|
+
*/
|
|
286
|
+
applyRules() {
|
|
287
|
+
const fieldNames = this.rules.map((rule) => rule.selectedColumn);
|
|
288
|
+
const sortDirections = this.rules.map((rule) => rule.sortOrder);
|
|
289
|
+
|
|
290
|
+
// validation to ensure that there are no invalid inputs
|
|
291
|
+
this.reportValidity(this.comboboxInputs);
|
|
292
|
+
this.validationThroughApplyButton = true;
|
|
293
|
+
|
|
294
|
+
// only dispatch event with data if all inputs are valid
|
|
295
|
+
if (this.validInputs) {
|
|
296
|
+
// Dispatch event from datatable
|
|
297
|
+
const event = new CustomEvent('sort', {
|
|
298
|
+
detail: {
|
|
299
|
+
fieldNames,
|
|
300
|
+
sortDirections,
|
|
301
|
+
isMultiColumnSort: true,
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
this.dtInstance.dispatchEvent(event);
|
|
305
|
+
// Construct toast
|
|
306
|
+
const toastMessage = this.getToastMessage(
|
|
307
|
+
fieldNames,
|
|
308
|
+
sortDirections
|
|
309
|
+
);
|
|
310
|
+
this.close({
|
|
311
|
+
event,
|
|
312
|
+
success: this.sendToast(toastMessage, 'success'),
|
|
313
|
+
failure: this.sendToast(toastMessage, 'failure'),
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
getToastMessage(fieldNames, sortDirections) {
|
|
319
|
+
// Method used to format the Toast notification's message
|
|
320
|
+
const capitalizeFirstLetter = (str) =>
|
|
321
|
+
str.charAt(0).toUpperCase() + str.slice(1);
|
|
322
|
+
|
|
323
|
+
// constructing and formatting the toast message
|
|
324
|
+
const message = fieldNames
|
|
325
|
+
.map(
|
|
326
|
+
(sortBy, index) =>
|
|
327
|
+
`${capitalizeFirstLetter(sortBy)} (${
|
|
328
|
+
sortDirections[index] === 'asc'
|
|
329
|
+
? i18n.ascending
|
|
330
|
+
: i18n.descending
|
|
331
|
+
})`
|
|
332
|
+
)
|
|
333
|
+
.join(', ');
|
|
334
|
+
return formatLabel(i18n.multiColumnSortingToast, message);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
sendToast(toastMessage, variant) {
|
|
338
|
+
return () => {
|
|
339
|
+
Toast.show(
|
|
340
|
+
{
|
|
341
|
+
label: toastMessage,
|
|
342
|
+
mode: 'dismissible',
|
|
343
|
+
variant,
|
|
344
|
+
},
|
|
345
|
+
this.dtInstance
|
|
346
|
+
);
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Handles clearing all sorting rules from the modal from the 'clear' button
|
|
352
|
+
*/
|
|
353
|
+
clearRules() {
|
|
354
|
+
this.rules = [getEmptyRule(), getEmptyRule()];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Handles closing the modal when the 'cancel' button is clicked
|
|
359
|
+
*/
|
|
360
|
+
cancelRules() {
|
|
361
|
+
this.close();
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* method to handle the scrolling to a newly added `lightning-primitive-column-sorter` or the
|
|
366
|
+
* first one with a validation error present
|
|
367
|
+
*/
|
|
368
|
+
handleScrolling() {
|
|
369
|
+
// scroll to the bottom for when new `lightning-primitive-column-sorters` are added
|
|
370
|
+
const { comboboxInputs } = this;
|
|
371
|
+
let modalBody;
|
|
372
|
+
if (this._scrollToBottom) {
|
|
373
|
+
modalBody = this.modalBody;
|
|
374
|
+
modalBody.scrollTop = modalBody.scrollHeight;
|
|
375
|
+
this._scrollToBottom = false;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// if there are errors present, auto-scroll to the first error
|
|
379
|
+
for (let i = 0; i < comboboxInputs.length; i += 1) {
|
|
380
|
+
const combobox = comboboxInputs[i];
|
|
381
|
+
if (combobox.classList.contains('slds-has-error')) {
|
|
382
|
+
const sorter = this.columnSorters[i];
|
|
383
|
+
modalBody = modalBody || this.modalBody;
|
|
384
|
+
modalBody.scrollTop = sorter.offsetTop - modalBody.offsetTop;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Helper function to check if there are duplicate `selectedColumn` properties for
|
|
392
|
+
* each of the entries in this.rules array. if there is, then that rule gets its `isDupe`
|
|
393
|
+
* property set to `true`.
|
|
394
|
+
* @param {Array} rules
|
|
395
|
+
* @param {Number} ruleIndexToSetLast - rule index to set 'isDupe' for last. Used in handleSelectionChange.
|
|
396
|
+
*/
|
|
397
|
+
setDuplicates(rules, ruleIndexToSetLast) {
|
|
398
|
+
const selectedColumns = new Set();
|
|
399
|
+
for (let i = 0; i < rules.length; i += 1) {
|
|
400
|
+
if (ruleIndexToSetLast !== i) {
|
|
401
|
+
const { selectedColumn } = rules[i];
|
|
402
|
+
rules[i].isDupe =
|
|
403
|
+
selectedColumn && selectedColumns.has(selectedColumn);
|
|
404
|
+
selectedColumns.add(selectedColumn);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if (ruleIndexToSetLast !== undefined) {
|
|
408
|
+
const { selectedColumn } = rules[ruleIndexToSetLast];
|
|
409
|
+
rules[ruleIndexToSetLast].isDupe =
|
|
410
|
+
selectedColumn && selectedColumns.has(selectedColumn);
|
|
411
|
+
selectedColumns.add(selectedColumn);
|
|
412
|
+
}
|
|
413
|
+
return selectedColumns;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* This function will go through the list of `lightning-combobox`s and will reportValidity()
|
|
418
|
+
* on each to show the errors.
|
|
419
|
+
* Sets the `validInputs` property to track if all entries are valid or not
|
|
420
|
+
* @param {Array} comboboxInputs
|
|
421
|
+
*/
|
|
422
|
+
reportValidity(comboboxInputs) {
|
|
423
|
+
comboboxInputs.forEach(
|
|
424
|
+
(combobox) => combobox && combobox.reportValidity()
|
|
425
|
+
);
|
|
426
|
+
this.validInputs = comboboxInputs.every(
|
|
427
|
+
(combobox) => combobox && combobox.validity.valid
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
@@ -433,3 +433,19 @@ function initAuraOverlayState() {
|
|
|
433
433
|
state.auraOverlayActive = false;
|
|
434
434
|
state.auraOverlayPresent = false;
|
|
435
435
|
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Helper function to detect if a lightning-modal is currently open
|
|
439
|
+
* Used in modalBase.js to trap a user's focus while lightning-modal is open
|
|
440
|
+
* @returns {boolean}
|
|
441
|
+
*/
|
|
442
|
+
export function isLwcModalActive() {
|
|
443
|
+
let isLwcModal = false;
|
|
444
|
+
if (state.stack?.length > 0) {
|
|
445
|
+
const top = state.stack[state.stack.length - 1];
|
|
446
|
+
isLwcModal =
|
|
447
|
+
top?.overlayEngine === LWC_OVERLAY_ENGINE &&
|
|
448
|
+
top?.overlayType === TYPE_MODAL;
|
|
449
|
+
}
|
|
450
|
+
return isLwcModal;
|
|
451
|
+
}
|
|
@@ -144,20 +144,26 @@ export default class LightningPill extends LightningShadowBaseClass {
|
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
146
|
renderedCallback() {
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
// Avoid a timing issue due to LWC v6's native custom element lifecycle:
|
|
148
|
+
// https://github.com/salesforce/lwc/releases/v6.0.0#new-timing
|
|
149
|
+
// This check for slotted content needs to occur after the connectedCallbacks for the slotted
|
|
150
|
+
// components have already executed.
|
|
151
|
+
Promise.resolve().then(() => {
|
|
152
|
+
// check if a component was passed into the slot
|
|
153
|
+
this._hasMedia = this.checkMediaElement();
|
|
154
|
+
const wrapper = this.template.querySelector('span');
|
|
155
|
+
|
|
156
|
+
classListMutation(wrapper.classList, {
|
|
157
|
+
'slds-pill': true,
|
|
158
|
+
'slds-pill_link': this.isPlainLink || this.isLink,
|
|
159
|
+
'slds-has-error': this.hasError,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// set attributes to self if variant is plain or link
|
|
163
|
+
modifyAttribute(this, 'tabindex', this.tabIndex);
|
|
164
|
+
modifyAttribute(this, 'role', this.role);
|
|
165
|
+
modifyAttribute(this, 'aria-selected', this.ariaSelected);
|
|
155
166
|
});
|
|
156
|
-
|
|
157
|
-
// set attributes to self if variant is plain or link
|
|
158
|
-
modifyAttribute(this, 'tabindex', this.tabIndex);
|
|
159
|
-
modifyAttribute(this, 'role', this.role);
|
|
160
|
-
modifyAttribute(this, 'aria-selected', this.ariaSelected);
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
/**
|