lightning-base-components 1.17.3-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 +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 +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 +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 +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/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 +70 -8
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label class={computedLabelClass} for="select">
|
|
2
|
+
<label class={computedLabelClass} for="select" part="select-label">
|
|
3
3
|
<template if:true={required}>
|
|
4
4
|
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
5
5
|
</template>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
accesskey={accessKey}
|
|
24
24
|
size={size}
|
|
25
25
|
aria-invalid={computedAriaInvalid}
|
|
26
|
-
|
|
26
|
+
part="select">
|
|
27
27
|
<template for:each={options} for:item="option">
|
|
28
28
|
<template if:true={option.disabled}>
|
|
29
29
|
<option disabled key={option.value} value={option.value}>{option.label}</option>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getRealDOMId,
|
|
8
8
|
normalizeBoolean,
|
|
9
9
|
synchronizeAttrs,
|
|
10
|
+
reflectAttribute,
|
|
10
11
|
} from 'lightning/utilsPrivate';
|
|
11
12
|
import {
|
|
12
13
|
FieldConstraintApi,
|
|
@@ -122,6 +123,7 @@ export default class LightningSelect extends LightningElement {
|
|
|
122
123
|
set variant(value) {
|
|
123
124
|
this._variant = normalizeVariant(value);
|
|
124
125
|
this.updateClassList();
|
|
126
|
+
reflectAttribute(this, 'variant', this._variant);
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
/**
|
|
@@ -136,6 +138,7 @@ export default class LightningSelect extends LightningElement {
|
|
|
136
138
|
|
|
137
139
|
set multiple(value) {
|
|
138
140
|
this._multiple = normalizeBoolean(value);
|
|
141
|
+
reflectAttribute(this, 'multiple', this._multiple);
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
/**
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
2
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
3
|
+
|
|
4
|
+
@supports (--styling-hooks: '') {
|
|
5
|
+
:host([data-render-mode="shadow"]) [part~='help-text'] {
|
|
6
|
+
--slds-c-buttonicon-color-background: var(--slds-c-helptext-color-background);
|
|
7
|
+
--slds-c-buttonicon-color-background-hover: var(--slds-c-helptext-color-background-hover);
|
|
8
|
+
--slds-c-buttonicon-color-background-focus: var(--slds-c-helptext-color-background-focus);
|
|
9
|
+
--slds-c-buttonicon-color-background-active: var(--slds-c-helptext-color-background-active);
|
|
10
|
+
--slds-c-buttonicon-color-foreground: var(--slds-c-helptext-color-foreground);
|
|
11
|
+
--slds-c-buttonicon-color-foreground-hover: var(--slds-c-helptext-color-foreground-hover);
|
|
12
|
+
--slds-c-buttonicon-color-foreground-focus: var(--slds-c-helptext-color-foreground-focus);
|
|
13
|
+
--slds-c-buttonicon-color-foreground-active: var(--slds-c-helptext-color-foreground-active);
|
|
14
|
+
--slds-c-buttonicon-color-border: var(--slds-c-helptext-color-border, transparent);
|
|
15
|
+
--slds-c-buttonicon-color-border-hover: var(--slds-c-helptext-color-border-hover, transparent);
|
|
16
|
+
--slds-c-buttonicon-color-border-focus: var(--slds-c-helptext-color-border-focus, transparent);
|
|
17
|
+
--slds-c-buttonicon-color-border-active: var(--slds-c-helptext-color-border-active, transparent);
|
|
18
|
+
--slds-c-buttonicon-spacing-block: var(--slds-c-helptext-spacing-block, 0);
|
|
19
|
+
--slds-c-buttonicon-spacing-inline: var(--slds-c-helptext-spacing-inline, 0);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The extra wrapper div creates a new formatting context which messes up
|
|
23
|
+
* our consistent height and vertical alignment. We don't want this element
|
|
24
|
+
* to inherit any styling so we pass through to the contents. This element
|
|
25
|
+
* is for setting Styling Hooks only.
|
|
26
|
+
*/
|
|
27
|
+
display: contents;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
32
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
33
|
+
|
|
34
|
+
@supports (--styling-hooks: '') {
|
|
35
|
+
/* FORM ELEMENT: BASE */
|
|
36
|
+
:host([data-render-mode="shadow"]) .slds-form-element {
|
|
37
|
+
position: relative;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label {
|
|
42
|
+
overflow-wrap: break-word;
|
|
43
|
+
word-wrap: break-word;
|
|
44
|
+
hyphens: auto;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
color: var(--sds-g-color-neutral-base-30, #444444);
|
|
47
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
48
|
+
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
49
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
50
|
+
margin-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label:empty {
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([data-render-mode="shadow"]) .slds-form-element__control {
|
|
58
|
+
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 */
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([data-render-mode="shadow"]) .slds-form-element__control .slds-radio,:host([data-render-mode="shadow"])
|
|
63
|
+
.slds-form-element__control .slds-checkbox {
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon {
|
|
68
|
+
display: inline-block;
|
|
69
|
+
position: relative;
|
|
70
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
71
|
+
vertical-align: top;
|
|
72
|
+
line-height: var(--sds-g-font-lineheight-1, 1);
|
|
73
|
+
z-index: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon .slds-button_icon {
|
|
77
|
+
position: relative;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host([data-render-mode="shadow"]) .slds-form-element__help,:host([data-render-mode="shadow"])
|
|
81
|
+
.slds-form-element__helper {
|
|
82
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
83
|
+
margin-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([data-render-mode="shadow"]) .slds-form-element_edit .slds-form-element__static {
|
|
88
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly {
|
|
92
|
+
flex-basis: 0%;
|
|
93
|
+
border-bottom: var(--sds-g-sizing-border-1, 1px) solid var(--sds-g-color-neutral-base-90, #e5e5e5);
|
|
94
|
+
margin-block-end: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__control {
|
|
98
|
+
padding-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
99
|
+
padding-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__label {
|
|
103
|
+
margin-block-end: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([data-render-mode="shadow"]) .slds-form-element__legend {
|
|
107
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
108
|
+
float: left;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([data-render-mode="shadow"]) .slds-form-element__addon {
|
|
112
|
+
display: inline-block;
|
|
113
|
+
margin-block-start: 0;
|
|
114
|
+
margin-block-end: 0;
|
|
115
|
+
margin-inline-start: var(--sds-g-spacing-2, 0.5rem);
|
|
116
|
+
margin-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
117
|
+
align-self: center;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static {
|
|
121
|
+
overflow-wrap: break-word;
|
|
122
|
+
word-wrap: break-word;
|
|
123
|
+
word-break: break-word;
|
|
124
|
+
display: inline-block;
|
|
125
|
+
font-size: var(--sds-g-font-scale-neg-1, 0.875rem);
|
|
126
|
+
font-weight: var(--sds-g-font-weight-4, 400);
|
|
127
|
+
color: var(--sds-g-color-neutral-base-10, #181818);
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static.slds-text-longform *:last-child {
|
|
132
|
+
margin-block-end: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static:empty {
|
|
136
|
+
min-height: calc(var(--sds-g-sizing-6, 1.25rem) + 1px);
|
|
137
|
+
vertical-align: bottom;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static--edit {
|
|
141
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([data-render-mode="shadow"]) .slds-required {
|
|
145
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
146
|
+
margin-block-start: 0;
|
|
147
|
+
margin-block-end: 0;
|
|
148
|
+
margin-inline-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
149
|
+
margin-inline-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([data-render-mode="shadow"]) .slds-has-error .slds-form-element__help {
|
|
153
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([data-render-mode="shadow"][invalid]) .slds-form-element__help {
|
|
157
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* --------------------------------------- */
|
|
161
|
+
|
|
162
|
+
/* FORM ELEMENT: STACKED */
|
|
163
|
+
|
|
164
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) {
|
|
165
|
+
display: block;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not(:host([data-render-mode="shadow"]) .slds-form-element_readonly) {
|
|
169
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not(:host([data-render-mode="shadow"]) .slds-is-editing) {
|
|
173
|
+
padding: 0 var(--sds-g-spacing-1, 0.25rem);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element {
|
|
177
|
+
padding: 0;
|
|
178
|
+
margin-block-end: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']):not([class*="slds-size"]) {
|
|
182
|
+
width: 100%;
|
|
183
|
+
flex-basis: 100%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__label,:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
187
|
+
border-bottom: 0; /* Remove border when using legacy version of slds-form-element */
|
|
188
|
+
padding-inline-start: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
192
|
+
width: 100%;
|
|
193
|
+
flex-basis: 100%;
|
|
194
|
+
clear: left;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__icon {
|
|
198
|
+
float: none;
|
|
199
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* --------------------------------------- */
|
|
203
|
+
|
|
204
|
+
/* FORM ELEMENT: INLINE */
|
|
205
|
+
|
|
206
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) {
|
|
207
|
+
display: block;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not(:host([data-render-mode="shadow"]) .slds-form-element_readonly) {
|
|
211
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not([class*="slds-size"]) {
|
|
215
|
+
width: 100%;
|
|
216
|
+
flex-basis: 100%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
:host([data-render-mode="shadow"][variant~='label-inline']):not(:host([data-render-mode="shadow"]) .slds-is-editing) {
|
|
220
|
+
padding: var(--sds-g-spacing-1, 0.25rem);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
:host([data-render-mode="shadow"][variant~='label-inline']).slds-is-edited {
|
|
224
|
+
padding-block-start: var(--sds-g-sizing-6, 1.25rem)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@media (min-width: 48em) {
|
|
228
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__label {
|
|
229
|
+
float: left;
|
|
230
|
+
max-width: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Removing icon width for when the help-text icon is present */
|
|
231
|
+
flex-basis: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Some form element controls are set to display:flex */
|
|
232
|
+
flex-grow: 1; /* For IE and Safari which didn't auto expand to the available space */
|
|
233
|
+
margin-block-end: 0;
|
|
234
|
+
position: relative;
|
|
235
|
+
z-index: 1;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control {
|
|
239
|
+
padding-inline-start: 33%;
|
|
240
|
+
clear: none; /* Reset clear: left when switching to horizontal form layout */
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control .slds-form-element__control {
|
|
244
|
+
padding-inline-start: 0; /* Remove left padding on nested form controls, due to issues related to lightning-form components */
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list__column .slds-form-element__label {
|
|
248
|
+
width: auto;
|
|
249
|
+
max-width: 100%;
|
|
250
|
+
-ms-flex-preferred-size: auto;
|
|
251
|
+
flex-basis: auto;
|
|
252
|
+
float: none;
|
|
253
|
+
position: relative;
|
|
254
|
+
padding-inline-start: 0;
|
|
255
|
+
margin-block-end: 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list {
|
|
259
|
+
clear: none;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@supports (--styling-hooks: '') {
|
|
265
|
+
/* SELECT */
|
|
266
|
+
:host([data-render-mode="shadow"]) [part~='select'] {
|
|
267
|
+
height: calc(var(--slds-c-select-input-sizing-height, 1.875rem) + (var(--sds-g-sizing-border-1, 1px) * 2));
|
|
268
|
+
width: 100%;
|
|
269
|
+
border: var(--sds-g-sizing-border-1, 1px) solid var(--slds-c-select-color-border, var(--sds-g-color-neutral-base-80, #c9c9c9));
|
|
270
|
+
border-radius: var(--slds-c-select-radius-border, var(--sds-g-radius-border-2, 0.25rem));
|
|
271
|
+
background-color: var(--slds-c-select-color-background,
|
|
272
|
+
var(--sds-g-color-neutral-base-100, #ffffff));
|
|
273
|
+
color: var(--slds-c-select-text-color, currentColor, var(--sds-g-color-neutral-base-10, #181818));
|
|
274
|
+
box-shadow: var(--slds-c-select-shadow);
|
|
275
|
+
transition: border 0.1s linear, background-color 0.1s linear;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
:host([data-render-mode="shadow"]) [part~='select'][required] {
|
|
279
|
+
box-shadow: none; /* @legacy: This is ported over from SLDS but not clear why this design decision is made. */
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host([data-render-mode="shadow"]) [part~='select']:focus,:host([data-render-mode="shadow"])
|
|
283
|
+
[part~='select']:active {
|
|
284
|
+
outline: 0;
|
|
285
|
+
border-color: var(--slds-c-select-color-border-focus, var(--sds-g-color-brand-base-60, #1b96ff));
|
|
286
|
+
background-color: var(--slds-c-select-color-background-focus, var(--sds-g-color-neutral-base-100, #ffffff));
|
|
287
|
+
color: var(--slds-c-select-text-color-focus);
|
|
288
|
+
box-shadow: var(--slds-c-select-shadow-focus, 0 0 3px var(--sds-g-color-brand-base-50, #0176d3));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
:host([data-render-mode="shadow"]) [part~='select'][disabled] {
|
|
292
|
+
background-color: var(--sds-g-color-neutral-base-95, #f3f3f3);
|
|
293
|
+
border-color: var(--sds-g-color-neutral-base-80, #c9c9c9);
|
|
294
|
+
color: var(--sds-g-color-neutral-base-50, #747474);
|
|
295
|
+
cursor: not-allowed;
|
|
296
|
+
user-select: none;
|
|
297
|
+
opacity: 1;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
:host([data-render-mode="shadow"]) [part~='select'][disabled]:focus,:host([data-render-mode="shadow"])
|
|
301
|
+
[part~='select'][disabled]:active {
|
|
302
|
+
box-shadow: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:host([data-render-mode="shadow"]) [part~='select'][size],:host([data-render-mode="shadow"])
|
|
306
|
+
[part~='select'][multiple] {
|
|
307
|
+
min-height: calc(var(--slds-c-select-input-sizing-height) + (var(--sds-g-sizing-border-1, 1px) * 2));
|
|
308
|
+
height: inherit;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
:host([data-render-mode="shadow"]) [part~='select'][size] option,:host([data-render-mode="shadow"])
|
|
312
|
+
[part~='select'][multiple] option {
|
|
313
|
+
padding: var(--sds-g-spacing-2, 0.5rem);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
:host([data-render-mode="shadow"]) .slds-select_container {
|
|
317
|
+
position: relative;
|
|
318
|
+
color: var(--slds-c-select-container-color);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
:host([data-render-mode="shadow"]) .slds-select_container [part~="select"] {
|
|
322
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
323
|
+
-moz-appearance: none;
|
|
324
|
+
-webkit-appearance: none;
|
|
325
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
326
|
+
padding: 0 var(--sds-g-spacing-5, 1.5rem) 0 var(--sds-g-spacing-2, 0.5rem);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
:host([data-render-mode="shadow"]) .slds-select_container [part~="select"]::-ms-expand {
|
|
330
|
+
display: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
:host([data-render-mode="shadow"]) .slds-select_container::before,:host([data-render-mode="shadow"])
|
|
334
|
+
.slds-select_container::after {
|
|
335
|
+
position: absolute;
|
|
336
|
+
content: '';
|
|
337
|
+
display: block;
|
|
338
|
+
right: var(--sds-g-spacing-2, 0.5rem);
|
|
339
|
+
width: 0;
|
|
340
|
+
height: 0;
|
|
341
|
+
border-left: 3px solid transparent;
|
|
342
|
+
border-right: 3px solid transparent;
|
|
343
|
+
pointer-events: none;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
:host([data-render-mode="shadow"]) .slds-select_container::before {
|
|
347
|
+
border-bottom: 5px solid currentColor;
|
|
348
|
+
top: calc((var(--sds-g-sizing-8, 1.75rem) / 2) - 6px);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
:host([data-render-mode="shadow"]) .slds-select_container::after {
|
|
352
|
+
border-top: 5px solid currentColor;
|
|
353
|
+
bottom: calc((var(--sds-g-sizing-8, 1.75rem) / 2) - 6px);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
:host([data-render-mode="shadow"][multiple]) .slds-select_container::before,:host([data-render-mode="shadow"][multiple]) .slds-select_container::after {
|
|
357
|
+
display: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
:host([data-render-mode="shadow"][invalid]) [part~="select"] {
|
|
361
|
+
border-color: var(--sds-g-color-error-base-50, #ea001e);
|
|
362
|
+
box-shadow: var(--sds-g-color-error-base-50, #ea001e) 0 0 0 var(--sds-g-sizing-border-1, 1px) inset;
|
|
363
|
+
background-clip: padding-box;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
:host([data-render-mode="shadow"][invalid]) [part~="select"]:focus,:host([data-render-mode="shadow"][invalid]) [part~="select"]:active {
|
|
367
|
+
box-shadow: var(--sds-g-color-error-base-50, #ea001e) 0 0 0 var(--sds-g-sizing-border-1, 1px) inset, 0 0 3px var(--sds-g-color-brand-base-50, #0176d3);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/* LABEL */
|
|
371
|
+
|
|
372
|
+
/* Styling Specifically for select label */
|
|
373
|
+
:host([data-render-mode="shadow"]) [part~="select-label"] {
|
|
374
|
+
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
375
|
+
color: var(--slds-c-select-label-color, var(--sds-g-color-neutral-base-30, #444444));
|
|
376
|
+
font-size: var(--slds-c-select-label-font-size, var(--sds-g-font-scale-neg-3, 0.75rem));
|
|
377
|
+
|
|
378
|
+
/* We inline flex to control the spacing between elements and not have to rely on whitespace characters */
|
|
379
|
+
display: inline-flex;
|
|
380
|
+
|
|
381
|
+
/* TODO: Add global hook once SLDS creates a new spacing hook that equals the value needed here */
|
|
382
|
+
column-gap: 0.125rem;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* ASSISTIVE TEXT */
|
|
386
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
387
|
+
position: absolute !important;
|
|
388
|
+
margin: -1px !important;
|
|
389
|
+
border: 0 !important;
|
|
390
|
+
padding: 0 !important;
|
|
391
|
+
width: 1px !important;
|
|
392
|
+
height: 1px !important;
|
|
393
|
+
overflow: hidden !important;
|
|
394
|
+
clip: rect(0 0 0 0) !important;
|
|
395
|
+
text-transform: none !important;
|
|
396
|
+
white-space: nowrap !important;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const SHOW_TOAST_EVENT_NAME = 'lightning__showtoast';
|
|
2
|
+
|
|
3
|
+
export class ShowToastEvent extends CustomEvent {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
const options = {
|
|
6
|
+
bubbles: true,
|
|
7
|
+
cancelable: true,
|
|
8
|
+
composed: true,
|
|
9
|
+
};
|
|
10
|
+
if (config) {
|
|
11
|
+
const { label } = config;
|
|
12
|
+
if (!label) {
|
|
13
|
+
console.error(
|
|
14
|
+
'Toast: please provide at least the "label" property to show the toast'
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
options.detail = config;
|
|
18
|
+
}
|
|
19
|
+
super(SHOW_TOAST_EVENT_NAME, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -44,10 +44,19 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
44
44
|
cursor: pointer;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
[type='search'] {
|
|
48
|
+
-webkit-appearance: textfield;
|
|
49
|
+
outline-offset: -2px;
|
|
50
|
+
}
|
|
51
|
+
button,
|
|
52
|
+
input,
|
|
53
|
+
optgroup,
|
|
54
|
+
select,
|
|
55
|
+
textarea {
|
|
56
|
+
color: inherit;
|
|
57
|
+
font: inherit;
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
51
60
|
|
|
52
61
|
input:focus,
|
|
53
62
|
button:focus,
|
|
@@ -94,3 +103,11 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
94
103
|
iframe {
|
|
95
104
|
border-style: none;
|
|
96
105
|
}
|
|
106
|
+
|
|
107
|
+
svg:not([fill]) {
|
|
108
|
+
fill: currentColor;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
abbr[title] {
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
The `LightningToast` component displays a toast notification with an icon, label, message, and links. Use a toast to convey small pieces of information to the user in a non-obtrusive way.
|
|
2
|
+
|
|
3
|
+
This component is for internal use only.
|
|
4
|
+
|
|
5
|
+
### Show a Toast
|
|
6
|
+
|
|
7
|
+
To show a toast, simply calls the `Toast`'s static function `show(config, comp)` with the proper toast config and a reference of the local component as parameters.
|
|
8
|
+
The function also creates a single page-level toast container if one does not exist.
|
|
9
|
+
|
|
10
|
+
```javascript
|
|
11
|
+
// c/myComponent.js
|
|
12
|
+
import { LightningElement } from 'lwc';
|
|
13
|
+
import { Toast } from 'lightning/toast';
|
|
14
|
+
|
|
15
|
+
export default class MyComponent extends LightningElement {
|
|
16
|
+
...
|
|
17
|
+
onClick() {
|
|
18
|
+
...
|
|
19
|
+
Toast.show({
|
|
20
|
+
label: 'This is a toast label which shows {0}, you can learn more about its accessibility from {1}',
|
|
21
|
+
labelLinks : [{
|
|
22
|
+
url: 'https://www.lightningdesignsystem.com/components/toast/',
|
|
23
|
+
label: 'LDS link'
|
|
24
|
+
}, {
|
|
25
|
+
url: 'https://www.lightningdesignsystem.com/accessibility/guidelines/global-focus/#toasts',
|
|
26
|
+
label: 'toast guideline'
|
|
27
|
+
}],
|
|
28
|
+
message: 'I want to show a {salesforceLink} and a {slackLink}',
|
|
29
|
+
messageLinks: {
|
|
30
|
+
salesforceLink: {
|
|
31
|
+
url: 'http://www.salesforce.com',
|
|
32
|
+
label: 'Salesforce link'
|
|
33
|
+
},
|
|
34
|
+
slackLink: {
|
|
35
|
+
url: 'https://slack.com',
|
|
36
|
+
label: 'Slack link'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
mode: 'sticky',
|
|
40
|
+
variant: 'info'
|
|
41
|
+
}, this);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
Above shows a complete example a toast config, illustrating the two possible styles for specifying links (see note below). The container will display a sticky mode informational toast message with string stored in `label` as the toast title and string stored `message` as the toast message. The `{0}`, `{1}`, and the `{salesforceLink}`, `{slackLink} `will be replaced with their specified link.
|
|
46
|
+
|
|
47
|
+
The toast component will display and be managed in a page level `LightningToastContainer` component.
|
|
48
|
+
|
|
49
|
+
**_NOTE:_** `label` can have index-based or name-based link placeholders. In the case of index-based link placeholders, `labelLinks` must be defined as an array, otherwise, `labelLinks` must be defined as a map. Same applies to `message`.
|
|
50
|
+
|
|
51
|
+
### Component Styling
|
|
52
|
+
|
|
53
|
+
`LightningToast` implements the [toast](https://www.lightningdesignsystem.com/components/toast/) blueprint in the Salesforce Lightning Design System (SLDS).
|
|
54
|
+
|
|
55
|
+
### `config` attributes
|
|
56
|
+
|
|
57
|
+
Attribute | Explanation |
|
|
58
|
+
|----------| ------------ |
|
|
59
|
+
| `label` (required) | title of the toast, it can contain placeholders in the form of `{0} ... {N}` (index-based) or `{name} ... {someOtherName}` (name-based). The placeholders are replaced with the links on `labelLinks`. |
|
|
60
|
+
| `labelLinks` | [{url, label}], which will replace the `{0} ... {N}` indexed placeholders in `label` or `{ name: {url, label} }`, which will replace the `{name} ... {someOtherName}` named placeholders in `label`. |
|
|
61
|
+
| `message` | description of the toast, it can contain placeholders in the form of `{0} ... {N}` (index-based) or `{name} ... {someOtherName}` (name-based). The placeholders are replaced with the links on `messageLinks`. |
|
|
62
|
+
| `messageLinks` | [{url, label}], which will replace the `{0} ... {N}` indexed placeholders in `message` or `{ name: {url, label} }`, which will replace the `{name} ... {someOtherName}` named placeholders in `message`. |
|
|
63
|
+
| `variant` | appearance of the toast notice. |
|
|
64
|
+
| `mode` | persistence of the toast. |
|
|
65
|
+
|
|
66
|
+
**_NOTE:_** When `labelLinks` (or `messageLinks`) is provided in the config, the content of `label` (or `message`) will be rendered using [`lightning-formatted-rich-text`](https://developer.salesforce.com/docs/component-library/bundle/lightning-formatted-rich-text/documentation); consult the documentation for expected result when link presents.
|
|
67
|
+
|
|
68
|
+
#### `variant` attribute
|
|
69
|
+
|
|
70
|
+
The `variant` attribute sets the component's color and icon. It supports these values.
|
|
71
|
+
|
|
72
|
+
| Value | Color | Icon |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `info` (default) | grey | `utility:info`|
|
|
75
|
+
| `success` | green | `utility:success`|
|
|
76
|
+
| `warning` | orange | `utility:warning`|
|
|
77
|
+
| `error` | red | `utility:error`|
|
|
78
|
+
|
|
79
|
+
#### `mode` attribute
|
|
80
|
+
|
|
81
|
+
The `mode` attribute sets the component's dismissal. It supports these values.
|
|
82
|
+
- `dismissible` - The component automatically disappears after a certain duration. The user can dismiss it early by clicking the close button. The time duration for `dismissible` is 4.8 seconds, or 9.6 seconds if the toast contains a link.
|
|
83
|
+
- `sticky` - The component stays on screen until the user clicks the close button.
|
|
84
|
+
|
|
85
|
+
##### Default Mode, When Mode Not Set
|
|
86
|
+
If no `mode` is provided, the default `mode` will be determined by the value of `variant` and whether the `toast` has a link or links present in `label` or `message`.
|
|
87
|
+
|
|
88
|
+
| Variant | Has link? | Default Mode |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `info` | Yes| `sticky`|
|
|
91
|
+
| `info` | No | `sticky`|
|
|
92
|
+
| `success` | Yes | `sticky`|
|
|
93
|
+
| `success` | No | `dismissible`|
|
|
94
|
+
| `warning` | Yes | `sticky`|
|
|
95
|
+
| `warning` | No | `sticky`|
|
|
96
|
+
| `error` | Yes | `sticky`|
|
|
97
|
+
| `error` | No | `sticky`|
|
|
98
|
+
|
|
99
|
+
#### Small screen / Mobile environment
|
|
100
|
+
|
|
101
|
+
`LightningToast` is implemented to be responsive according to the screen resolution. For smaller screen or mobile environments, the toast's **icon** and **description** (i.e. text stored in `message`, and `messageLinks`) will **not be shown** due to the screen's width limitation (see [Toast blueprint screen variants](https://www.lightningdesignsystem.com/guidelines/messaging/components/toasts/#flavor-variants-screen).
|
|
102
|
+
|
|
103
|
+
The best practice where small screen and mobile environments are the primary use case is to only provide links in the toast's title (ie `label` and `labelLinks`) in order to have links visible and interactive.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.fix-notify_toast_animation {
|
|
2
|
+
animation-name: fadeIn;
|
|
3
|
+
animation-duration: 0.4s;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@keyframes fadeIn {
|
|
7
|
+
0% {
|
|
8
|
+
opacity: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
100% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.fix-notify_toast_animation.closing {
|
|
17
|
+
animation-name: fadeOut;
|
|
18
|
+
animation-duration: 0.4s;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes fadeOut {
|
|
22
|
+
0% {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
100% {
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* TODO: change the following classes to the actual SLDS classes once W-12084169 is completed. */
|
|
32
|
+
.fix-slds-notify--mobile {
|
|
33
|
+
padding: 0.5rem 1rem 0.75rem;
|
|
34
|
+
min-width: 90%;
|
|
35
|
+
width: 90%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.fix-slds-notify--mobile.slds-notify_toast h2 {
|
|
39
|
+
font-size: 0.8125rem;
|
|
40
|
+
font-weight: 300;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* for screen smaller than 480px */
|
|
44
|
+
.fix-slds-notify--mobile .slds-notify__close {
|
|
45
|
+
top: 0.5rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* for mobile device */
|
|
49
|
+
.fix-slds-notify--mobile .slds-notify__close.fix-slds-notify--mobile__close {
|
|
50
|
+
top: -0.25rem;
|
|
51
|
+
right: -0.15rem;
|
|
52
|
+
}
|