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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, Salesforce, Inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
@supports (--styling-hooks: '') {
|
|
5
|
+
:host([data-render-mode="shadow"]) {
|
|
6
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
7
|
+
|
|
8
|
+
/* Circle's cirumference, r=7.375 * pi * 2 */
|
|
9
|
+
--_icon-trend-circumference: 46.3385px;
|
|
10
|
+
|
|
11
|
+
/* Arrow path length */
|
|
12
|
+
--_icon-trend-arrow-length: 20.15px;
|
|
13
|
+
|
|
14
|
+
/* HACK: Trick minifiers so they don't minify 0px to 0,
|
|
15
|
+
which breaks the animation in Edge */
|
|
16
|
+
--_icon-trend-zero: 0.1px;
|
|
17
|
+
|
|
18
|
+
/* HACK: a 1px stroke sitting on a pixel grid line (here: the arrow)
|
|
19
|
+
doesn't get aliased well on non-retina displays,
|
|
20
|
+
so we bump up the stroke-width to force a better anti-aliasing
|
|
21
|
+
which improves rendering at small size */
|
|
22
|
+
--_icon-trend-one: 1.125px;
|
|
23
|
+
|
|
24
|
+
--_duration-slowly: 0.4s;
|
|
25
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
29
|
+
position: absolute !important;
|
|
30
|
+
margin: -1px !important;
|
|
31
|
+
border: 0 !important;
|
|
32
|
+
padding: 0 !important;
|
|
33
|
+
width: 1px !important;
|
|
34
|
+
height: 1px !important;
|
|
35
|
+
overflow: hidden !important;
|
|
36
|
+
clip: rect(0 0 0 0) !important;
|
|
37
|
+
text-transform: none !important;
|
|
38
|
+
white-space: nowrap !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend {
|
|
42
|
+
width: 1rem;
|
|
43
|
+
height: 1rem;
|
|
44
|
+
display: inline-block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend.slds-is-animated .slds-icon-trend__arrow {
|
|
48
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
49
|
+
animation: slds-icon-trend-arrow calc(var(--_duration-slowly) * 2) var(--_duration-slowly) ease-in-out both;
|
|
50
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend.slds-is-animated .slds-icon-trend__circle {
|
|
54
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
55
|
+
animation: slds-icon-trend-circle calc(var(--_duration-slowly) * 2) ease-in-out both;
|
|
56
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend.slds-is-paused .slds-icon-trend__arrow,:host([data-render-mode="shadow"])
|
|
60
|
+
.slds-icon-trend.slds-is-paused .slds-icon-trend__circle {
|
|
61
|
+
animation-play-state: paused;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend[data-slds-trend="down"] {
|
|
65
|
+
color: #ba0517;
|
|
66
|
+
transform: rotate(45deg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend[data-slds-trend="neutral"] {
|
|
70
|
+
color: #939393;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend[data-slds-trend="up"] {
|
|
74
|
+
color: #2e844a;
|
|
75
|
+
transform: rotate(-45deg);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend__arrow,:host([data-render-mode="shadow"])
|
|
79
|
+
.slds-icon-trend__circle {
|
|
80
|
+
stroke: currentColor;
|
|
81
|
+
fill: none;
|
|
82
|
+
stroke-linecap: round;
|
|
83
|
+
stroke-linejoin: round;
|
|
84
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
85
|
+
stroke-width: var(--_icon-trend-one);
|
|
86
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend__arrow {
|
|
90
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
91
|
+
stroke-dashoffset: var(--_icon-trend-zero);
|
|
92
|
+
stroke-dasharray: calc(var(--_icon-trend-arrow-length) * 2 - var(--_icon-trend-one));
|
|
93
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:host([data-render-mode="shadow"]) .slds-icon-trend__circle {
|
|
97
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
98
|
+
stroke-dasharray: calc(var(--_icon-trend-circumference) - 4px), var(--_icon-trend-circumference);
|
|
99
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@keyframes slds-icon-trend-arrow {
|
|
103
|
+
from {
|
|
104
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
105
|
+
stroke-dashoffset: calc(var(--_icon-trend-arrow-length) * 2);
|
|
106
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@keyframes slds-icon-trend-circle {
|
|
111
|
+
from {
|
|
112
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
113
|
+
stroke-dasharray: var(--_icon-trend-zero), var(--_icon-trend-circumference);
|
|
114
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, Salesforce, Inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
|
|
5
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
6
|
+
position: absolute !important;
|
|
7
|
+
margin: -1px !important;
|
|
8
|
+
border: 0 !important;
|
|
9
|
+
padding: 0 !important;
|
|
10
|
+
width: 1px !important;
|
|
11
|
+
height: 1px !important;
|
|
12
|
+
overflow: hidden !important;
|
|
13
|
+
clip: rect(0 0 0 0) !important;
|
|
14
|
+
text-transform: none !important;
|
|
15
|
+
white-space: nowrap !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* needed to reset button styles as a result of button neutral vs base parity issue */
|
|
19
|
+
|
|
20
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container {
|
|
21
|
+
border: 0;
|
|
22
|
+
outline: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
background: transparent;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover [class*='slds-r'],:host([data-render-mode="shadow"])
|
|
28
|
+
.slds-icon-waffle_container:focus [class*='slds-r'] {
|
|
29
|
+
animation: slds-icon-waffle-throb 2 200ms alternate;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r1,:host([data-render-mode="shadow"])
|
|
33
|
+
.slds-icon-waffle_container:hover .slds-r2,:host([data-render-mode="shadow"])
|
|
34
|
+
.slds-icon-waffle_container:hover .slds-r3,:host([data-render-mode="shadow"])
|
|
35
|
+
.slds-icon-waffle_container:focus .slds-r1,:host([data-render-mode="shadow"])
|
|
36
|
+
.slds-icon-waffle_container:focus .slds-r2,:host([data-render-mode="shadow"])
|
|
37
|
+
.slds-icon-waffle_container:focus .slds-r3 {
|
|
38
|
+
background-color: #418fde;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r4,:host([data-render-mode="shadow"])
|
|
42
|
+
.slds-icon-waffle_container:hover .slds-r5,:host([data-render-mode="shadow"])
|
|
43
|
+
.slds-icon-waffle_container:hover .slds-r7,:host([data-render-mode="shadow"])
|
|
44
|
+
.slds-icon-waffle_container:focus .slds-r4,:host([data-render-mode="shadow"])
|
|
45
|
+
.slds-icon-waffle_container:focus .slds-r5,:host([data-render-mode="shadow"])
|
|
46
|
+
.slds-icon-waffle_container:focus .slds-r7 {
|
|
47
|
+
background-color: #ed8b00;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r6,:host([data-render-mode="shadow"])
|
|
51
|
+
.slds-icon-waffle_container:hover .slds-r8,:host([data-render-mode="shadow"])
|
|
52
|
+
.slds-icon-waffle_container:hover .slds-r9,:host([data-render-mode="shadow"])
|
|
53
|
+
.slds-icon-waffle_container:focus .slds-r6,:host([data-render-mode="shadow"])
|
|
54
|
+
.slds-icon-waffle_container:focus .slds-r8,:host([data-render-mode="shadow"])
|
|
55
|
+
.slds-icon-waffle_container:focus .slds-r9 {
|
|
56
|
+
background-color: #ffb60f;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r2,:host([data-render-mode="shadow"])
|
|
60
|
+
.slds-icon-waffle_container:hover .slds-r4,:host([data-render-mode="shadow"])
|
|
61
|
+
.slds-icon-waffle_container:focus .slds-r2,:host([data-render-mode="shadow"])
|
|
62
|
+
.slds-icon-waffle_container:focus .slds-r4 {
|
|
63
|
+
transition-delay: 50ms;
|
|
64
|
+
animation-delay: 50ms;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r3,:host([data-render-mode="shadow"])
|
|
68
|
+
.slds-icon-waffle_container:hover .slds-r5,:host([data-render-mode="shadow"])
|
|
69
|
+
.slds-icon-waffle_container:hover .slds-r7,:host([data-render-mode="shadow"])
|
|
70
|
+
.slds-icon-waffle_container:focus .slds-r3,:host([data-render-mode="shadow"])
|
|
71
|
+
.slds-icon-waffle_container:focus .slds-r5,:host([data-render-mode="shadow"])
|
|
72
|
+
.slds-icon-waffle_container:focus .slds-r7 {
|
|
73
|
+
transition-delay: 100ms;
|
|
74
|
+
animation-delay: 100ms;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r6,:host([data-render-mode="shadow"])
|
|
78
|
+
.slds-icon-waffle_container:hover .slds-r8,:host([data-render-mode="shadow"])
|
|
79
|
+
.slds-icon-waffle_container:focus .slds-r6,:host([data-render-mode="shadow"])
|
|
80
|
+
.slds-icon-waffle_container:focus .slds-r8 {
|
|
81
|
+
transition-delay: 150ms;
|
|
82
|
+
animation-delay: 150ms;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle_container:hover .slds-r9,:host([data-render-mode="shadow"])
|
|
86
|
+
.slds-icon-waffle_container:focus .slds-r9 {
|
|
87
|
+
transition-delay: 200ms;
|
|
88
|
+
animation-delay: 200ms;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle {
|
|
92
|
+
width: 1.3125rem;
|
|
93
|
+
height: 1.3125rem;
|
|
94
|
+
position: relative;
|
|
95
|
+
display: block;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle [class*='slds-r'] {
|
|
100
|
+
width: 0.3125rem;
|
|
101
|
+
height: 0.3125rem;
|
|
102
|
+
background-color: #747474;
|
|
103
|
+
display: inline-block;
|
|
104
|
+
position: absolute;
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
transition: background-color 100ms;
|
|
107
|
+
transform-origin: 50% 50%;
|
|
108
|
+
will-change: scale, background-color;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r1 {
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
transition-delay: 200ms;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r2 {
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0.5rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r3 {
|
|
123
|
+
top: 0;
|
|
124
|
+
right: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r4 {
|
|
128
|
+
top: 0.5rem;
|
|
129
|
+
left: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r5 {
|
|
133
|
+
top: 0.5rem;
|
|
134
|
+
left: 0.5rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r6 {
|
|
138
|
+
top: 0.5rem;
|
|
139
|
+
right: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r7 {
|
|
143
|
+
bottom: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r8 {
|
|
148
|
+
bottom: 0;
|
|
149
|
+
left: 0.5rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r9 {
|
|
153
|
+
bottom: 0;
|
|
154
|
+
right: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r2,:host([data-render-mode="shadow"])
|
|
158
|
+
.slds-icon-waffle .slds-r4 {
|
|
159
|
+
transition-delay: 150ms;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r3,:host([data-render-mode="shadow"])
|
|
163
|
+
.slds-icon-waffle .slds-r5,:host([data-render-mode="shadow"])
|
|
164
|
+
.slds-icon-waffle .slds-r7 {
|
|
165
|
+
transition-delay: 100ms;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([data-render-mode="shadow"]) .slds-icon-waffle .slds-r6,:host([data-render-mode="shadow"])
|
|
169
|
+
.slds-icon-waffle .slds-r8 {
|
|
170
|
+
transition-delay: 50ms;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@keyframes slds-icon-waffle-throb {
|
|
174
|
+
to {
|
|
175
|
+
transform: scale(1.5);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-ellie.slds.css'; */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-eq.slds.css'; */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-score.slds.css'; */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-strength.slds.css'; */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-trend.slds.css'; */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @import './dynamic-icon-waffle.slds.css'; */
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { debounce } from 'lightning/inputUtils';
|
|
2
|
+
import { findAllTabbableElements } from 'lightning/focusUtils';
|
|
3
|
+
const DEBOUNCE_KEY_DOWN = 300;
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_CONFIG = {
|
|
6
|
+
navKey: 'F6',
|
|
7
|
+
f6RegionAttribute: 'data-f6-region',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* finds and returns the active element from an element
|
|
12
|
+
* @param {Element} element
|
|
13
|
+
* @returns {Element} - active element, otherwise, undefined
|
|
14
|
+
*/
|
|
15
|
+
export const getActiveElement = (element) => {
|
|
16
|
+
if (!element) {
|
|
17
|
+
return element;
|
|
18
|
+
}
|
|
19
|
+
if (!element.shadowRoot) {
|
|
20
|
+
if (element.activeElement) {
|
|
21
|
+
return getActiveElement(element.activeElement);
|
|
22
|
+
}
|
|
23
|
+
return element;
|
|
24
|
+
}
|
|
25
|
+
if (!element.shadowRoot.activeElement) {
|
|
26
|
+
return element;
|
|
27
|
+
}
|
|
28
|
+
return getActiveElement(element.shadowRoot.activeElement);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* F6Controller is a global focus management system which allows end users to use keyboard shortcuts to
|
|
33
|
+
* quickly move to designated regions in a page.
|
|
34
|
+
* It handles logic for:
|
|
35
|
+
* - Globally detecting F6 regions (i.e. registered components must have the data attribute stored in config - f6RegionAttribute
|
|
36
|
+
* in their tag, by default, 'data-f6-region')
|
|
37
|
+
* - Handling F6 keypresses by focusing and highlighting F6 regions
|
|
38
|
+
* Supported keyboard shortcuts:
|
|
39
|
+
* - Ctrl/Cmd + F6 to move focus to the next available registered region.
|
|
40
|
+
* - Shift + Ctrl/Cmd + F6 to move focus to the previous available registered region.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
export class F6Controller {
|
|
44
|
+
// an array of registered components
|
|
45
|
+
regions = [];
|
|
46
|
+
|
|
47
|
+
// Default configuration
|
|
48
|
+
config = DEFAULT_CONFIG;
|
|
49
|
+
|
|
50
|
+
// reference to the debounced key down handler
|
|
51
|
+
_debounceKeyDownHandler;
|
|
52
|
+
|
|
53
|
+
// reference to the style element
|
|
54
|
+
_styleElement;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Creates a F6Controller with the given configuration.
|
|
58
|
+
* @param {Object} config - a configuration object
|
|
59
|
+
* - config.navKey: the key used as a trigger for navigating between regions
|
|
60
|
+
* - config.f6RegionAttribute: attribute that defines f6 regions
|
|
61
|
+
*/
|
|
62
|
+
constructor(config = {}) {
|
|
63
|
+
// debounce function for handling keydown event
|
|
64
|
+
this._debounceKeyDownHandler = debounce(
|
|
65
|
+
this.handleKeyDown.bind(this),
|
|
66
|
+
DEBOUNCE_KEY_DOWN
|
|
67
|
+
);
|
|
68
|
+
this.initialize(config);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
appendStyleElement() {
|
|
72
|
+
// all F6 regions must be position relative.
|
|
73
|
+
this._styleElement = document.createElement('style');
|
|
74
|
+
this._styleElement.innerText = `[${this.config.f6RegionAttribute}]:focus-within { position: relative; outline: rgb(94, 158, 214) 3px solid; outline-offset: 3px; z-index: 9999;}`;
|
|
75
|
+
this._styleElement.setAttribute('type', 'text/css');
|
|
76
|
+
document.head.appendChild(this._styleElement);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Find the first focusable element inside of the input element.
|
|
80
|
+
* If no focusable element, set the input element to be focusable.
|
|
81
|
+
* @param {Element} element element to be examined
|
|
82
|
+
* @returns {Element} - the focusable element
|
|
83
|
+
*/
|
|
84
|
+
findFocusableElement(element) {
|
|
85
|
+
if (!element || !element.isConnected) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const tabbableElements = findAllTabbableElements(element);
|
|
90
|
+
if (tabbableElements && tabbableElements.length) {
|
|
91
|
+
return tabbableElements[0];
|
|
92
|
+
}
|
|
93
|
+
element.tabIndex = '-1';
|
|
94
|
+
return element;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Focus inside the given region:
|
|
99
|
+
* - element that last had focus in that region, else
|
|
100
|
+
* - first focusable element in that region, else
|
|
101
|
+
* - focus on region itself (no focusable elements in region)
|
|
102
|
+
* @param {Element} region - representing a region of the page
|
|
103
|
+
*/
|
|
104
|
+
focusIn(region) {
|
|
105
|
+
const element = this.findFocusableElement(region);
|
|
106
|
+
if (element) {
|
|
107
|
+
element.focus();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Navigates to next/previous region
|
|
113
|
+
* @param {KeyboardEvent} event - a KeyDown event
|
|
114
|
+
*/
|
|
115
|
+
handleNavigation(event) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
if (!this.regions.length) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const isPrevious = event.shiftKey;
|
|
121
|
+
const currentRegionIndex = this.getElementRegionIndex(
|
|
122
|
+
getActiveElement(event.target)
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const adjacentRegionIndex = this.getAdjacentRegionIndex(
|
|
126
|
+
currentRegionIndex,
|
|
127
|
+
isPrevious
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (adjacentRegionIndex === -1) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.focusIn(this.regions[adjacentRegionIndex]);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Determines whether or not container contains element through the shadow DOM.
|
|
138
|
+
* @param {Element} container - container element
|
|
139
|
+
* @param {Element} element - target element
|
|
140
|
+
* @returns {boolean}
|
|
141
|
+
*/
|
|
142
|
+
shadowContains(container, element) {
|
|
143
|
+
if (container === element || container.contains(element)) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (container.shadowRoot) {
|
|
148
|
+
if (
|
|
149
|
+
this.isElementInContainerElements(
|
|
150
|
+
container.shadowRoot.children,
|
|
151
|
+
element
|
|
152
|
+
)
|
|
153
|
+
) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (container.tagName === 'SLOT') {
|
|
158
|
+
if (
|
|
159
|
+
this.isElementInContainerElements(
|
|
160
|
+
container.assignedElements(),
|
|
161
|
+
element
|
|
162
|
+
)
|
|
163
|
+
) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return this.isElementInContainerElements(container.children, element);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Returns true if the container element contains the searchElement
|
|
173
|
+
* @param {Array} containerElements
|
|
174
|
+
* @param {Element} searchElement
|
|
175
|
+
* @returns {boolean}
|
|
176
|
+
*/
|
|
177
|
+
isElementInContainerElements(containerElements, searchElement) {
|
|
178
|
+
if (!containerElements || !containerElements.length) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
const numElements = containerElements.length;
|
|
182
|
+
for (let index = 0; index < numElements; index++) {
|
|
183
|
+
if (this.shadowContains(containerElements[index], searchElement)) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Find the index of the region containing a given DOM element.
|
|
192
|
+
* Regions can't be nested, and are thus mutually exclusive.
|
|
193
|
+
* @param {Element} element - a DOM element
|
|
194
|
+
* @returns {number} index of DOM element's associated region in region array,
|
|
195
|
+
* or -1 if element is not contained in any region
|
|
196
|
+
*/
|
|
197
|
+
getElementRegionIndex(element) {
|
|
198
|
+
if (!this.regions || !this.regions.length) {
|
|
199
|
+
return -1;
|
|
200
|
+
}
|
|
201
|
+
return this.regions.findIndex((container) => {
|
|
202
|
+
return this.shadowContains(container, element);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Gets the index of the next (or previous) region to highlight.
|
|
208
|
+
* @param {number} currentRegionIndex, index of the current region
|
|
209
|
+
* @param {boolean} isPrevious, true to get the index of the previous region
|
|
210
|
+
* @returns {number} index of the region to highlight next or -1 if the current region is the last region (1st region for reverse)
|
|
211
|
+
*/
|
|
212
|
+
getAdjacentRegionIndex(currentRegionIndex, isPrevious) {
|
|
213
|
+
const lastRegionIndex = this.regions.length - 1;
|
|
214
|
+
if (lastRegionIndex < 0) {
|
|
215
|
+
return -1;
|
|
216
|
+
}
|
|
217
|
+
if (isPrevious) {
|
|
218
|
+
if (currentRegionIndex <= 0) {
|
|
219
|
+
return lastRegionIndex;
|
|
220
|
+
}
|
|
221
|
+
return currentRegionIndex - 1;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (currentRegionIndex === lastRegionIndex) {
|
|
225
|
+
return 0;
|
|
226
|
+
}
|
|
227
|
+
return currentRegionIndex + 1;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Checks if a DOM element is visible. This only checks for visibility using
|
|
232
|
+
* `display:none` (on element or any of its ancestors) and doesn't account for
|
|
233
|
+
* elements hidden through other means - such as a opacity, visibility, aria-hidden, etc.
|
|
234
|
+
* @param {Element} element, a DOM element
|
|
235
|
+
* @returns {boolean} false if `display:none` or `visibility:hidden` is set anywhere in element's ancestor tree, true otherwise
|
|
236
|
+
*/
|
|
237
|
+
isVisible(element) {
|
|
238
|
+
if (element === document.body || !(element instanceof Element)) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
const computedStyle =
|
|
243
|
+
window.getComputedStyle(element) || element.style;
|
|
244
|
+
if (!computedStyle) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
const { display, visibility } = computedStyle;
|
|
248
|
+
if (
|
|
249
|
+
(display && display.toLowerCase() === 'none') ||
|
|
250
|
+
(visibility && visibility.toLowerCase() === 'hidden')
|
|
251
|
+
) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
return this.isVisible(element.parentNode);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Checks if a DOM element has no content inside. A DOM has no content inside if it
|
|
262
|
+
* only contains slots as children.
|
|
263
|
+
* @param {Element} element, a DOM element
|
|
264
|
+
* @returns {boolean} - true if element has no children other than slots
|
|
265
|
+
*/
|
|
266
|
+
isEmpty(element) {
|
|
267
|
+
if (element.tagName === 'SLOT') {
|
|
268
|
+
if (!this.isEmptyChildren(element.assignedElements())) {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
let children = element.children;
|
|
274
|
+
if ((!children || !children.length) && element.shadowRoot) {
|
|
275
|
+
children = element.shadowRoot.children;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return this.isEmptyChildren(children);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Check if the children are all empty
|
|
283
|
+
* @param {*} children - element
|
|
284
|
+
* @returns {boolean} true if all the child element are empty
|
|
285
|
+
*/
|
|
286
|
+
isEmptyChildren(children) {
|
|
287
|
+
if (!children || !children.length) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
const numChildren = children.length;
|
|
291
|
+
for (let index = 0; index < numChildren; index++) {
|
|
292
|
+
const child = children[index];
|
|
293
|
+
if (child.tagName !== 'SLOT' || !this.isEmpty(child)) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Searches for regions in the DOM and populates this.regions
|
|
302
|
+
*/
|
|
303
|
+
populateRegions() {
|
|
304
|
+
this.regions = [];
|
|
305
|
+
|
|
306
|
+
const treeWalker = document.createTreeWalker(
|
|
307
|
+
document.body,
|
|
308
|
+
NodeFilter.SHOW_ELEMENT,
|
|
309
|
+
this.elementFilter,
|
|
310
|
+
false
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
while (treeWalker.nextNode()) {
|
|
314
|
+
this.regions.push(treeWalker.currentNode);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Add document event listeners to handling all the F6 related interations
|
|
320
|
+
*/
|
|
321
|
+
initialize(config = {}) {
|
|
322
|
+
document.addEventListener('keydown', this._debounceKeyDownHandler);
|
|
323
|
+
this.regions = [];
|
|
324
|
+
this.config = {
|
|
325
|
+
...this.config,
|
|
326
|
+
...config,
|
|
327
|
+
};
|
|
328
|
+
this.appendStyleElement();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** Removes the event listeners bound in initialize(). */
|
|
332
|
+
cleanUp() {
|
|
333
|
+
document.removeEventListener('keydown', this._debounceKeyDownHandler);
|
|
334
|
+
this._regions = [];
|
|
335
|
+
this._config = DEFAULT_CONFIG;
|
|
336
|
+
this._debounceKeyDownHandler = null;
|
|
337
|
+
if (this._styleElement) {
|
|
338
|
+
document.head.removeChild(this._styleElement);
|
|
339
|
+
this._styleElement = null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* handle document keydown event, move focus to the adjacent region if it detects CTRL/CMD + F6
|
|
345
|
+
* @param {KeyDown} event
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
handleKeyDown = (event) => {
|
|
349
|
+
const { key, ctrlKey, metaKey } = event;
|
|
350
|
+
if (key === this.config.navKey && (ctrlKey || metaKey)) {
|
|
351
|
+
this.populateRegions();
|
|
352
|
+
this.handleNavigation(event);
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
elementFilter = (element) => {
|
|
357
|
+
if (
|
|
358
|
+
element.parentElement &&
|
|
359
|
+
element.parentElement.matches(`*[${this.config.f6RegionAttribute}]`)
|
|
360
|
+
) {
|
|
361
|
+
return NodeFilter.FILTER_REJECT;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (
|
|
365
|
+
element.matches(`*[${this.config.f6RegionAttribute}]`) &&
|
|
366
|
+
this.isVisible(element) &&
|
|
367
|
+
!this.isEmpty(element)
|
|
368
|
+
) {
|
|
369
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return NodeFilter.FILTER_SKIP;
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
let f6Controller;
|
|
377
|
+
export const createF6Controller = (config) => {
|
|
378
|
+
if (!f6Controller) {
|
|
379
|
+
f6Controller = new F6Controller(config);
|
|
380
|
+
}
|
|
381
|
+
return f6Controller;
|
|
382
|
+
};
|