lightning-base-components 1.17.3-alpha → 1.17.6-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 +125 -2
- package/package.json +17 -1
- 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 +9 -0
- package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.html +3 -0
- package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.js +43 -0
- package/src/lightning/ariaObserver/ariaObserver.js +16 -2
- package/src/lightning/baseCombobox/baseCombobox.js +11 -3
- package/src/lightning/baseCombobox/keyboard.js +3 -0
- 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/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/input-text.slds.css +1 -1
- package/src/lightning/input/input.html +3 -3
- package/src/lightning/input/input.js +38 -2
- 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/__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 +2 -2
- package/src/lightning/modalBase/modalBase.js +199 -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/primitiveBubble/primitiveBubble.js +16 -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 +82 -19
- package/src/lightning/treeGrid/__docs__/treeGrid.md +4 -3
- 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,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
|
+
};
|
|
@@ -119,9 +119,10 @@ export default class LightningFormattedRichText extends LightningElement {
|
|
|
119
119
|
|
|
120
120
|
renderRichText() {
|
|
121
121
|
if (this.connected) {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
const sanitizeText = this.sanitize(this.value);
|
|
123
|
+
const richText = this.disableLinkify
|
|
124
|
+
? sanitizeText
|
|
125
|
+
: linkify(sanitizeText);
|
|
125
126
|
const container = this.container;
|
|
126
127
|
|
|
127
128
|
if (this.clean) {
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
@supports (--styling-hooks: '') {
|
|
5
|
+
/* FORM ELEMENT: BASE */
|
|
6
|
+
:host([data-render-mode="shadow"]) .slds-form-element {
|
|
7
|
+
position: relative;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label {
|
|
12
|
+
overflow-wrap: break-word;
|
|
13
|
+
word-wrap: break-word;
|
|
14
|
+
hyphens: auto;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
color: var(--sds-g-color-neutral-base-30, #444444);
|
|
17
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
18
|
+
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
19
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
20
|
+
margin-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label:empty {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([data-render-mode="shadow"]) .slds-form-element__control {
|
|
28
|
+
clear: left; /* NOTE: Ideally we want left to be inline-start but browser support is not ready for that value. We need to figure out better RTL support */
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([data-render-mode="shadow"]) .slds-form-element__control .slds-radio,:host([data-render-mode="shadow"])
|
|
33
|
+
.slds-form-element__control .slds-checkbox {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
position: relative;
|
|
40
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
41
|
+
vertical-align: top;
|
|
42
|
+
line-height: var(--sds-g-font-lineheight-1, 1);
|
|
43
|
+
z-index: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon .slds-button_icon {
|
|
47
|
+
position: relative;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([data-render-mode="shadow"]) .slds-form-element__help,:host([data-render-mode="shadow"])
|
|
51
|
+
.slds-form-element__helper {
|
|
52
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
53
|
+
margin-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
54
|
+
display: block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([data-render-mode="shadow"]) .slds-form-element_edit .slds-form-element__static {
|
|
58
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly {
|
|
62
|
+
flex-basis: 0%;
|
|
63
|
+
border-bottom: var(--sds-g-sizing-border-1, 1px) solid var(--sds-g-color-neutral-base-90, #e5e5e5);
|
|
64
|
+
margin-block-end: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__control {
|
|
68
|
+
padding-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
69
|
+
padding-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__label {
|
|
73
|
+
margin-block-end: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([data-render-mode="shadow"]) .slds-form-element__legend {
|
|
77
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
78
|
+
float: left;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([data-render-mode="shadow"]) .slds-form-element__addon {
|
|
82
|
+
display: inline-block;
|
|
83
|
+
margin-block-start: 0;
|
|
84
|
+
margin-block-end: 0;
|
|
85
|
+
margin-inline-start: var(--sds-g-spacing-2, 0.5rem);
|
|
86
|
+
margin-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
87
|
+
align-self: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static {
|
|
91
|
+
overflow-wrap: break-word;
|
|
92
|
+
word-wrap: break-word;
|
|
93
|
+
word-break: break-word;
|
|
94
|
+
display: inline-block;
|
|
95
|
+
font-size: var(--sds-g-font-scale-neg-1, 0.875rem);
|
|
96
|
+
font-weight: var(--sds-g-font-weight-4, 400);
|
|
97
|
+
color: var(--sds-g-color-neutral-base-10, #181818);
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static.slds-text-longform *:last-child {
|
|
102
|
+
margin-block-end: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static:empty {
|
|
106
|
+
min-height: calc(var(--sds-g-sizing-6, 1.25rem) + 1px);
|
|
107
|
+
vertical-align: bottom;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static--edit {
|
|
111
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([data-render-mode="shadow"]) .slds-required {
|
|
115
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
116
|
+
margin-block-start: 0;
|
|
117
|
+
margin-block-end: 0;
|
|
118
|
+
margin-inline-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
119
|
+
margin-inline-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([data-render-mode="shadow"]) .slds-has-error .slds-form-element__help {
|
|
123
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host([data-render-mode="shadow"][invalid]) .slds-form-element__help {
|
|
127
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* --------------------------------------- */
|
|
131
|
+
|
|
132
|
+
/* FORM ELEMENT: STACKED */
|
|
133
|
+
|
|
134
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) {
|
|
135
|
+
display: block;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not(:host([data-render-mode="shadow"]) .slds-form-element_readonly) {
|
|
139
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not(:host([data-render-mode="shadow"]) .slds-is-editing) {
|
|
143
|
+
padding: 0 var(--sds-g-spacing-1, 0.25rem);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element {
|
|
147
|
+
padding: 0;
|
|
148
|
+
margin-block-end: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not([class*="slds-size"]) {
|
|
152
|
+
width: 100%;
|
|
153
|
+
flex-basis: 100%;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__label,:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
157
|
+
border-bottom: 0; /* Remove border when using legacy version of slds-form-element */
|
|
158
|
+
padding-inline-start: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
162
|
+
width: 100%;
|
|
163
|
+
flex-basis: 100%;
|
|
164
|
+
clear: left;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__icon {
|
|
168
|
+
float: none;
|
|
169
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* --------------------------------------- */
|
|
173
|
+
|
|
174
|
+
/* FORM ELEMENT: INLINE */
|
|
175
|
+
|
|
176
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) {
|
|
177
|
+
display: block;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not(:host([data-render-mode="shadow"]) .slds-form-element_readonly) {
|
|
181
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not([class*="slds-size"]) {
|
|
185
|
+
width: 100%;
|
|
186
|
+
flex-basis: 100%;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not(:host([data-render-mode="shadow"]) .slds-is-editing) {
|
|
190
|
+
padding: var(--sds-g-spacing-1, 0.25rem);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([data-render-mode="shadow"][variant~='label-inline']).slds-is-edited {
|
|
194
|
+
padding-block-start: var(--sds-g-sizing-6, 1.25rem)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media (min-width: 48em) {
|
|
198
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__label {
|
|
199
|
+
float: left;
|
|
200
|
+
max-width: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Removing icon width for when the help-text icon is present */
|
|
201
|
+
flex-basis: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Some form element controls are set to display:flex */
|
|
202
|
+
flex-grow: 1; /* For IE and Safari which didn't auto expand to the available space */
|
|
203
|
+
margin-block-end: 0;
|
|
204
|
+
position: relative;
|
|
205
|
+
z-index: 1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control {
|
|
209
|
+
padding-inline-start: 33%;
|
|
210
|
+
clear: none; /* Reset clear: left when switching to horizontal form layout */
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control .slds-form-element__control {
|
|
214
|
+
padding-inline-start: 0; /* Remove left padding on nested form controls, due to issues related to lightning-form components */
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list__column .slds-form-element__label {
|
|
218
|
+
width: auto;
|
|
219
|
+
max-width: 100%;
|
|
220
|
+
-ms-flex-preferred-size: auto;
|
|
221
|
+
flex-basis: auto;
|
|
222
|
+
float: none;
|
|
223
|
+
position: relative;
|
|
224
|
+
padding-inline-start: 0;
|
|
225
|
+
margin-block-end: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list {
|
|
229
|
+
clear: none;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -899,6 +899,10 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
899
899
|
--slds-c-buttonicon-bare-color-border-disabled,
|
|
900
900
|
transparent
|
|
901
901
|
);
|
|
902
|
+
--slds-c-buttonicon-color-background-disabled: var(
|
|
903
|
+
--slds-c-buttonicon-bare-color-background-disabled,
|
|
904
|
+
transparent
|
|
905
|
+
);
|
|
902
906
|
}
|
|
903
907
|
|
|
904
908
|
/**
|
|
@@ -1128,7 +1132,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
1128
1132
|
* outcome is the removal of this class and replacing the class with the SLDS
|
|
1129
1133
|
* utility package solution.
|
|
1130
1134
|
*/
|
|
1131
|
-
:host([data-render-mode="shadow"])
|
|
1135
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
1132
1136
|
position: absolute !important;
|
|
1133
1137
|
margin: -1px !important;
|
|
1134
1138
|
border: 0 !important;
|
|
@@ -28,6 +28,15 @@ export default class LightningHelptext extends LightningElement {
|
|
|
28
28
|
@api
|
|
29
29
|
content;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Reserved for internal use only.
|
|
33
|
+
* Should be set to -1 if button should not
|
|
34
|
+
* be focused during tab navigation and should
|
|
35
|
+
* be set to 0 if button should be focused.
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
@api tabIndex;
|
|
39
|
+
|
|
31
40
|
set iconName(value) {
|
|
32
41
|
this.state.iconName = value;
|
|
33
42
|
}
|