lightning-base-components 1.17.2-alpha → 1.17.5-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 +129 -3
- package/package.json +25 -1
- package/scopedImports/@salesforce-label-AddressAutocomplete.LookupButton.js +1 -0
- package/scopedImports/@salesforce-label-LightningDatatable.chooseARowSelectAll.js +1 -0
- package/scopedImports/@salesforce-label-LightningInput.mailingAddressFieldsUpdateText.js +1 -0
- package/scopedImports/@salesforce-label-LightningToast.genericNavigationAssistiveText.js +1 -0
- package/scopedImports/@salesforce-label-LightningToast.macNavigationAssistiveText.js +1 -0
- package/src/lightning/ariaObserver/__examples__/connect/connect.html +19 -0
- package/src/lightning/ariaObserver/__examples__/connect/connect.js +10 -0
- package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.html +3 -0
- package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.js +45 -0
- package/src/lightning/ariaObserver/ariaObserver.js +16 -2
- package/src/lightning/baseCombobox/baseCombobox.js +50 -4
- package/src/lightning/baseCombobox/keyboard.js +3 -0
- package/src/lightning/breadcrumb/__docs__/breadcrumb.md +5 -6
- package/src/lightning/breadcrumb/breadcrumb.css +3 -0
- package/src/lightning/breadcrumb/breadcrumb.html +1 -1
- package/src/lightning/breadcrumb/breadcrumb.slds.css +25 -0
- package/src/lightning/breadcrumbs/breadcrumbs.css +3 -0
- package/src/lightning/breadcrumbs/breadcrumbs.html +1 -1
- package/src/lightning/breadcrumbs/breadcrumbs.slds.css +33 -0
- package/src/lightning/button/button.html +2 -1
- package/src/lightning/button/button.js +9 -0
- package/src/lightning/buttonIcon/button-icon.slds.css +5 -1
- package/src/lightning/buttonIcon/buttonIcon.html +2 -1
- package/src/lightning/buttonIcon/buttonIcon.js +10 -1
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +5 -1
- package/src/lightning/card/__docs__/card.md +1 -1
- package/src/lightning/card/card.js +1 -1
- package/src/lightning/datatable/datatable.js +6 -15
- package/src/lightning/datatable/templates/div/div.html +4 -2
- package/src/lightning/datatable/templates/table/table.html +4 -2
- package/src/lightning/dialog/README.md +1 -1
- package/src/lightning/dualListbox/dual-listbox.slds.css +200 -0
- package/src/lightning/dualListbox/dualListbox.css +3 -1
- package/src/lightning/dualListbox/dualListbox.html +2 -2
- package/src/lightning/dualListbox/dualListbox.js +2 -0
- package/src/lightning/dualListbox/form-element.slds.css +232 -0
- package/src/lightning/dynamicIcon/dynamic-icon-ellie.slds.css +180 -0
- package/src/lightning/dynamicIcon/dynamic-icon-eq.slds.css +63 -0
- package/src/lightning/dynamicIcon/dynamic-icon-score.slds.css +46 -0
- package/src/lightning/dynamicIcon/dynamic-icon-strength.slds.css +122 -0
- package/src/lightning/dynamicIcon/dynamic-icon-trend.slds.css +117 -0
- package/src/lightning/dynamicIcon/dynamic-icon-waffle.slds.css +177 -0
- package/src/lightning/dynamicIcon/ellie.css +1 -0
- package/src/lightning/dynamicIcon/eq.css +1 -0
- package/src/lightning/dynamicIcon/score.css +1 -0
- package/src/lightning/dynamicIcon/strength.css +1 -0
- package/src/lightning/dynamicIcon/trend.css +1 -0
- package/src/lightning/dynamicIcon/waffle.css +1 -0
- package/src/lightning/f6Controller/f6Controller.js +382 -0
- package/src/lightning/f6Controller/f6Controller.js-meta.xml +4 -0
- package/src/lightning/formattedRichText/formattedRichText.js +4 -3
- package/src/lightning/helptext/form-element.slds.css +232 -0
- package/src/lightning/helptext/help-text.slds.css +5 -1
- package/src/lightning/helptext/helptext.css +2 -1
- package/src/lightning/helptext/helptext.html +1 -0
- package/src/lightning/helptext/helptext.js +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/bill_of_materials.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/datashare_target.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/datashares.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/disclosure_and_compliance.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/facility_bed.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/market.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_sheet.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +34 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/add_source.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/app_web_messaging.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/bookmark_stroke.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/expired.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/favorite_alt.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/heart.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/hourglass.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/integration.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/market.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/more.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/notification_off.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/notification_snoozed.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/profile_alt.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/promotion_tiers.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/sender_email.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/service_appointment.html +13 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/service_report.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/toggle_off.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/toggle_on.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/your_account.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/bill_of_materials.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/datashare_target.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/datashares.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/disclosure_and_compliance.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/facility_bed.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/market.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_sheet.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +34 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/add_source.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/app_web_messaging.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/bookmark_stroke.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/expired.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/favorite_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/heart.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/hourglass.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/integration.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/market.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/more.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/notification_off.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/notification_snoozed.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/profile_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/promotion_tiers.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/sender_email.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/service_appointment.html +13 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/service_report.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/toggle_off.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/toggle_on.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/your_account.html +10 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/bill_of_materials.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/datashare_target.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/datashares.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/disclosure_and_compliance.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/facility_bed.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/market.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_sheet.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +11 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/bill_of_materials.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/datashare_target.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/datashares.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/disclosure_and_compliance.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/facility_bed.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/market.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_sheet.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +11 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +24 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/add_source.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/app_web_messaging.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/bookmark_stroke.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/expired.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/favorite_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/heart.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/hourglass.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/integration.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/market.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/more.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/notification_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/notification_snoozed.html +9 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/profile_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/promotion_tiers.html +10 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/sender_email.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/service_appointment.html +13 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/service_report.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/toggle_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/toggle_on.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/your_account.html +10 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +24 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/add_source.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/app_web_messaging.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/bookmark_stroke.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/buyer_group_qualifier.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/document_preview.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/expired.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/favorite_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/heart.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/hourglass.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/integration.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/market.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/more.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/mulesoft.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/notification_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/notification_snoozed.html +9 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/profile_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/promotion_tiers.html +10 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/sender_email.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/service_appointment.html +13 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/service_report.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/toggle_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/toggle_on.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/your_account.html +10 -0
- package/src/lightning/input/__docs__/input.md +1 -1
- package/src/lightning/input/input-text.slds.css +1 -1
- package/src/lightning/input/input.html +3 -3
- package/src/lightning/input/input.js +39 -3
- package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -0
- package/src/lightning/inputAddress/inputAddress.html +1 -0
- package/src/lightning/inputAddress/inputAddress.js +6 -0
- package/src/lightning/modal/__docs__/modal.md +187 -20
- package/src/lightning/modal/__examples__disabled/allform/allform.html +1 -1
- package/src/lightning/modal/__examples__disabled/allform/allform.js +1 -1
- package/src/lightning/modal/__examples__disabled/allformfull/allformfull.css +7 -0
- package/src/lightning/modal/__examples__disabled/allformfull/allformfull.html +9 -0
- package/src/lightning/modal/__examples__disabled/allformfull/allformfull.js +49 -0
- package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.css +3 -0
- package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.html +146 -0
- package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.js +240 -0
- package/src/lightning/modalBase/modalBase.css +1 -1
- package/src/lightning/modalBase/modalBase.html +1 -1
- package/src/lightning/modalBase/modalBase.js +180 -45
- package/src/lightning/modalBody/modalBody.js +133 -18
- package/src/lightning/modalFooter/modalFooter.js +57 -1
- package/src/lightning/navigation/__docs__/navigation.md +1 -1
- package/src/lightning/popup/popover.slds.css +121 -0
- package/src/lightning/popup/popup.css +3 -0
- package/src/lightning/positionLibrary/direction.js +10 -17
- package/src/lightning/positionLibrary/overlayDetector.js +10 -1
- package/src/lightning/primitiveBubble/primitiveBubble.js +16 -1
- package/src/lightning/primitiveCellCheckbox/primitiveCellCheckbox.js +15 -1
- package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +29 -0
- package/src/lightning/primitiveHeaderFactory/selectableHeader.html +3 -6
- package/src/lightning/progressIndicator/progressIndicator.js +1 -1
- package/src/lightning/select/__docs__/select.md +9 -0
- package/src/lightning/select/__examples__/disabled/disabled.html +10 -0
- package/src/lightning/select/__examples__/disabled/disabled.js +27 -0
- package/src/lightning/select/__examples__/hidden/hidden.html +10 -0
- package/src/lightning/select/__examples__/hidden/hidden.js +27 -0
- package/src/lightning/select/__examples__/inline/inline.html +10 -0
- package/src/lightning/select/__examples__/inline/inline.js +27 -0
- package/src/lightning/select/form-element.slds.css +232 -0
- package/src/lightning/select/select.css +3 -0
- package/src/lightning/select/select.html +2 -2
- package/src/lightning/select/select.js +3 -0
- package/src/lightning/select/select.slds.css +398 -0
- package/src/lightning/showToastEvent/showToastEvent.js +21 -0
- package/src/lightning/showToastEvent/showToastEvent.js-meta.xml +4 -0
- package/src/lightning/sldsCommon/sldsCommon.css +21 -4
- package/src/lightning/toast/__docs__/toast.md +103 -0
- package/src/lightning/toast/toast.css +52 -0
- package/src/lightning/toast/toast.html +70 -0
- package/src/lightning/toast/toast.js +608 -0
- package/src/lightning/toast/toast.js-meta.xml +4 -0
- package/src/lightning/toastContainer/__docs__/toastContainer.md +59 -0
- package/src/lightning/toastContainer/toastContainer.css +32 -0
- package/src/lightning/toastContainer/toastContainer.html +9 -0
- package/src/lightning/toastContainer/toastContainer.js +471 -0
- package/src/lightning/toastContainer/toastContainer.js-meta.xml +6 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +70 -8
- package/src/lightning/treeGrid/__docs__/treeGrid.md +7 -3
- package/src/lightning/treeGrid/treeGrid.js +25 -30
- package/src/lightning/utilsPrivate/normalize.js +22 -6
- package/src/lightning/utilsPrivate/url.js +2 -1
- package/src/lightning/verticalNavigation/vertical-navigation.slds.css +4 -0
- package/src/lightning/verticalNavigation/verticalNavigation.css +1 -0
- package/src/lightning/verticalNavigation/verticalNavigation.html +1 -1
- package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +19 -0
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.css +2 -0
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.html +1 -1
|
@@ -18,6 +18,11 @@ import closeButtonAltText from '@salesforce/label/LightningModalBase.cancelandcl
|
|
|
18
18
|
import disableCloseBtnMessage from '@salesforce/label/LightningModalBase.waitstate';
|
|
19
19
|
|
|
20
20
|
const DEBOUNCE_RESIZE = 300;
|
|
21
|
+
const SMALL_SCREEN_SIZE = 767;
|
|
22
|
+
const SIZE_SMALL = 'small';
|
|
23
|
+
const SIZE_MEDIUM = 'medium';
|
|
24
|
+
const SIZE_LARGE = 'large';
|
|
25
|
+
const SIZE_FULL = 'full';
|
|
21
26
|
|
|
22
27
|
export default class LightningModalBase extends LightningElement {
|
|
23
28
|
// this is visible in DOM, changed from 'lightning-modal-base'
|
|
@@ -26,12 +31,15 @@ export default class LightningModalBase extends LightningElement {
|
|
|
26
31
|
// private tracked state
|
|
27
32
|
initialRender = true;
|
|
28
33
|
autoFocusCompletedOnce = false;
|
|
29
|
-
windowResizeEventsBound = false;
|
|
30
34
|
timeoutId = 0;
|
|
31
35
|
disableCloseButton = false;
|
|
32
36
|
sectionAriaBusy = null;
|
|
33
37
|
closeButtonAltText = closeButtonAltText;
|
|
34
38
|
disableCloseBtnMessage = disableCloseBtnMessage;
|
|
39
|
+
isModalClosing = false;
|
|
40
|
+
// screen size private tracked state
|
|
41
|
+
isSmallScreenSize = null;
|
|
42
|
+
|
|
35
43
|
// modalHeader, child
|
|
36
44
|
headerRegistered = false;
|
|
37
45
|
headerHeight = 0;
|
|
@@ -51,6 +59,11 @@ export default class LightningModalBase extends LightningElement {
|
|
|
51
59
|
baseUpdateBodyCallback = null;
|
|
52
60
|
bodyResizeScheduled = false;
|
|
53
61
|
bodyTabElemRef = null;
|
|
62
|
+
// eventing state utilized when modalBody present
|
|
63
|
+
windowResizeEventBound = false;
|
|
64
|
+
windowOrientationEventBound = false;
|
|
65
|
+
portraitMatchMedia = null;
|
|
66
|
+
screenOrientationChangeHandler = null;
|
|
54
67
|
|
|
55
68
|
// modalFooter, child
|
|
56
69
|
footerRegistered = false;
|
|
@@ -70,7 +83,6 @@ export default class LightningModalBase extends LightningElement {
|
|
|
70
83
|
// modal features
|
|
71
84
|
isModalOpen = false;
|
|
72
85
|
isModalTransitioningIn = false;
|
|
73
|
-
_size = 'medium';
|
|
74
86
|
// modal background elements
|
|
75
87
|
savedInertElements = [];
|
|
76
88
|
// before modal opened, element previously focused
|
|
@@ -103,12 +115,12 @@ export default class LightningModalBase extends LightningElement {
|
|
|
103
115
|
|
|
104
116
|
/**
|
|
105
117
|
* Get the current modal size, calculated as a percentage of the viewport.
|
|
106
|
-
* Valid values are small, medium, and
|
|
118
|
+
* Valid values are small, medium, large, and full. The default is medium.
|
|
107
119
|
* @type {string}
|
|
108
120
|
* @default medium
|
|
109
121
|
*/
|
|
110
122
|
get size() {
|
|
111
|
-
const sizeDefault =
|
|
123
|
+
const sizeDefault = SIZE_MEDIUM;
|
|
112
124
|
const modal = this.modal;
|
|
113
125
|
if (!modal) {
|
|
114
126
|
return sizeDefault;
|
|
@@ -116,7 +128,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
116
128
|
// get the size value from <lightning-modal>
|
|
117
129
|
return normalizeString(modal.size, {
|
|
118
130
|
fallbackValue: sizeDefault,
|
|
119
|
-
validValues: [
|
|
131
|
+
validValues: [SIZE_FULL, SIZE_SMALL, SIZE_MEDIUM, SIZE_LARGE],
|
|
120
132
|
});
|
|
121
133
|
}
|
|
122
134
|
|
|
@@ -252,13 +264,16 @@ export default class LightningModalBase extends LightningElement {
|
|
|
252
264
|
* @returns {number}
|
|
253
265
|
* @private
|
|
254
266
|
*/
|
|
255
|
-
get
|
|
267
|
+
get backdropDimensions() {
|
|
256
268
|
const backdropElem = this.modalBackdrop;
|
|
257
269
|
const backdropRect = backdropElem
|
|
258
270
|
? backdropElem.getBoundingClientRect()
|
|
259
271
|
: {};
|
|
260
|
-
const { height } = backdropRect;
|
|
261
|
-
return
|
|
272
|
+
const { height, width } = backdropRect;
|
|
273
|
+
return {
|
|
274
|
+
height: height || 0,
|
|
275
|
+
width: width || 0,
|
|
276
|
+
};
|
|
262
277
|
}
|
|
263
278
|
|
|
264
279
|
/**
|
|
@@ -287,9 +302,10 @@ export default class LightningModalBase extends LightningElement {
|
|
|
287
302
|
}
|
|
288
303
|
// don't add animation related css classes in this group
|
|
289
304
|
classes.add({
|
|
290
|
-
'slds-
|
|
291
|
-
'slds-
|
|
292
|
-
'slds-
|
|
305
|
+
'slds-modal_full': sizeClass === SIZE_FULL,
|
|
306
|
+
'slds-modal_medium': sizeClass === SIZE_MEDIUM,
|
|
307
|
+
'slds-modal_large': sizeClass === SIZE_LARGE,
|
|
308
|
+
'slds-modal_small': sizeClass === SIZE_SMALL,
|
|
293
309
|
});
|
|
294
310
|
return classes.toString();
|
|
295
311
|
}
|
|
@@ -316,6 +332,20 @@ export default class LightningModalBase extends LightningElement {
|
|
|
316
332
|
return classes.toString();
|
|
317
333
|
}
|
|
318
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Compute the correct lightning-button-icon variant to use
|
|
337
|
+
* for the size="full" behaviors, based upon the screen size
|
|
338
|
+
* threshold. Important to maintain existing close button behavior
|
|
339
|
+
* when size 'small', 'medium' and 'large' close button variant
|
|
340
|
+
* when 'isSmallScreenSize = true' for a11y purposes
|
|
341
|
+
* @private
|
|
342
|
+
*/
|
|
343
|
+
get computedCloseButtonVariant() {
|
|
344
|
+
return this.isSmallScreenSize && this.size === SIZE_FULL
|
|
345
|
+
? 'bare'
|
|
346
|
+
: 'bare-inverse';
|
|
347
|
+
}
|
|
348
|
+
|
|
319
349
|
/**
|
|
320
350
|
* Saves the current active focused element on modal creation
|
|
321
351
|
* in order to be able to set focus back to that previous element
|
|
@@ -492,8 +522,11 @@ export default class LightningModalBase extends LightningElement {
|
|
|
492
522
|
[ARIA.LABEL]: label,
|
|
493
523
|
});
|
|
494
524
|
} else {
|
|
495
|
-
// in headless variant, must have label value set
|
|
496
|
-
|
|
525
|
+
// in headless variant, must have label value set, unless the modal
|
|
526
|
+
// is actively closing
|
|
527
|
+
if (!this.isModalClosing) {
|
|
528
|
+
this.unsetAriaLabelAndError();
|
|
529
|
+
}
|
|
497
530
|
}
|
|
498
531
|
}
|
|
499
532
|
}
|
|
@@ -530,6 +563,10 @@ export default class LightningModalBase extends LightningElement {
|
|
|
530
563
|
console.error('Invalid access to privateclose event');
|
|
531
564
|
return;
|
|
532
565
|
}
|
|
566
|
+
|
|
567
|
+
// set isModalClosing boolean, to prevent intentional error
|
|
568
|
+
// when checking for presence of api 'label' value
|
|
569
|
+
this.isModalClosing = true;
|
|
533
570
|
if (hasAnimation()) {
|
|
534
571
|
/// triggers the disappearance of the foreground modal elements
|
|
535
572
|
this.modalWrapper.classList.remove('slds-fade-in-open');
|
|
@@ -542,6 +579,17 @@ export default class LightningModalBase extends LightningElement {
|
|
|
542
579
|
// skip animation, resolve immediately
|
|
543
580
|
e.detail.resolve();
|
|
544
581
|
}
|
|
582
|
+
// disconnectedCallback doesn't get called on .close()
|
|
583
|
+
// unregistering child components
|
|
584
|
+
if (this.headerRegistered && this.unregisterHeader) {
|
|
585
|
+
this.unregisterHeader();
|
|
586
|
+
}
|
|
587
|
+
if (this.bodyRegistered && this.unregisterBody) {
|
|
588
|
+
this.unregisterBody();
|
|
589
|
+
}
|
|
590
|
+
if (this.footerRegistered && this.unregisterFooter) {
|
|
591
|
+
this.unregisterFooter();
|
|
592
|
+
}
|
|
545
593
|
this.closeModal();
|
|
546
594
|
}
|
|
547
595
|
|
|
@@ -678,7 +726,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
678
726
|
// FUTURE TODO mechanism to support aria-describedby
|
|
679
727
|
// aria-describedby is optional, without a good reproducible pattern
|
|
680
728
|
this.initBodyState();
|
|
681
|
-
this.
|
|
729
|
+
this.removeWindowResizeEventListener();
|
|
682
730
|
}
|
|
683
731
|
|
|
684
732
|
/**
|
|
@@ -707,11 +755,14 @@ export default class LightningModalBase extends LightningElement {
|
|
|
707
755
|
});
|
|
708
756
|
// cover case if modalBody is removed, then added back
|
|
709
757
|
// required to correctly set the CSS classes on modalBody
|
|
710
|
-
this.
|
|
758
|
+
this.updateModalBodyHeight();
|
|
711
759
|
|
|
712
760
|
// ModalBody can register 2+ times when initially rendering
|
|
713
|
-
if (!this.
|
|
714
|
-
this.
|
|
761
|
+
if (!this.windowResizeEventBound) {
|
|
762
|
+
this.addWindowResizeEventListener();
|
|
763
|
+
}
|
|
764
|
+
if (!this.windowOrientationEventBound) {
|
|
765
|
+
this.addOrientationChangeListener();
|
|
715
766
|
}
|
|
716
767
|
}
|
|
717
768
|
|
|
@@ -738,6 +789,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
738
789
|
this.baseUpdateBodyCallback = null;
|
|
739
790
|
this.bodyResizeScheduled = false;
|
|
740
791
|
this.bodyTabElemRef = null;
|
|
792
|
+
this.removeModalEventListeners();
|
|
741
793
|
}
|
|
742
794
|
|
|
743
795
|
/**
|
|
@@ -781,7 +833,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
781
833
|
});
|
|
782
834
|
// update modalBody max-height values
|
|
783
835
|
if (this.bodyRegistered) {
|
|
784
|
-
this.
|
|
836
|
+
this.updateModalBodyHeight();
|
|
785
837
|
}
|
|
786
838
|
}
|
|
787
839
|
|
|
@@ -847,7 +899,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
847
899
|
});
|
|
848
900
|
// update modalBody max-height values
|
|
849
901
|
if (this.bodyRegistered) {
|
|
850
|
-
this.
|
|
902
|
+
this.updateModalBodyHeight();
|
|
851
903
|
}
|
|
852
904
|
}
|
|
853
905
|
|
|
@@ -884,7 +936,7 @@ export default class LightningModalBase extends LightningElement {
|
|
|
884
936
|
*/
|
|
885
937
|
get modalResizing() {
|
|
886
938
|
if (!this._resizing) {
|
|
887
|
-
this._resizing = this.
|
|
939
|
+
this._resizing = this.scheduleWindowResizeEvent.bind(this);
|
|
888
940
|
}
|
|
889
941
|
return this._resizing;
|
|
890
942
|
}
|
|
@@ -896,13 +948,16 @@ export default class LightningModalBase extends LightningElement {
|
|
|
896
948
|
* the window.onresize event fires
|
|
897
949
|
* @private
|
|
898
950
|
*/
|
|
899
|
-
|
|
951
|
+
updateModalBodyHeight() {
|
|
900
952
|
clearTimeout(this.timeoutId);
|
|
901
953
|
this.timeoutId = 0;
|
|
902
954
|
const { bodyResizeScheduled, bodyRegistered, baseUpdateBodyCallback } =
|
|
903
955
|
this;
|
|
904
956
|
|
|
905
957
|
if (bodyRegistered && !bodyResizeScheduled) {
|
|
958
|
+
// check, and update isSmallScreenSize before
|
|
959
|
+
// callback to modalBody
|
|
960
|
+
this.setIsSmallScreenSize();
|
|
906
961
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
907
962
|
requestAnimationFrame(() => {
|
|
908
963
|
this.bodyResizeScheduled = false;
|
|
@@ -910,7 +965,11 @@ export default class LightningModalBase extends LightningElement {
|
|
|
910
965
|
const values = {
|
|
911
966
|
footerHeight: this.footerHeight || 0,
|
|
912
967
|
headerHeight: this.headerHeight || 0,
|
|
913
|
-
|
|
968
|
+
// backdrop values can be used as proxies for screen width / height
|
|
969
|
+
backdropHeight: this.backdropDimensions.height,
|
|
970
|
+
backdropWidth: this.backdropDimensions.width,
|
|
971
|
+
sizeSetFull: this.size === SIZE_FULL,
|
|
972
|
+
isSmallScreenSize: this.isSmallScreenSize,
|
|
914
973
|
};
|
|
915
974
|
baseUpdateBodyCallback(values);
|
|
916
975
|
}
|
|
@@ -924,11 +983,11 @@ export default class LightningModalBase extends LightningElement {
|
|
|
924
983
|
* from being fired every time window.onresize event fires
|
|
925
984
|
* @private
|
|
926
985
|
*/
|
|
927
|
-
|
|
986
|
+
scheduleWindowResizeEvent() {
|
|
928
987
|
if (this.timeoutId === 0) {
|
|
929
988
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
930
989
|
this.timeoutId = setTimeout(() => {
|
|
931
|
-
this.
|
|
990
|
+
this.updateModalBodyHeight();
|
|
932
991
|
}, DEBOUNCE_RESIZE);
|
|
933
992
|
}
|
|
934
993
|
}
|
|
@@ -937,18 +996,20 @@ export default class LightningModalBase extends LightningElement {
|
|
|
937
996
|
* Event handler for window.onresize event
|
|
938
997
|
* @private
|
|
939
998
|
*/
|
|
940
|
-
|
|
941
|
-
this.
|
|
999
|
+
handleWindowResizeEvent = () => {
|
|
1000
|
+
this.scheduleWindowResizeEvent();
|
|
942
1001
|
};
|
|
943
1002
|
|
|
944
1003
|
/**
|
|
945
|
-
*
|
|
1004
|
+
* Add window 'resize' event listener when modalBody is present
|
|
1005
|
+
* this only gets used by modalBody, so only gets wired up when
|
|
1006
|
+
* registerBody function called
|
|
946
1007
|
* @private
|
|
947
1008
|
*/
|
|
948
|
-
|
|
949
|
-
if (window && !this.
|
|
950
|
-
window.addEventListener('resize', this.
|
|
951
|
-
this.
|
|
1009
|
+
addWindowResizeEventListener() {
|
|
1010
|
+
if (window && !this.windowResizeEventBound) {
|
|
1011
|
+
window.addEventListener('resize', this.handleWindowResizeEvent);
|
|
1012
|
+
this.windowResizeEventBound = true;
|
|
952
1013
|
}
|
|
953
1014
|
}
|
|
954
1015
|
|
|
@@ -956,26 +1017,87 @@ export default class LightningModalBase extends LightningElement {
|
|
|
956
1017
|
* Detach window.onresize event listener when modalBody is removed
|
|
957
1018
|
* @private
|
|
958
1019
|
*/
|
|
959
|
-
|
|
960
|
-
if (window) {
|
|
961
|
-
window.removeEventListener('resize', this.
|
|
1020
|
+
removeWindowResizeEventListener() {
|
|
1021
|
+
if (window && this.windowResizeEventBound) {
|
|
1022
|
+
window.removeEventListener('resize', this.handleWindowResizeEvent);
|
|
962
1023
|
clearTimeout(this.timeoutId);
|
|
963
1024
|
this.timeoutId = 0;
|
|
964
|
-
this.
|
|
1025
|
+
this.windowResizeEventBound = false;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Remove screen orientation 'change' listener
|
|
1031
|
+
* @private
|
|
1032
|
+
*/
|
|
1033
|
+
removeOrientationChangeListener() {
|
|
1034
|
+
// TODO START HERE, check for this.windowOrientationEventBound === true
|
|
1035
|
+
if (this.portraitMatchMedia) {
|
|
1036
|
+
this.portraitMatchMedia.removeEventListener(
|
|
1037
|
+
'change',
|
|
1038
|
+
this.screenOrientationChangeHandler
|
|
1039
|
+
);
|
|
1040
|
+
this.portraitMatchMedia = null;
|
|
1041
|
+
this.windowOrientationEventBound = false;
|
|
1042
|
+
}
|
|
1043
|
+
if (this.screenOrientationChangeHandler) {
|
|
1044
|
+
this.screenOrientationChangeHandler = null;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Add screen orientation 'change' listener.
|
|
1050
|
+
* orientation changes: 'portrait' -> 'landscape' -> 'portrait'
|
|
1051
|
+
*/
|
|
1052
|
+
addOrientationChangeListener() {
|
|
1053
|
+
this.portraitMatchMedia = window.matchMedia('(orientation: portrait)');
|
|
1054
|
+
this.screenOrientationChangeHandler =
|
|
1055
|
+
this.handleWindowResizeEvent.bind(this);
|
|
1056
|
+
if (typeof this.portraitMatchMedia === 'function') {
|
|
1057
|
+
this.portraitMatchMedia.addEventListener(
|
|
1058
|
+
'change',
|
|
1059
|
+
this.screenOrientationChangeHandler
|
|
1060
|
+
);
|
|
1061
|
+
this.windowOrientationEventBound = true;
|
|
965
1062
|
}
|
|
966
1063
|
}
|
|
967
1064
|
|
|
1065
|
+
/**
|
|
1066
|
+
* determine if the current screen is less than SMALL_SCREEN_SIZE
|
|
1067
|
+
* for Modal, screen size detection is simplified to what's required
|
|
1068
|
+
* for the size="full" feature addition, which is a single breakpoint
|
|
1069
|
+
* either (a) at or below 767 pixels (small = full screen modal behavior),
|
|
1070
|
+
* or (b) at or above 768 (large = default modal behavior)
|
|
1071
|
+
* @private
|
|
1072
|
+
*/
|
|
1073
|
+
setIsSmallScreenSize() {
|
|
1074
|
+
const docElem = (document && document.documentElement) || null;
|
|
1075
|
+
const browserWidth = docElem ? docElem.clientWidth : window.innerWidth;
|
|
1076
|
+
const isSmallScreenSize = browserWidth <= SMALL_SCREEN_SIZE;
|
|
1077
|
+
if (isSmallScreenSize !== this.isSmallScreenSize) {
|
|
1078
|
+
this.isSmallScreenSize = isSmallScreenSize;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
removeModalEventListeners() {
|
|
1083
|
+
this.removeWindowResizeEventListener();
|
|
1084
|
+
this.removeOrientationChangeListener();
|
|
1085
|
+
}
|
|
1086
|
+
|
|
968
1087
|
/**
|
|
969
1088
|
* When modal is being created, initialize
|
|
970
|
-
* private tracked modal state
|
|
1089
|
+
* private tracked modal base/default state
|
|
1090
|
+
* this is a collection of state variables
|
|
1091
|
+
* that are not including modalHeader, modalBody,
|
|
1092
|
+
* modalFooter
|
|
971
1093
|
* @private
|
|
972
1094
|
*/
|
|
973
|
-
|
|
1095
|
+
initBaseState() {
|
|
974
1096
|
// setting initialRender true handles the case where modal
|
|
975
1097
|
// is added / removed/added back to DOM
|
|
976
1098
|
this.initialRender = true;
|
|
977
1099
|
this.autoFocusCompletedOnce = false;
|
|
978
|
-
this.
|
|
1100
|
+
this.windowResizeEventBound = false;
|
|
979
1101
|
this.timeoutId = 0;
|
|
980
1102
|
this.disableCloseButton = false;
|
|
981
1103
|
this.modalLabel = null;
|
|
@@ -983,24 +1105,37 @@ export default class LightningModalBase extends LightningElement {
|
|
|
983
1105
|
this.modalDescribedBy = null;
|
|
984
1106
|
this.showAriaLiveMessage = false;
|
|
985
1107
|
this.ariaLiveMessage = '';
|
|
986
|
-
this._size = 'medium';
|
|
987
1108
|
this.savedInertElements = [];
|
|
988
1109
|
this.savedActiveElement = null;
|
|
989
1110
|
this.isModalOpen = false;
|
|
990
1111
|
this.isModalTransitioningIn = false;
|
|
1112
|
+
this.isModalClosing = false;
|
|
1113
|
+
// browser screen size
|
|
1114
|
+
this.isSmallScreenSize = null;
|
|
991
1115
|
}
|
|
992
1116
|
|
|
993
|
-
|
|
994
|
-
|
|
1117
|
+
/**
|
|
1118
|
+
* Reset all modal state
|
|
1119
|
+
* @private
|
|
1120
|
+
*/
|
|
1121
|
+
initModalState() {
|
|
1122
|
+
this.initBaseState();
|
|
995
1123
|
this.initHeaderState();
|
|
996
1124
|
this.initBodyState();
|
|
997
1125
|
this.initFooterState();
|
|
998
1126
|
}
|
|
999
1127
|
|
|
1128
|
+
connectedCallback() {
|
|
1129
|
+
this.initModalState();
|
|
1130
|
+
// check for screen size right away
|
|
1131
|
+
// not adding event listeners here,
|
|
1132
|
+
// as 'resize' and 'orientation' events
|
|
1133
|
+
// are utilized by modalBody, see registerBody()
|
|
1134
|
+
this.setIsSmallScreenSize();
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1000
1137
|
disconnectedCallback() {
|
|
1001
|
-
|
|
1002
|
-
this.detachBodyResizeEvents();
|
|
1003
|
-
}
|
|
1138
|
+
this.removeModalEventListeners();
|
|
1004
1139
|
this.closeModal();
|
|
1005
1140
|
}
|
|
1006
1141
|
|
|
@@ -1021,6 +1156,6 @@ export default class LightningModalBase extends LightningElement {
|
|
|
1021
1156
|
this.focusFirstElement();
|
|
1022
1157
|
}
|
|
1023
1158
|
}
|
|
1024
|
-
this.
|
|
1159
|
+
this.updateModalBodyHeight();
|
|
1025
1160
|
}
|
|
1026
1161
|
}
|
|
@@ -114,34 +114,149 @@ export default class LightningModalBody extends LightningElement {
|
|
|
114
114
|
return firstElem;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Determine how much usuable screen height the modal has available
|
|
119
|
+
* @param {object} values passed from modalBase to modalBody
|
|
120
|
+
* representing height and width values of header, footer, and body
|
|
121
|
+
* @return {object} values, after adding of modalUsableHeight
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
124
|
+
calculateModalUsableHeight(values) {
|
|
125
|
+
const { backdropHeight, paddingTop, paddingBottom } = values;
|
|
126
|
+
const modalUsableHeight = backdropHeight - paddingTop - paddingBottom;
|
|
127
|
+
values.modalUsableHeight = modalUsableHeight;
|
|
128
|
+
return values;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Determine how much usuable height modalBody has available
|
|
133
|
+
* @param {object} values passed from modalBase to modalBody
|
|
134
|
+
* representing height and width values of header, footer, and body
|
|
135
|
+
* @return {number} calculation of modal body usable height
|
|
136
|
+
* @private
|
|
137
|
+
*/
|
|
138
|
+
calculateModalBodyUsableHeight({
|
|
139
|
+
modalUsableHeight,
|
|
140
|
+
headerHeight,
|
|
141
|
+
footerHeight,
|
|
142
|
+
}) {
|
|
143
|
+
return modalUsableHeight - headerHeight - footerHeight;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Based on initial values, calculate min/max height style values
|
|
148
|
+
* to set on modalBody for correct display of content, and scrollability
|
|
149
|
+
* @param {object} values passed from modalBase to modalBody,
|
|
150
|
+
* @param {boolean} shouldUseFullHeight boolean to determine if full
|
|
151
|
+
* height of screen should be used
|
|
152
|
+
* representing height and width values of header, footer, and body
|
|
153
|
+
* @return {object} values, after adding of modalUsableHeight
|
|
154
|
+
* @private
|
|
155
|
+
*/
|
|
156
|
+
updateModalBodyHeightValues(values, shouldUseFullHeight) {
|
|
157
|
+
const { modalBodyMinHeight } = values;
|
|
158
|
+
// first have to calculate the correct values
|
|
159
|
+
const updatedValues = this.calculateModalUsableHeight(values);
|
|
160
|
+
const modalBodyUsableHeight =
|
|
161
|
+
this.calculateModalBodyUsableHeight(updatedValues);
|
|
162
|
+
// update values with calculated values
|
|
163
|
+
values.modalBodyUsableHeight = modalBodyUsableHeight;
|
|
164
|
+
values.maxModalBodyHeightStyle = `${modalBodyUsableHeight}px`;
|
|
165
|
+
// need to adjust minHeight, to force modal to use full height
|
|
166
|
+
// of user screen
|
|
167
|
+
values.minModalBodyHeightStyle = shouldUseFullHeight
|
|
168
|
+
? `${modalBodyUsableHeight}px`
|
|
169
|
+
: `${modalBodyMinHeight}px`;
|
|
170
|
+
return values;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Set modal body height style values after calculating the correcting values to assign
|
|
175
|
+
* @param {object} values Provided height, width values from handleUpdateHeight
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
setModalBodyHeight(values, shouldUseFullHeight) {
|
|
179
|
+
const { maxModalBodyHeightStyle, minModalBodyHeightStyle } =
|
|
180
|
+
this.updateModalBodyHeightValues(values, shouldUseFullHeight);
|
|
181
|
+
const divElem = this.contentElem;
|
|
182
|
+
const styles = {
|
|
183
|
+
maxHeight: maxModalBodyHeightStyle,
|
|
184
|
+
minHeight: minModalBodyHeightStyle,
|
|
185
|
+
};
|
|
186
|
+
// set the max and min height value on modal body wrapper div
|
|
187
|
+
Object.assign(divElem.style, styles);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Update values based on whether size="full" behavior should be full screen (small)
|
|
192
|
+
* or less than full screen (large)
|
|
193
|
+
* @param {Boolean} shouldUseFullHeight Whether full height of screen should be used
|
|
194
|
+
* @param {object} values Provided height, width values from handleUpdateHeight
|
|
195
|
+
* @returns {object} updatedValues based on full screen or default strategy used
|
|
196
|
+
* @private
|
|
197
|
+
*/
|
|
198
|
+
updateValues(shouldUseFullHeight, values) {
|
|
199
|
+
const { headerHeight, footerHeight, backdropHeight } = values;
|
|
200
|
+
const MODAL_BODY_MIN_HEIGHT = 80;
|
|
201
|
+
// Full screen size constants
|
|
202
|
+
// positioning values of body and footer are effected
|
|
203
|
+
// by modalHeader presence (headless)
|
|
204
|
+
const PAD_TOP_FULL = 48;
|
|
205
|
+
const PAD_BOTTOM_FULL = 1;
|
|
206
|
+
// default screen behavior (original modal behavior)
|
|
207
|
+
const PAD_TOP_DEFAULT = 48;
|
|
208
|
+
const PAD_BOTTOM_DEFAULT = 80;
|
|
209
|
+
// use of Math.floor for some values returning half pixel values
|
|
210
|
+
// for example headerHeight = 505.5px
|
|
211
|
+
const updatedValues = {
|
|
212
|
+
headerHeight: Math.floor(headerHeight),
|
|
213
|
+
footerHeight: Math.floor(footerHeight),
|
|
214
|
+
backdropHeight: Math.floor(backdropHeight),
|
|
215
|
+
paddingTop: shouldUseFullHeight ? PAD_TOP_FULL : PAD_TOP_DEFAULT,
|
|
216
|
+
paddingBottom: shouldUseFullHeight
|
|
217
|
+
? PAD_BOTTOM_FULL
|
|
218
|
+
: PAD_BOTTOM_DEFAULT,
|
|
219
|
+
modalBodyMinHeight: MODAL_BODY_MIN_HEIGHT,
|
|
220
|
+
// these last four values must first be calculated
|
|
221
|
+
// the first two values get set on modal body
|
|
222
|
+
minModalBodyHeightStyle: null,
|
|
223
|
+
maxModalBodyHeightStyle: null,
|
|
224
|
+
modalBodyUsableHeight: null,
|
|
225
|
+
modalUsableHeight: null,
|
|
226
|
+
};
|
|
227
|
+
return updatedValues;
|
|
228
|
+
}
|
|
117
229
|
/**
|
|
118
230
|
* Set the max-height style inline on modalBody to prevent vertical height
|
|
119
231
|
* of overall modal to overflow
|
|
120
232
|
* This function is passed to the parent modal as a callback
|
|
121
233
|
* and will be called on first modal load, and then on window resize events
|
|
122
234
|
* as long as modalBody is present
|
|
123
|
-
*
|
|
124
|
-
*
|
|
235
|
+
* To support size="full" behavior (full screen modal), this flow has been updated
|
|
236
|
+
* to first determine which strategy to use, update values, then set values on modalBody
|
|
237
|
+
* @param {Object} values Representing headerHeight, footerHeight, backdropHeight,
|
|
238
|
+
* sizeSetFull, and isSmallScreenSize
|
|
125
239
|
* @private
|
|
126
240
|
*/
|
|
127
|
-
|
|
241
|
+
handleUpdateModalBodyHeight(values) {
|
|
128
242
|
if (!this.initialRender) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const divElem = this.contentElem;
|
|
137
|
-
const styles = {
|
|
138
|
-
maxHeight: `${modalBodyUsableHeight}px`,
|
|
139
|
-
minHeight: `${modalBodyMinHeight}px`,
|
|
140
|
-
};
|
|
141
|
-
// set the max and min height value on modal body wrapper div
|
|
142
|
-
Object.assign(divElem.style, styles);
|
|
243
|
+
const {
|
|
244
|
+
sizeSetFull,
|
|
245
|
+
isSmallScreenSize,
|
|
246
|
+
headerHeight,
|
|
247
|
+
footerHeight,
|
|
248
|
+
} = values;
|
|
249
|
+
// update modalBody state, tracks header and footer presence
|
|
143
250
|
this.headerPresent = headerHeight !== 0;
|
|
144
251
|
this.footerPresent = footerHeight !== 0;
|
|
252
|
+
// now determine behavior: full screen or default
|
|
253
|
+
const shouldUseFullHeight = sizeSetFull && isSmallScreenSize;
|
|
254
|
+
const updatedValues = this.updateValues(
|
|
255
|
+
shouldUseFullHeight,
|
|
256
|
+
values
|
|
257
|
+
);
|
|
258
|
+
// set updated values based on behavior
|
|
259
|
+
this.setModalBodyHeight(updatedValues, shouldUseFullHeight);
|
|
145
260
|
}
|
|
146
261
|
}
|
|
147
262
|
|
|
@@ -160,7 +275,7 @@ export default class LightningModalBody extends LightningElement {
|
|
|
160
275
|
bodyId: this.modalContentId,
|
|
161
276
|
bodyIsPopulated: this.isDefaultSlotPopulated,
|
|
162
277
|
defaultSlotHasRendered: !this.initialSlotRender,
|
|
163
|
-
updateBodyCallback: this.
|
|
278
|
+
updateBodyCallback: this.handleUpdateModalBodyHeight.bind(this),
|
|
164
279
|
unRegisterCallback: (unregisterCallback) => {
|
|
165
280
|
this.unregisterCallback = unregisterCallback;
|
|
166
281
|
},
|