lightning-base-components 1.18.1-alpha → 1.18.3-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 +9 -0
- package/package.json +57 -1
- package/src/lightning/accordion/__docs__/accordion.md +2 -2
- package/src/lightning/accordion/accordion.css +12 -0
- package/src/lightning/accordion/accordion.html +3 -1
- package/src/lightning/accordion/accordion.js +4 -2
- package/src/lightning/accordion/accordion.slds.css +671 -0
- package/src/lightning/accordionSection/accordion-section.slds.css +647 -0
- package/src/lightning/accordionSection/accordionSection.css +14 -0
- package/src/lightning/accordionSection/accordionSection.html +23 -19
- package/src/lightning/accordionSection/accordionSection.js +29 -2
- package/src/lightning/ariaObserver/__docs__/ariaObserver.md +21 -9
- package/src/lightning/ariaObserver/ariaObserver.js +185 -154
- package/src/lightning/ariaObserver/polyfill.js +639 -0
- package/src/lightning/avatar/__docs__/avatar.md +7 -7
- package/src/lightning/avatar/avatar.css +2 -0
- package/src/lightning/avatar/avatar.html +2 -0
- package/src/lightning/avatar/avatar.js +18 -15
- package/src/lightning/avatar/avatar.slds.css +272 -0
- package/src/lightning/badge/__docs__/badge.md +2 -2
- package/src/lightning/baseCombobox/base-combobox.slds.css +1585 -0
- package/src/lightning/baseCombobox/baseCombobox.css +11 -1
- package/src/lightning/baseCombobox/baseCombobox.html +154 -146
- package/src/lightning/baseCombobox/baseCombobox.js +122 -46
- package/src/lightning/baseCombobox/spinner.slds.css +438 -0
- package/src/lightning/baseComboboxItem/baseComboboxItem.js +4 -2
- package/src/lightning/baseComboboxItem/inline.css +2 -0
- package/src/lightning/breadcrumb/breadcrumb.css +2 -2
- package/src/lightning/breadcrumb/breadcrumb.js +4 -2
- package/src/lightning/breadcrumb/breadcrumb.slds.css +2 -7
- package/src/lightning/breadcrumbs/__docs__/breadcrumbs.md +3 -3
- package/src/lightning/breadcrumbs/breadcrumbs.css +2 -2
- package/src/lightning/breadcrumbs/breadcrumbs.js +3 -2
- package/src/lightning/breadcrumbs/breadcrumbs.slds.css +7 -1
- package/src/lightning/button/__docs__/button.md +15 -15
- package/src/lightning/button/__examples__/inverse/inverse.css +8 -0
- package/src/lightning/button/__examples__/inverse/inverse.html +3 -2
- package/src/lightning/button/button.css +2 -0
- package/src/lightning/button/button.html +4 -2
- package/src/lightning/button/button.js +21 -0
- package/src/lightning/button/button.slds.css +527 -0
- package/src/lightning/buttonGroup/buttonGroup.css +2 -2
- package/src/lightning/buttonGroup/buttonGroup.js +3 -2
- package/src/lightning/buttonIcon/__docs__/buttonIcon.md +9 -9
- package/src/lightning/buttonIcon/button-icon.slds.css +215 -453
- package/src/lightning/buttonIcon/buttonIcon.css +2 -2
- package/src/lightning/buttonIcon/buttonIcon.js +4 -0
- package/src/lightning/buttonIconStateful/__docs__/buttonIconStateful.md +9 -9
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +215 -453
- package/src/lightning/buttonIconStateful/buttonIconStateful.css +2 -2
- package/src/lightning/buttonMenu/__docs__/buttonMenu.md +8 -8
- package/src/lightning/buttonMenu/{dropdown.slds.css → button-menu.slds.css} +853 -217
- package/src/lightning/buttonMenu/buttonMenu.css +2 -2
- package/src/lightning/buttonMenu/buttonMenu.html +2 -2
- package/src/lightning/buttonMenu/buttonMenu.js +10 -14
- package/src/lightning/buttonStateful/__docs__/buttonStateful.md +12 -12
- package/src/lightning/buttonStateful/button-stateful.slds.css +225 -457
- package/src/lightning/buttonStateful/buttonStateful.css +2 -2
- package/src/lightning/buttonStateful/buttonStateful.js +3 -2
- package/src/lightning/calendar/__examples__/basic/basic.html +7 -0
- package/src/lightning/calendar/__examples__/basic/basic.js +3 -0
- package/src/lightning/calendar/calendar.css +3 -0
- package/src/lightning/calendar/calendar.html +12 -9
- package/src/lightning/calendar/calendar.js +18 -2
- package/src/lightning/calendar/calendar.slds.css +2048 -0
- package/src/lightning/card/__docs__/card.md +3 -3
- package/src/lightning/card/card.css +2 -2
- package/src/lightning/card/card.js +3 -2
- package/src/lightning/card/card.slds.css +141 -88
- package/src/lightning/checkboxGroup/__docs__/checkboxGroup.md +2 -2
- package/src/lightning/colorPickerCustom/colorPickerCustom.css +2 -2
- package/src/lightning/colorPickerCustom/colorPickerCustom.js +3 -2
- package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +11 -38
- package/src/lightning/colorPickerPanel/colorPickerPanel.css +3 -2
- package/src/lightning/colorPickerPanel/colorPickerPanel.js +4 -2
- package/src/lightning/colorPickerPanel/popover.slds.css +121 -0
- package/src/lightning/combobox/combobox.css +4 -0
- package/src/lightning/combobox/combobox.html +31 -29
- package/src/lightning/combobox/combobox.js +21 -4
- package/src/lightning/combobox/combobox.slds.css +13 -0
- package/src/lightning/combobox/form-element.slds.css +281 -0
- package/src/lightning/configProvider/defaultConfig.js +2 -1
- package/src/lightning/datatable/__docs__/datatable.md +45 -35
- package/src/lightning/datatable/autoWidthStrategy.js +3 -0
- package/src/lightning/datatable/columnWidthManager.js +1 -1
- package/src/lightning/datatable/datatable.js +8 -7
- package/src/lightning/datatable/rowSelection.js +7 -4
- package/src/lightning/datatable/templates/table/table.html +1 -0
- package/src/lightning/datepicker/datepicker.css +3 -0
- package/src/lightning/datepicker/datepicker.html +7 -4
- package/src/lightning/datepicker/datepicker.js +76 -20
- package/src/lightning/datepicker/form-element.slds.css +281 -0
- package/src/lightning/datepicker/input-text.slds.css +398 -0
- package/src/lightning/datetimepicker/datetimepicker.css +3 -0
- package/src/lightning/datetimepicker/datetimepicker.html +9 -3
- package/src/lightning/datetimepicker/datetimepicker.js +42 -36
- package/src/lightning/datetimepicker/form-element.slds.css +281 -0
- package/src/lightning/datetimepicker/input-text.slds.css +398 -0
- package/src/lightning/dualListbox/dualListbox.css +2 -2
- package/src/lightning/dualListbox/dualListbox.html +3 -3
- package/src/lightning/dualListbox/dualListbox.js +47 -13
- package/src/lightning/dualListbox/form-element.slds.css +83 -34
- package/src/lightning/dualListbox/keyboard.js +20 -1
- package/src/lightning/dynamicIcon/dynamicIcon.js +3 -2
- package/src/lightning/dynamicIcon/ellie.css +1 -1
- package/src/lightning/dynamicIcon/eq.css +1 -1
- package/src/lightning/dynamicIcon/score.css +1 -1
- package/src/lightning/dynamicIcon/strength.css +1 -1
- package/src/lightning/dynamicIcon/trend.css +1 -1
- package/src/lightning/dynamicIcon/waffle.css +1 -1
- package/src/lightning/formattedRichText/formatted-rich-text.slds.css +230 -0
- package/src/lightning/formattedRichText/formattedRichText.css +2 -0
- package/src/lightning/formattedRichText/formattedRichText.js +4 -2
- package/src/lightning/formattedRichText/linkify.js +2 -2
- package/src/lightning/formattedText/formattedText.css +1 -0
- package/src/lightning/formattedText/formattedText.js +3 -2
- package/src/lightning/helptext/__docs__/helptext.md +2 -2
- package/src/lightning/helptext/form-element.slds.css +83 -34
- package/src/lightning/helptext/help-text.slds.css +215 -453
- package/src/lightning/helptext/helptext.css +2 -2
- package/src/lightning/helptext/helptext.js +3 -2
- package/src/lightning/i18nCldrOptions/README.md +5 -0
- package/src/lightning/i18nService/README.md +5 -0
- package/src/lightning/icon/__docs__/icon.md +5 -5
- package/src/lightning/icon/icon.css +2 -2
- package/src/lightning/icon/icon.js +21 -2
- package/src/lightning/icon/icon.slds.css +29 -17
- package/src/lightning/icon/iconColors.js +1 -0
- package/src/lightning/iconUtils/iconUtils.js +0 -12
- package/src/lightning/iconUtils/polyfill.js +5 -90
- package/src/lightning/input/__docs__/input.md +7 -7
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.css +6 -0
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.html +2 -1
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.js +1 -1
- package/src/lightning/input/__examples__/number/number.html +0 -5
- package/src/lightning/input/__examples__/text/text.html +0 -1
- package/src/lightning/input/form-element.slds.css +281 -0
- package/src/lightning/input/input.css +2 -3
- package/src/lightning/input/input.html +154 -244
- package/src/lightning/input/input.js +306 -595
- package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -3
- package/src/lightning/inputUtils/inputUtils.js +15 -20
- package/src/lightning/inputUtils/normalize.js +7 -0
- package/src/lightning/{input/numberUtil.js → inputUtils/number.js} +1 -1
- package/src/lightning/inputUtils/utils.js +18 -0
- package/src/lightning/internationalizationLibrary/README.md +24 -0
- package/src/lightning/internationalizationLibrary/utils.js +4 -1
- package/src/lightning/layout/__docs__/layout.md +1 -1
- package/src/lightning/layout/__examples__/simple/simple.css +1 -1
- package/src/lightning/layout/layout.css +5 -1
- package/src/lightning/layout/layout.js +4 -2
- package/src/lightning/layoutItem/__examples__/alignmentBump/alignmentBump.css +1 -1
- package/src/lightning/layoutItem/__examples__/sizePerDevice/sizePerDevice.css +0 -1
- package/src/lightning/layoutItem/layoutItem.css +5 -0
- package/src/lightning/layoutItem/layoutItem.js +4 -2
- package/src/lightning/menuDivider/menu-divider.slds.css +15 -0
- package/src/lightning/menuDivider/menuDivider.css +3 -0
- package/src/lightning/menuDivider/menuDivider.html +1 -1
- package/src/lightning/menuDivider/menuDivider.js +4 -2
- package/src/lightning/menuItem/menu-item.slds.css +140 -0
- package/src/lightning/menuItem/menuItem.css +3 -0
- package/src/lightning/menuItem/menuItem.html +43 -41
- package/src/lightning/menuItem/menuItem.js +4 -4
- package/src/lightning/menuSubheader/menu-subheader.slds.css +22 -0
- package/src/lightning/menuSubheader/menuSubheader.css +3 -0
- package/src/lightning/menuSubheader/menuSubheader.html +3 -1
- package/src/lightning/menuSubheader/menuSubheader.js +4 -6
- package/src/lightning/modal/__docs__/modal.md +3 -1
- package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +267 -0
- package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +1165 -0
- package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +131 -0
- package/src/lightning/modal/modal.js +1 -1
- package/src/lightning/modalBody/__docs__/modalBody.md +9 -9
- package/src/lightning/modalFooter/__docs__/modalFooter.md +9 -9
- package/src/lightning/modalHeader/__docs__/modalHeader.md +9 -9
- package/src/lightning/overlayContainer/overlayContainer.js +4 -2
- package/src/lightning/pill/__docs__/pill.md +3 -3
- package/src/lightning/pill/avatar.slds.css +272 -0
- package/src/lightning/pill/link.css +3 -0
- package/src/lightning/pill/link.html +1 -1
- package/src/lightning/pill/pill.js +29 -9
- package/src/lightning/pill/pill.slds.css +168 -0
- package/src/lightning/pill/plain.css +3 -0
- package/src/lightning/pill/plain.html +1 -1
- package/src/lightning/pill/plainLink.css +3 -0
- package/src/lightning/pill/plainLink.html +1 -1
- package/src/lightning/pillContainer/__docs__/pillContainer.md +14 -14
- package/src/lightning/pillContainer/barePillContainer.css +3 -0
- package/src/lightning/pillContainer/barePillContainer.html +1 -2
- package/src/lightning/pillContainer/listbox.slds.css +267 -0
- package/src/lightning/pillContainer/pill-container.slds.css +22 -0
- package/src/lightning/pillContainer/pill.slds.css +168 -0
- package/src/lightning/pillContainer/pillContainer.js +7 -3
- package/src/lightning/pillContainer/standardPillContainer.css +4 -0
- package/src/lightning/pillContainer/standardPillContainer.html +2 -2
- package/src/lightning/popup/popover.slds.css +119 -119
- package/src/lightning/popup/popup.css +1 -2
- package/src/lightning/popup/popup.js +3 -2
- package/src/lightning/positionLibrary/elementProxy.js +7 -2
- package/src/lightning/positionLibrary/util.js +8 -0
- package/src/lightning/primitiveBubble/primitiveBubble.css +2 -2
- package/src/lightning/primitiveBubble/primitiveBubble.js +4 -2
- package/src/lightning/primitiveButton/primitiveButton.js +5 -4
- package/src/lightning/primitiveCellFactory/cellWithStandardLayout.html +29 -21
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -0
- package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +31 -19
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.css +2 -2
- package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +5 -3
- package/src/lightning/primitiveIcon/icon.slds.css +209 -0
- package/src/lightning/primitiveIcon/primitiveIcon.css +2 -1
- package/src/lightning/primitiveIcon/primitiveIcon.html +1 -1
- package/src/lightning/primitiveIcon/primitiveIcon.js +26 -16
- package/src/lightning/progressStep/progressStep.js +10 -13
- package/src/lightning/radioGroup/__docs__/radioGroup.md +4 -4
- package/src/lightning/radioGroup/radioGroup.css +2 -1
- package/src/lightning/radioGroup/radioGroup.js +4 -2
- package/src/lightning/select/__docs__/select.md +2 -2
- package/src/lightning/select/form-element.slds.css +83 -34
- package/src/lightning/select/select.css +2 -2
- package/src/lightning/select/select.js +4 -2
- package/src/lightning/select/select.slds.css +86 -34
- package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +1 -1
- package/src/lightning/sldsCommon/sldsCommon.css +251 -89
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +10 -0
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.css +18 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +24 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.css +20 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +259 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +8 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.css +57 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +313 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +308 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +18 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +1408 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +295 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.css +14 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.js-meta.xml +4 -0
- package/src/lightning/slider/__docs__/slider.md +2 -2
- package/src/lightning/spinner/spinner.css +2 -2
- package/src/lightning/spinner/spinner.js +4 -2
- package/src/lightning/tabBar/tab-bar.slds.css +334 -0
- package/src/lightning/tabBar/tabBar.css +2 -0
- package/src/lightning/tabBar/tabBar.html +4 -3
- package/src/lightning/tabBar/tabBar.js +30 -3
- package/src/lightning/tabset/__docs__/tabset.md +2 -2
- package/src/lightning/tabset/tabset.html +5 -4
- package/src/lightning/tabset/tabset.js +29 -11
- package/src/lightning/textarea/__docs__/textarea.md +2 -2
- package/src/lightning/timepicker/form-element.slds.css +281 -0
- package/src/lightning/timepicker/timepicker.css +3 -0
- package/src/lightning/timepicker/timepicker.html +5 -1
- package/src/lightning/timepicker/timepicker.js +22 -17
- package/src/lightning/timepicker/timepicker.slds.css +18 -0
- package/src/lightning/toast/toast.js-meta.xml +2 -0
- package/src/lightning/toastContainer/__docs__/toastContainer.md +14 -34
- package/src/lightning/toastContainer/toastContainer.js +10 -15
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +32 -23
- package/src/lightning/utilsPrivate/browser.js +5 -3
- package/src/lightning/utilsPrivate/os.js +6 -4
- package/src/lightning/utilsPrivate/ssr.js +4 -0
- package/src/lightning/utilsPrivate/utilsPrivate.js +2 -0
- package/src/lightning/verticalNavigation/verticalNavigation.css +2 -1
- package/src/lightning/verticalNavigation/verticalNavigation.js +3 -2
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.css +2 -1
- package/src/lightning/verticalNavigationSection/verticalNavigationSection.js +3 -2
- package/src/lightning/accordion/__perf__DISABLED/accordion-perf-utils.js +0 -76
- package/src/lightning/accordion/__perf__DISABLED/accordion10Multiple25SectionEach.perf.js +0 -57
- package/src/lightning/accordion/__perf__DISABLED/accordion10Simple25SectionEach.perf.js +0 -37
- package/src/lightning/accordion/__perf__DISABLED/accordionMultiple50Section.perf.js +0 -45
- package/src/lightning/accordion/__perf__DISABLED/accordionSimple50Section.perf.js +0 -35
- package/src/lightning/accordion/__perf__DISABLED/container/container.html +0 -15
- package/src/lightning/accordion/__perf__DISABLED/container/container.js +0 -7
- package/src/lightning/iconUtils/isIframeInEdge.js +0 -7
- package/src/lightning/iconUtils/supportsSvg.js +0 -16
- package/src/lightning/input/input-checkbox.slds.css +0 -404
- package/src/lightning/input/input-text.slds.css +0 -287
- package/src/lightning/input/normalize.js +0 -6
- package/src/lightning/input/selection.js +0 -131
- package/src/lightning/positionLibrary/__component__/positionLibraryBounding.spec.js +0 -319
- package/src/lightning/positionLibrary/__component__/x/bounding/bounding.css +0 -16
- package/src/lightning/positionLibrary/__component__/x/bounding/bounding.html +0 -36
- package/src/lightning/positionLibrary/__component__/x/bounding/bounding.js +0 -122
- /package/src/lightning/{baseCombobox → baseComboboxItem}/listbox.slds.css +0 -0
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.html +0 -0
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.js +0 -0
- /package/src/lightning/{input/emailUtil.js → inputUtils/email.js} +0 -0
|
@@ -421,8 +421,8 @@ export default class LightningDatatable extends LightningElement {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Required for better performance.
|
|
425
|
-
*
|
|
424
|
+
* Required for better performance. Associates each row with a unique ID.
|
|
425
|
+
* key-field is case sensitive and must match the value you provide in the data array.
|
|
426
426
|
* @type {string}
|
|
427
427
|
* @required
|
|
428
428
|
*/
|
|
@@ -471,7 +471,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
|
-
* The maximum number of rows that can be selected.
|
|
474
|
+
* The maximum number of rows that can be selected. Value should be a positive integer
|
|
475
475
|
* Checkboxes are used for selection by default,
|
|
476
476
|
* and radio buttons are used when maxRowSelection is 1.
|
|
477
477
|
* @type {number}
|
|
@@ -792,11 +792,12 @@ export default class LightningDatatable extends LightningElement {
|
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
get computedTableStyle() {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
795
|
+
const tableLayout =
|
|
796
|
+
this._columnWidthManager.isAutoResizingUpdateQueued()
|
|
797
|
+
? 'auto'
|
|
798
|
+
: 'fixed';
|
|
798
799
|
return styleToString([
|
|
799
|
-
|
|
800
|
+
`table-layout:${tableLayout}`,
|
|
800
801
|
getCSSWidthStyleOfTable(this.widthsData),
|
|
801
802
|
]);
|
|
802
803
|
}
|
|
@@ -616,10 +616,13 @@ export function setMaxRowSelection(state, value) {
|
|
|
616
616
|
}
|
|
617
617
|
} else {
|
|
618
618
|
state.maxRowSelection = MAX_ROW_SELECTION_DEFAULT;
|
|
619
|
-
//
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
// suppress console error if no value is passed in
|
|
620
|
+
if (value !== null && value !== undefined) {
|
|
621
|
+
// eslint-disable-next-line no-console
|
|
622
|
+
console.error(
|
|
623
|
+
`The maxRowSelection value passed into lightning:datatable should be a positive integer. We receive instead (${value}).`
|
|
624
|
+
);
|
|
625
|
+
}
|
|
623
626
|
}
|
|
624
627
|
}
|
|
625
628
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="slds-dropdown-trigger slds-dropdown-trigger_click slds-size_1-of-1" role="group">
|
|
2
|
+
<div class="slds-dropdown-trigger slds-dropdown-trigger_click slds-size_1-of-1" role="group" part="input-text">
|
|
3
3
|
<template if:false={hasExternalLabel}>
|
|
4
|
-
<label class={computedLabelClass} for="input">
|
|
4
|
+
<label class={computedLabelClass} for="input" part="label">
|
|
5
5
|
<template if:true={required}>
|
|
6
6
|
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
7
7
|
</template>
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
<template if:true={isRangeMessageVisible}>
|
|
13
13
|
<span id="range-message" data-range-message class="slds-assistive-text">{rangeMessage}</span>
|
|
14
14
|
</template>
|
|
15
|
-
<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
|
|
15
|
+
<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right" part="input-container">
|
|
16
16
|
<input type="text" id="input" class="slds-input"
|
|
17
|
+
part="input"
|
|
17
18
|
name={name}
|
|
18
19
|
value={displayValue}
|
|
19
20
|
placeholder={placeholder}
|
|
@@ -55,7 +56,9 @@
|
|
|
55
56
|
</div>
|
|
56
57
|
</div>
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
<template if:true={errorMessage}>
|
|
59
60
|
<div id="error-message" data-error-message class={computedClass} aria-live="assertive">{errorMessage}</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
60
63
|
|
|
61
64
|
</template>
|
|
@@ -7,7 +7,8 @@ import labelMinAndMaxRangeMessage from '@salesforce/label/LightningDateTimePicke
|
|
|
7
7
|
import labelRequired from '@salesforce/label/LightningControl.required';
|
|
8
8
|
import labelSelectDateFor from '@salesforce/label/LightningDateTimePicker.selectDateFor';
|
|
9
9
|
import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helptextAlternativeText';
|
|
10
|
-
import {
|
|
10
|
+
import { api, track } from 'lwc';
|
|
11
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
11
12
|
import {
|
|
12
13
|
normalizeISODate,
|
|
13
14
|
parseFormattedDate,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
getRealDOMId,
|
|
28
29
|
isIE11,
|
|
29
30
|
computeAriaInvalid,
|
|
31
|
+
reflectAttribute,
|
|
30
32
|
} from 'lightning/utilsPrivate';
|
|
31
33
|
import {
|
|
32
34
|
generateUniqueId,
|
|
@@ -37,6 +39,7 @@ import {
|
|
|
37
39
|
handleKeyDownOnDatePickerIcon,
|
|
38
40
|
handleBasicKeyDownBehaviour,
|
|
39
41
|
} from './keyboard';
|
|
42
|
+
import AriaObserver from 'lightning/ariaObserver';
|
|
40
43
|
|
|
41
44
|
const i18n = {
|
|
42
45
|
invalidDate: labelInvalidDate,
|
|
@@ -61,7 +64,7 @@ const DATE_STYLE = {
|
|
|
61
64
|
LONG: 'long',
|
|
62
65
|
};
|
|
63
66
|
|
|
64
|
-
export default class LightningDatePicker extends
|
|
67
|
+
export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
65
68
|
static delegatesFocus = true;
|
|
66
69
|
|
|
67
70
|
@track _disabled = false;
|
|
@@ -94,6 +97,15 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
94
97
|
|
|
95
98
|
@api messageWhenValueMissing;
|
|
96
99
|
|
|
100
|
+
@api
|
|
101
|
+
get rootAriaNode() {
|
|
102
|
+
return this.ariaObserver.root;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
set rootAriaNode(root) {
|
|
106
|
+
this.ariaObserver.root = root;
|
|
107
|
+
}
|
|
108
|
+
|
|
97
109
|
@api
|
|
98
110
|
get min() {
|
|
99
111
|
return this._min;
|
|
@@ -181,7 +193,12 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
181
193
|
|
|
182
194
|
set ariaLabelledByElement(el) {
|
|
183
195
|
this._ariaLabelledBy = el;
|
|
184
|
-
|
|
196
|
+
|
|
197
|
+
this.ariaObserver.connect({
|
|
198
|
+
attribute: ARIA_LABELLEDBY,
|
|
199
|
+
targetSelector: 'input',
|
|
200
|
+
relatedNodeIds: getRealDOMId(this._ariaLabelledBy),
|
|
201
|
+
});
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
@api
|
|
@@ -191,7 +208,12 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
191
208
|
|
|
192
209
|
set ariaControlsElement(el) {
|
|
193
210
|
this._ariaControls = el;
|
|
194
|
-
|
|
211
|
+
|
|
212
|
+
this.ariaObserver.connect({
|
|
213
|
+
attribute: ARIA_CONTROLS,
|
|
214
|
+
targetSelector: 'input',
|
|
215
|
+
relatedNodeIds: getRealDOMId(this.ariaControlsElement),
|
|
216
|
+
});
|
|
195
217
|
}
|
|
196
218
|
|
|
197
219
|
@api
|
|
@@ -205,7 +227,7 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
205
227
|
} else {
|
|
206
228
|
this._ariaDescribedBy = [el];
|
|
207
229
|
}
|
|
208
|
-
this.
|
|
230
|
+
this.connectAriaDescribedBy();
|
|
209
231
|
}
|
|
210
232
|
|
|
211
233
|
@api
|
|
@@ -213,12 +235,14 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
213
235
|
return this._ariaDescribedBy;
|
|
214
236
|
}
|
|
215
237
|
|
|
216
|
-
|
|
217
|
-
|
|
238
|
+
@api
|
|
239
|
+
get ariaErrorMessageElement() {
|
|
240
|
+
return this._ariaErrorMessageElement;
|
|
218
241
|
}
|
|
219
242
|
|
|
220
|
-
|
|
221
|
-
|
|
243
|
+
set ariaErrorMessageElement(element) {
|
|
244
|
+
this._ariaErrorMessageElement = element;
|
|
245
|
+
this.connectAriaDescribedBy();
|
|
222
246
|
}
|
|
223
247
|
|
|
224
248
|
synchronizeA11y() {
|
|
@@ -228,9 +252,6 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
228
252
|
}
|
|
229
253
|
|
|
230
254
|
synchronizeAttrs(input, {
|
|
231
|
-
[ARIA_LABELLEDBY]: this.ariaLabelledbyId,
|
|
232
|
-
[ARIA_DESCRIBEDBY]: this.computedAriaDescribedby,
|
|
233
|
-
[ARIA_CONTROLS]: this.ariaControlsId,
|
|
234
255
|
[ARIA_LABEL]: this._ariaLabel,
|
|
235
256
|
[ARIA_INVALID]: this.computedAriaInvalid,
|
|
236
257
|
});
|
|
@@ -242,6 +263,11 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
242
263
|
);
|
|
243
264
|
calendarButton.ariaDescribedBy =
|
|
244
265
|
this.computedDatepickerButtonAriaDescribedby;
|
|
266
|
+
|
|
267
|
+
if (this.isConnected) {
|
|
268
|
+
this.connectAriaDescribedBy();
|
|
269
|
+
this.ariaObserver.sync();
|
|
270
|
+
}
|
|
245
271
|
}
|
|
246
272
|
|
|
247
273
|
renderedCallback() {
|
|
@@ -265,6 +291,7 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
265
291
|
}
|
|
266
292
|
set disabled(value) {
|
|
267
293
|
this._disabled = normalizeBoolean(value);
|
|
294
|
+
reflectAttribute(this, 'disabled', this._disabled);
|
|
268
295
|
}
|
|
269
296
|
|
|
270
297
|
@api
|
|
@@ -273,6 +300,7 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
273
300
|
}
|
|
274
301
|
set readOnly(value) {
|
|
275
302
|
this._readonly = normalizeBoolean(value);
|
|
303
|
+
reflectAttribute(this, 'readonly', this._readonly);
|
|
276
304
|
}
|
|
277
305
|
|
|
278
306
|
@api
|
|
@@ -299,6 +327,7 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
299
327
|
|
|
300
328
|
set variant(value) {
|
|
301
329
|
this._variant = normalizeVariant(value);
|
|
330
|
+
reflectAttribute(this, 'variant', value);
|
|
302
331
|
}
|
|
303
332
|
|
|
304
333
|
@api
|
|
@@ -349,9 +378,11 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
349
378
|
constructor() {
|
|
350
379
|
super();
|
|
351
380
|
this.uniqueId = generateUniqueId();
|
|
381
|
+
this.ariaObserver = new AriaObserver(this);
|
|
352
382
|
}
|
|
353
383
|
|
|
354
384
|
connectedCallback() {
|
|
385
|
+
super.connectedCallback();
|
|
355
386
|
this.connected = true;
|
|
356
387
|
|
|
357
388
|
this.keyboardInterface = this.datepickerKeyboardInterface();
|
|
@@ -359,6 +390,10 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
359
390
|
|
|
360
391
|
disconnectedCallback() {
|
|
361
392
|
this.connected = false;
|
|
393
|
+
if (this.ariaObserver) {
|
|
394
|
+
this.ariaObserver.disconnect();
|
|
395
|
+
this.ariaObserver = undefined;
|
|
396
|
+
}
|
|
362
397
|
}
|
|
363
398
|
|
|
364
399
|
get i18n() {
|
|
@@ -375,9 +410,12 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
375
410
|
.toString();
|
|
376
411
|
}
|
|
377
412
|
|
|
378
|
-
get
|
|
379
|
-
|
|
380
|
-
|
|
413
|
+
get errorMessageElement() {
|
|
414
|
+
return this.template.querySelector('[data-error-message]');
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
get rangeMessageElement() {
|
|
418
|
+
return this.template.querySelector('[data-range-message]');
|
|
381
419
|
}
|
|
382
420
|
|
|
383
421
|
get computedUniqueRangeMessageElementId() {
|
|
@@ -410,18 +448,24 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
410
448
|
return this.disabled || this.readOnly;
|
|
411
449
|
}
|
|
412
450
|
|
|
413
|
-
get
|
|
414
|
-
const
|
|
451
|
+
get ariaErrorMessageElements() {
|
|
452
|
+
const elements = [this.ariaErrorMessageElement];
|
|
415
453
|
|
|
416
454
|
if (this.errorMessage) {
|
|
417
|
-
|
|
455
|
+
elements.push(this.errorMessageElement);
|
|
418
456
|
}
|
|
419
457
|
|
|
420
458
|
// To inform user of valid date ranges that are set via min/max attributes
|
|
421
459
|
if (this.isRangeMessageVisible) {
|
|
422
|
-
|
|
460
|
+
elements.push(this.rangeMessageElement);
|
|
423
461
|
}
|
|
424
462
|
|
|
463
|
+
return elements;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
get computedAriaDescribedby() {
|
|
467
|
+
const ariaValues = [];
|
|
468
|
+
|
|
425
469
|
this._ariaDescribedBy.forEach((item) => {
|
|
426
470
|
const id = getRealDOMId(item);
|
|
427
471
|
if (id) {
|
|
@@ -432,6 +476,15 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
432
476
|
return normalizeAriaAttribute(ariaValues);
|
|
433
477
|
}
|
|
434
478
|
|
|
479
|
+
connectAriaDescribedBy() {
|
|
480
|
+
this.ariaObserver.connect({
|
|
481
|
+
attribute: ARIA_DESCRIBEDBY,
|
|
482
|
+
targetSelector: 'input',
|
|
483
|
+
relatedNodeIds: this.computedAriaDescribedby,
|
|
484
|
+
relatedNodes: this.ariaErrorMessageElements,
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
|
|
435
488
|
get computedDatepickerButtonAriaDescribedby() {
|
|
436
489
|
if (this.isRangeMessageVisible) {
|
|
437
490
|
return this.computedUniqueRangeMessageElementId;
|
|
@@ -604,7 +657,10 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
604
657
|
startPositioning() {
|
|
605
658
|
if (!this._relationship) {
|
|
606
659
|
this._relationship = startPositioning(this, {
|
|
607
|
-
target: () =>
|
|
660
|
+
target: () =>
|
|
661
|
+
this.template.querySelector(
|
|
662
|
+
'div.slds-form-element__control'
|
|
663
|
+
),
|
|
608
664
|
element: () =>
|
|
609
665
|
this.template
|
|
610
666
|
.querySelector('lightning-calendar')
|
|
@@ -0,0 +1,281 @@
|
|
|
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
|
+
/* TODO: Swap with utility classes */
|
|
6
|
+
:host([data-render-mode="shadow"]) fieldset {
|
|
7
|
+
border: 0;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* FORM ELEMENT: BASE */
|
|
13
|
+
:host([data-render-mode="shadow"]) .slds-form-element {
|
|
14
|
+
position: relative;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label {
|
|
19
|
+
overflow-wrap: break-word;
|
|
20
|
+
word-wrap: break-word;
|
|
21
|
+
hyphens: auto;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
color: var(--sds-g-color-neutral-base-30, #444444);
|
|
24
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
25
|
+
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
26
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
27
|
+
margin-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([data-render-mode="shadow"]) .slds-form-element__label:empty {
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([data-render-mode="shadow"]) .slds-form-element__control {
|
|
35
|
+
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 */
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
position: relative;
|
|
42
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
43
|
+
vertical-align: top;
|
|
44
|
+
line-height: var(--sds-g-font-lineheight-1, 1);
|
|
45
|
+
z-index: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([data-render-mode="shadow"]) .slds-form-element__icon .slds-button_icon {
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([data-render-mode="shadow"]) .slds-form-element__help,:host([data-render-mode="shadow"])
|
|
53
|
+
.slds-form-element__helper {
|
|
54
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
55
|
+
margin-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([data-render-mode="shadow"]) .slds-form-element_edit .slds-form-element__static {
|
|
60
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly {
|
|
64
|
+
flex-basis: 0%;
|
|
65
|
+
border-bottom: var(--sds-g-sizing-border-1, 1px) solid var(--sds-g-color-neutral-base-90, #e5e5e5);
|
|
66
|
+
margin-block-end: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__control {
|
|
70
|
+
padding-block-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
71
|
+
padding-block-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([data-render-mode="shadow"]) .slds-form-element_readonly .slds-form-element__label {
|
|
75
|
+
margin-block-end: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([data-render-mode="shadow"]) .slds-form-element__legend {
|
|
79
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
80
|
+
float: left;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([data-render-mode="shadow"]) .slds-form-element__addon {
|
|
84
|
+
display: inline-block;
|
|
85
|
+
margin-block-start: 0;
|
|
86
|
+
margin-block-end: 0;
|
|
87
|
+
margin-inline-start: var(--sds-g-spacing-2, 0.5rem);
|
|
88
|
+
margin-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
89
|
+
align-self: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static {
|
|
93
|
+
overflow-wrap: break-word;
|
|
94
|
+
word-wrap: break-word;
|
|
95
|
+
word-break: break-word;
|
|
96
|
+
display: inline-block;
|
|
97
|
+
font-size: var(--sds-g-font-scale-neg-1, 0.875rem);
|
|
98
|
+
font-weight: var(--sds-g-font-weight-4, 400);
|
|
99
|
+
color: var(--sds-g-color-neutral-base-10, #181818);
|
|
100
|
+
width: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static.slds-text-longform *:last-child {
|
|
104
|
+
margin-block-end: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static:empty {
|
|
108
|
+
min-height: calc(var(--sds-g-sizing-6, 1.25rem) + 1px);
|
|
109
|
+
vertical-align: bottom;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([data-render-mode="shadow"]) .slds-form-element__static--edit {
|
|
113
|
+
width: calc(100% - var(--sds-g-sizing-7, 1.5rem));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([data-render-mode="shadow"]) .slds-required {
|
|
117
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
118
|
+
margin-block-start: 0;
|
|
119
|
+
margin-block-end: 0;
|
|
120
|
+
margin-inline-start: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
121
|
+
margin-inline-end: calc(var(--sds-g-spacing-1, 0.25rem) / 2);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([data-render-mode="shadow"]) .slds-has-error .slds-form-element__help {
|
|
125
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([data-render-mode="shadow"][invalid]) .slds-form-element__help {
|
|
129
|
+
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* --------------------------------------- */
|
|
133
|
+
|
|
134
|
+
/* FORM ELEMENT: STACKED */
|
|
135
|
+
|
|
136
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) {
|
|
137
|
+
display: block;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* TODO: Using `:not` is currently not working, and it could break the build because of issues with the dist script */
|
|
141
|
+
|
|
142
|
+
/* :host([variant~='label-stacked']):not(.slds-form-element_readonly) {
|
|
143
|
+
margin-block-end: var(--sds-g-spacing-2);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host([variant~='label-stacked']):not(.slds-is-editing) {
|
|
147
|
+
padding: 0 var(--sds-g-spacing-1);
|
|
148
|
+
} */
|
|
149
|
+
|
|
150
|
+
/* :host([variant~='label-stacked']):not([class*="slds-size"]) {
|
|
151
|
+
width: 100%;
|
|
152
|
+
flex-basis: 100%;
|
|
153
|
+
} */
|
|
154
|
+
|
|
155
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element {
|
|
156
|
+
padding: 0;
|
|
157
|
+
margin-block-end: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__label,:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
161
|
+
border-bottom: 0; /* Remove border when using legacy version of slds-form-element */
|
|
162
|
+
padding-inline-start: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__control {
|
|
166
|
+
width: 100%;
|
|
167
|
+
flex-basis: 100%;
|
|
168
|
+
clear: left;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:host([data-render-mode="shadow"][variant~='label-stacked']) .slds-form-element__icon {
|
|
172
|
+
float: none;
|
|
173
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* --------------------------------------- */
|
|
177
|
+
|
|
178
|
+
/* FORM ELEMENT: INLINE */
|
|
179
|
+
|
|
180
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) {
|
|
181
|
+
display: block;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/*
|
|
185
|
+
we have to combine with slds class here to avoid duplication
|
|
186
|
+
of this rule in child elements who import this stylesheet
|
|
187
|
+
in lighting-input this slds class is synonymous with the variant
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
:host([data-render-mode="shadow"][variant~='label-inline'].slds-form-element_horizontal) {
|
|
191
|
+
padding: var(--sds-g-spacing-1, 0.25rem);
|
|
192
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* TODO: Using `:not` is currently not working, and it could break the build because of issues with the dist script */
|
|
196
|
+
|
|
197
|
+
/* :host([variant~='label-inline']):not(.slds-form-element_readonly) {
|
|
198
|
+
margin-block-end: var(--sds-g-spacing-2);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
:host([variant~='label-inline']):not([class*="slds-size"]) {
|
|
202
|
+
width: 100%;
|
|
203
|
+
flex-basis: 100%;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:host([variant~='label-inline']:not(.slds-is-editing)) {
|
|
207
|
+
padding: var(--sds-g-spacing-1);
|
|
208
|
+
} */
|
|
209
|
+
|
|
210
|
+
:host([data-render-mode="shadow"][variant~='label-inline']).slds-is-edited {
|
|
211
|
+
padding-block-start: var(--sds-g-sizing-6, 1.25rem)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (min-width: 48em) {
|
|
215
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__label {
|
|
216
|
+
float: left;
|
|
217
|
+
max-width: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Removing icon width for when the help-text icon is present */
|
|
218
|
+
flex-basis: calc(33% - var(--sds-g-sizing-6, 1.25rem)); /* Some form element controls are set to display:flex */
|
|
219
|
+
flex-grow: 1; /* For IE and Safari which didn't auto expand to the available space */
|
|
220
|
+
margin-block-end: 0;
|
|
221
|
+
position: relative;
|
|
222
|
+
z-index: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) lightning-helptext {
|
|
226
|
+
float: left;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control {
|
|
230
|
+
margin-inline-start: 33%;
|
|
231
|
+
clear: none; /* Reset clear: left when switching to horizontal form layout */
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__control .slds-form-element__control {
|
|
235
|
+
padding-inline-start: 0; /* Remove left padding on nested form controls, due to issues related to lightning-form components */
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list__column .slds-form-element__label {
|
|
239
|
+
width: auto;
|
|
240
|
+
max-width: 100%;
|
|
241
|
+
-ms-flex-preferred-size: auto;
|
|
242
|
+
flex-basis: auto;
|
|
243
|
+
float: none;
|
|
244
|
+
position: relative;
|
|
245
|
+
padding-inline-start: 0;
|
|
246
|
+
margin-block-end: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-form-element__help {
|
|
250
|
+
margin-inline-start: 33%;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) .slds-dueling-list {
|
|
254
|
+
clear: none;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* --------------------------------------- */
|
|
259
|
+
|
|
260
|
+
/* FORM ELEMENT: COMPOUND */
|
|
261
|
+
|
|
262
|
+
:host([data-render-mode="shadow"]) .slds-form-element_compound .slds-form-element__row {
|
|
263
|
+
display: flex;
|
|
264
|
+
margin-bottom: var(--sds-g-spacing-1, 0.25rem);
|
|
265
|
+
margin-left: calc(var(--sds-g-spacing-1, 0.25rem) * -1);
|
|
266
|
+
margin-right: calc(var(--sds-g-spacing-1, 0.25rem) * -1);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:host([data-render-mode="shadow"]) .slds-form-element_compound .slds-form-element__row .slds-form-element__label {
|
|
270
|
+
padding-top: 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:host([data-render-mode="shadow"]) .slds-form-element_compound .slds-form-element {
|
|
274
|
+
padding-left: var(--sds-g-spacing-1, 0.25rem);
|
|
275
|
+
padding-right: var(--sds-g-spacing-1, 0.25rem);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
:host([data-render-mode="shadow"]) .slds-form-element_address .slds-form-element__row {
|
|
279
|
+
align-items: flex-end;
|
|
280
|
+
}
|
|
281
|
+
}
|