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
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
@import 'lightning/sldsCommon';
|
|
2
|
+
@import './base-combobox.slds.css';
|
|
3
|
+
@import './spinner.slds.css';
|
|
4
|
+
|
|
1
5
|
.slds-inline-logo {
|
|
2
6
|
height: 1rem;
|
|
3
7
|
margin-top: 1rem;
|
|
@@ -5,6 +9,12 @@
|
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
/* This is hiding the caret of the input for the read-only combobox, should be moved to SLDS. */
|
|
8
|
-
input[aria-readonly=
|
|
12
|
+
input[aria-readonly='true'] {
|
|
9
13
|
caret-color: transparent;
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
/* TODO: This is a temporary fix to prevent a bug with sldsCommon.css bleeding into synthetic */
|
|
17
|
+
button:disabled,
|
|
18
|
+
[type='button']:disabled {
|
|
19
|
+
cursor: not-allowed;
|
|
20
|
+
}
|
|
@@ -1,161 +1,169 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class=
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class={computedInputClass}
|
|
44
|
-
aria-expanded={computedAriaExpanded}
|
|
45
|
-
aria-haspopup="listbox"
|
|
46
|
-
name={name}
|
|
47
|
-
role="combobox"
|
|
48
|
-
data-value={computedInputValue}
|
|
49
|
-
disabled={disabled}
|
|
50
|
-
aria-label={computedButtonTriggerAriaLabel}
|
|
51
|
-
aria-required={required}
|
|
52
|
-
onfocus={handleFocus}
|
|
53
|
-
onkeydown={handleInputKeyDown}
|
|
54
|
-
onblur={handleBlur}>
|
|
55
|
-
<span class="slds-truncate">
|
|
56
|
-
<template if:true={computedInputValue}>
|
|
57
|
-
{computedInputValue}
|
|
58
|
-
</template>
|
|
59
|
-
<template if:false={computedInputValue}>
|
|
60
|
-
{computedPlaceholder}
|
|
61
|
-
</template>
|
|
62
|
-
</span>
|
|
63
|
-
</button>
|
|
64
|
-
</template>
|
|
65
|
-
<template if:true={isCloseVisible}>
|
|
66
|
-
<div class="slds-input__icon-group slds-input__icon-group_right">
|
|
67
|
-
<button onclick={handlePillRemove} type="button"
|
|
68
|
-
class="slds-button slds-button_icon slds-input__icon slds-input__icon_right"
|
|
69
|
-
title={i18n.pillCloseButtonAlternativeText}>
|
|
70
|
-
<lightning-primitive-icon icon-name="utility:close" variant="bare" svg-class="slds-button__icon"></lightning-primitive-icon>
|
|
71
|
-
<span class="slds-assistive-text">{i18n.pillCloseButtonAlternativeText}</span>
|
|
72
|
-
</button>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
<template if:false={hasInputPill}>
|
|
76
|
-
<div class="slds-input__icon-group slds-input__icon-group_right">
|
|
77
|
-
<template if:true={showInputActivityIndicator}>
|
|
78
|
-
<div class="slds-spinner slds-spinner_brand slds-spinner_x-small slds-input__spinner">
|
|
79
|
-
<span class="slds-assistive-text">{i18n.loadingText}</span>
|
|
80
|
-
<div class="slds-spinner__dot-a"></div>
|
|
81
|
-
<div class="slds-spinner__dot-b"></div>
|
|
2
|
+
<div class="slds-combobox_container">
|
|
3
|
+
<div class={computedDropdownTriggerClass}
|
|
4
|
+
onclick={handleTriggerClick}>
|
|
5
|
+
<div class={computedFormElementClass} role="none">
|
|
6
|
+
<template if:true={hasInputPill}>
|
|
7
|
+
<lightning-icon icon-name={inputPill.iconName} alternative-text={inputPill.iconAlternativeText} size="x-small" class="slds-icon_container slds-combobox__input-entity-icon"></lightning-icon>
|
|
8
|
+
</template>
|
|
9
|
+
<!--
|
|
10
|
+
'required' on the input may present hints from the browser when within a form that doesn't have novalidate set,
|
|
11
|
+
specifically it may be problematic for cases when a selection has already been made say via pills and then the validation hint
|
|
12
|
+
is no longer correct/relevant
|
|
13
|
+
-->
|
|
14
|
+
<template if:false={isUserInputDisabled}>
|
|
15
|
+
<div part="input-text">
|
|
16
|
+
<div part="input-container">
|
|
17
|
+
<input id="combobox-input"
|
|
18
|
+
class={computedInputClass}
|
|
19
|
+
type="text"
|
|
20
|
+
role="combobox"
|
|
21
|
+
aria-expanded={computedAriaExpanded}
|
|
22
|
+
aria-haspopup="listbox"
|
|
23
|
+
required={required}
|
|
24
|
+
readonly={_inputAriaReadOnly}
|
|
25
|
+
autocomplete={autocomplete}
|
|
26
|
+
value={computedInputValue}
|
|
27
|
+
data-value={computedInputValue}
|
|
28
|
+
name={name}
|
|
29
|
+
placeholder={computedPlaceholder}
|
|
30
|
+
maxlength={inputMaxlength}
|
|
31
|
+
disabled={disabled}
|
|
32
|
+
aria-readonly={_inputAriaReadOnly}
|
|
33
|
+
aria-autocomplete={computedAriaAutocomplete}
|
|
34
|
+
aria-owns="dropdown-element"
|
|
35
|
+
aria-label={inputLabel}
|
|
36
|
+
onfocus={handleFocus}
|
|
37
|
+
onselect={handleInputSelect}
|
|
38
|
+
onchange={handleTextChange}
|
|
39
|
+
oninput={handleInput}
|
|
40
|
+
onkeydown={handleInputKeyDown}
|
|
41
|
+
onblur={handleBlur}
|
|
42
|
+
part="input">
|
|
82
43
|
</div>
|
|
83
|
-
</
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<template if:false={item.items}>
|
|
104
|
-
<lightning-base-combobox-item
|
|
105
|
-
role="option"
|
|
106
|
-
item={item}
|
|
107
|
-
id={item.id}
|
|
108
|
-
data-item-id={item.id}
|
|
109
|
-
aria-checked={item.checked}
|
|
110
|
-
key={item.value}
|
|
111
|
-
data-value={item.value}
|
|
112
|
-
onmouseenter={handleOptionMouseEnter}
|
|
113
|
-
class="slds-media slds-listbox__option slds-media_center">
|
|
114
|
-
</lightning-base-combobox-item>
|
|
115
|
-
</template>
|
|
116
|
-
<template if:true={item.items}>
|
|
117
|
-
<ul role="group" aria-label={item.label} key={item.label}>
|
|
118
|
-
<template if:true={item.label}>
|
|
119
|
-
<li role="presentation" class="slds-listbox__item">
|
|
120
|
-
<div class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="presentation">
|
|
121
|
-
<h3 role="presentation" title={item.label}>{item.label}</h3>
|
|
122
|
-
</div>
|
|
123
|
-
</li>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template if:true={isUserInputDisabled}>
|
|
47
|
+
<button id="combobox-button"
|
|
48
|
+
type="button"
|
|
49
|
+
class={computedInputClass}
|
|
50
|
+
aria-expanded={computedAriaExpanded}
|
|
51
|
+
aria-haspopup="listbox"
|
|
52
|
+
name={name}
|
|
53
|
+
role="combobox"
|
|
54
|
+
data-value={computedInputValue}
|
|
55
|
+
disabled={disabled}
|
|
56
|
+
aria-label={computedButtonTriggerAriaLabel}
|
|
57
|
+
aria-required={required}
|
|
58
|
+
onfocus={handleFocus}
|
|
59
|
+
onkeydown={handleInputKeyDown}
|
|
60
|
+
onblur={handleBlur}>
|
|
61
|
+
<span class="slds-truncate">
|
|
62
|
+
<template if:true={computedInputValue}>
|
|
63
|
+
{computedInputValue}
|
|
124
64
|
</template>
|
|
125
|
-
<template
|
|
126
|
-
|
|
127
|
-
<lightning-base-combobox-item
|
|
128
|
-
role="option"
|
|
129
|
-
item={groupItem}
|
|
130
|
-
id={groupItem.id}
|
|
131
|
-
data-item-id={groupItem.id}
|
|
132
|
-
aria-checked={groupItem.checked}
|
|
133
|
-
data-value={groupItem.value}
|
|
134
|
-
class="slds-media slds-listbox__option slds-media_center"
|
|
135
|
-
onmouseenter={handleOptionMouseEnter}>
|
|
136
|
-
</lightning-base-combobox-item>
|
|
137
|
-
</li>
|
|
65
|
+
<template if:false={computedInputValue}>
|
|
66
|
+
{computedPlaceholder}
|
|
138
67
|
</template>
|
|
139
|
-
</
|
|
140
|
-
</
|
|
68
|
+
</span>
|
|
69
|
+
</button>
|
|
70
|
+
</template>
|
|
71
|
+
<template if:true={isCloseVisible}>
|
|
72
|
+
<div class="slds-input__icon-group slds-input__icon-group_right">
|
|
73
|
+
<button onclick={handlePillRemove} type="button"
|
|
74
|
+
class="slds-button slds-button_icon slds-input__icon slds-input__icon_right"
|
|
75
|
+
title={i18n.pillCloseButtonAlternativeText}>
|
|
76
|
+
<lightning-primitive-icon icon-name="utility:close" variant="bare" svg-class="slds-button__icon"></lightning-primitive-icon>
|
|
77
|
+
<span class="slds-assistive-text">{i18n.pillCloseButtonAlternativeText}</span>
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
141
80
|
</template>
|
|
142
|
-
<template if:
|
|
143
|
-
<div
|
|
144
|
-
<
|
|
145
|
-
<div role="status" class="slds-spinner slds-spinner_x-small slds-
|
|
81
|
+
<template if:false={hasInputPill}>
|
|
82
|
+
<div class="slds-input__icon-group slds-input__icon-group_right">
|
|
83
|
+
<template if:true={showInputActivityIndicator}>
|
|
84
|
+
<div role="status" class="slds-spinner slds-spinner_brand slds-spinner_x-small slds-input__spinner">
|
|
146
85
|
<span class="slds-assistive-text">{i18n.loadingText}</span>
|
|
147
86
|
<div class="slds-spinner__dot-a"></div>
|
|
148
87
|
<div class="slds-spinner__dot-b"></div>
|
|
149
88
|
</div>
|
|
150
|
-
</
|
|
89
|
+
</template>
|
|
90
|
+
<template if:true={inputIconName}>
|
|
91
|
+
<lightning-icon alternative-text={inputIconAlternativeText} icon-name={inputIconName} size={inputIconSize} class="slds-input__icon slds-input__icon_right"></lightning-icon>
|
|
92
|
+
</template>
|
|
151
93
|
</div>
|
|
152
94
|
</template>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div id="dropdown-element"
|
|
98
|
+
data-dropdown-element
|
|
99
|
+
class={computedDropdownClass}
|
|
100
|
+
role="listbox"
|
|
101
|
+
onscroll={handleListboxScroll}
|
|
102
|
+
onmousedown={handleDropdownMouseDown}
|
|
103
|
+
onmouseup={handleDropdownMouseUp}
|
|
104
|
+
onmouseleave={handleDropdownMouseLeave}
|
|
105
|
+
onclick={handleOptionClick}
|
|
106
|
+
part="dropdown overlay"
|
|
107
|
+
>
|
|
108
|
+
<template if:true={_hasDropdownOpened}>
|
|
109
|
+
<template for:each={_items} for:item="item">
|
|
110
|
+
<template if:false={item.items}>
|
|
111
|
+
<lightning-base-combobox-item
|
|
112
|
+
role="option"
|
|
113
|
+
item={item}
|
|
114
|
+
id={item.id}
|
|
115
|
+
data-item-id={item.id}
|
|
116
|
+
aria-checked={item.checked}
|
|
117
|
+
key={item.value}
|
|
118
|
+
data-value={item.value}
|
|
119
|
+
onmouseenter={handleOptionMouseEnter}
|
|
120
|
+
class="slds-media slds-listbox__option slds-media_center">
|
|
121
|
+
</lightning-base-combobox-item>
|
|
122
|
+
</template>
|
|
123
|
+
<template if:true={item.items}>
|
|
124
|
+
<ul role="group" aria-label={item.label} key={item.label}>
|
|
125
|
+
<template if:true={item.label}>
|
|
126
|
+
<li role="presentation" class="slds-listbox__item">
|
|
127
|
+
<div class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="presentation">
|
|
128
|
+
<h3 role="presentation" title={item.label}>{item.label}</h3>
|
|
129
|
+
</div>
|
|
130
|
+
</li>
|
|
131
|
+
</template>
|
|
132
|
+
<template for:each={item.items} for:item="groupItem">
|
|
133
|
+
<li role="presentation" class="slds-listbox__item" key={groupItem.value}>
|
|
134
|
+
<lightning-base-combobox-item
|
|
135
|
+
role="option"
|
|
136
|
+
item={groupItem}
|
|
137
|
+
id={groupItem.id}
|
|
138
|
+
data-item-id={groupItem.id}
|
|
139
|
+
aria-checked={groupItem.checked}
|
|
140
|
+
data-value={groupItem.value}
|
|
141
|
+
class="slds-media slds-listbox__option slds-media_center"
|
|
142
|
+
onmouseenter={handleOptionMouseEnter}>
|
|
143
|
+
</lightning-base-combobox-item>
|
|
144
|
+
</li>
|
|
145
|
+
</template>
|
|
146
|
+
</ul>
|
|
147
|
+
</template>
|
|
148
|
+
</template>
|
|
149
|
+
<template if:true={showDropdownActivityIndicator}>
|
|
150
|
+
<div role="presentation" class="slds-listbox__item">
|
|
151
|
+
<div class="slds-align_absolute-center slds-p-top_medium">
|
|
152
|
+
<div role="status" class="slds-spinner slds-spinner_x-small slds-spinner_inline">
|
|
153
|
+
<span class="slds-assistive-text">{i18n.loadingText}</span>
|
|
154
|
+
<div class="slds-spinner__dot-a"></div>
|
|
155
|
+
<div class="slds-spinner__dot-b"></div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
160
|
+
<template if:true={showAttribution}>
|
|
161
|
+
<div class="slds-align_absolute-center">
|
|
162
|
+
<img src={attributionLogoUrl} class="slds-inline-logo" alt={attributionLogoAssistiveText} title={attributionLogoAssistiveText}/>
|
|
163
|
+
</div>
|
|
164
|
+
</template>
|
|
157
165
|
</template>
|
|
158
|
-
</
|
|
166
|
+
</div>
|
|
159
167
|
</div>
|
|
160
168
|
</div>
|
|
161
169
|
|
|
@@ -3,22 +3,24 @@ import labelDeselectOptionKeyboard from '@salesforce/label/LightningCombobox.des
|
|
|
3
3
|
import labelLoadingText from '@salesforce/label/LightningCombobox.loadingText';
|
|
4
4
|
import labelPillCloseButtonAlternativeText from '@salesforce/label/LightningCombobox.pillCloseButtonAlternativeText';
|
|
5
5
|
import labelPlaceholder from '@salesforce/label/LightningCombobox.placeholder';
|
|
6
|
-
import { api,
|
|
6
|
+
import { api, track } from 'lwc';
|
|
7
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
7
8
|
import { handleKeyDownOnInput } from './keyboard';
|
|
8
9
|
import { BaseComboboxEvents } from './baseComboboxEvents';
|
|
9
10
|
import { classSet } from 'lightning/utils';
|
|
10
11
|
import {
|
|
11
12
|
assert,
|
|
13
|
+
computeAriaInvalid,
|
|
12
14
|
getRealDOMId,
|
|
13
|
-
normalizeAriaAttribute,
|
|
14
15
|
normalizeBoolean,
|
|
15
16
|
normalizeString,
|
|
17
|
+
reflectAttribute,
|
|
16
18
|
synchronizeAttrs,
|
|
17
|
-
computeAriaInvalid,
|
|
18
19
|
} from 'lightning/utilsPrivate';
|
|
19
20
|
// remove-next-line-for-c-namespace
|
|
20
21
|
import { AutoPosition, Direction } from 'lightning/positionLibrary';
|
|
21
22
|
import { VARIANT } from 'lightning/inputUtils';
|
|
23
|
+
import AriaObserver from 'lightning/ariaObserver';
|
|
22
24
|
|
|
23
25
|
const i18n = {
|
|
24
26
|
ariaSelectedOptions: labelAriaSelectedOptions,
|
|
@@ -30,6 +32,9 @@ const i18n = {
|
|
|
30
32
|
|
|
31
33
|
const SMALL_MIN_HEIGHT = '2.25rem';
|
|
32
34
|
const MEDIUM_MIN_HEIGHT = '6.75rem';
|
|
35
|
+
const INPUT_ELEMENT_SELECTOR = '.slds-combobox__input';
|
|
36
|
+
const INPUT_PART_ELEMENT_SELECTOR = '[part~="input-text"]';
|
|
37
|
+
const FAUX_INPUT_BUTTON_ELEMENT_SELECTOR = `${INPUT_ELEMENT_SELECTOR}.slds-input_faux`;
|
|
33
38
|
|
|
34
39
|
/**
|
|
35
40
|
* Breakpoint when viewport height doesn't fit 10 items in the dropdown
|
|
@@ -44,7 +49,7 @@ const ARIA_LABEL = 'aria-label';
|
|
|
44
49
|
const ARIA_ACTIVEDESCENDANT = 'aria-activedescendant';
|
|
45
50
|
const ARIA_INVALID = 'aria-invalid';
|
|
46
51
|
|
|
47
|
-
export default class LightningBaseCombobox extends
|
|
52
|
+
export default class LightningBaseCombobox extends LightningShadowBaseClass {
|
|
48
53
|
static delegatesFocus = true;
|
|
49
54
|
|
|
50
55
|
/**
|
|
@@ -96,10 +101,13 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
96
101
|
originDisableDefaultHighlight;
|
|
97
102
|
privateDisableDefaultHighlight;
|
|
98
103
|
_editingMode = false;
|
|
104
|
+
_connected = false;
|
|
105
|
+
ariaObserver = null;
|
|
99
106
|
|
|
100
107
|
constructor() {
|
|
101
108
|
super();
|
|
102
109
|
this._events = new BaseComboboxEvents(this);
|
|
110
|
+
this.setupAriaObserverIfAbsent();
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
renderedCallback() {
|
|
@@ -111,10 +119,13 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
111
119
|
},
|
|
112
120
|
})
|
|
113
121
|
);
|
|
122
|
+
this.syncAriaObserver();
|
|
114
123
|
this.synchronizeA11y();
|
|
115
124
|
}
|
|
116
125
|
|
|
117
126
|
connectedCallback() {
|
|
127
|
+
super.connectedCallback();
|
|
128
|
+
this.setupAriaObserverIfAbsent();
|
|
118
129
|
this.overrideDropdownAlignment();
|
|
119
130
|
this.classList.add('slds-combobox_container');
|
|
120
131
|
this._connected = true;
|
|
@@ -124,6 +135,20 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
124
135
|
disconnectedCallback() {
|
|
125
136
|
this._connected = false;
|
|
126
137
|
this._listBoxElementCache = undefined;
|
|
138
|
+
this.removeAriaObserver();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
setupAriaObserverIfAbsent() {
|
|
142
|
+
if (!this.ariaObserver) {
|
|
143
|
+
this.ariaObserver = new AriaObserver(this);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
removeAriaObserver() {
|
|
148
|
+
if (this.ariaObserver && this.ariaObserver.disconnect) {
|
|
149
|
+
this.ariaObserver.disconnect();
|
|
150
|
+
this.ariaObserver = null;
|
|
151
|
+
}
|
|
127
152
|
}
|
|
128
153
|
|
|
129
154
|
@api
|
|
@@ -142,7 +167,49 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
142
167
|
|
|
143
168
|
set inputControlsElement(el) {
|
|
144
169
|
this._inputAriaControls = el;
|
|
145
|
-
this.
|
|
170
|
+
this.connectAriaControls();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
syncAriaObserver() {
|
|
174
|
+
this.setupAriaObserverIfAbsent();
|
|
175
|
+
const ariaObserverSyncExists =
|
|
176
|
+
this.ariaObserver && this.ariaObserver.sync;
|
|
177
|
+
if (this.isConnected && ariaObserverSyncExists) {
|
|
178
|
+
this.ariaObserver.sync();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
connectAriaControls() {
|
|
183
|
+
this.connectAriaAttribute({
|
|
184
|
+
attribute: ARIA_CONTROLS,
|
|
185
|
+
relatedNodeIds: this._inputAriaControls,
|
|
186
|
+
relatedNodes: this.dropdownElement,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
connectAriaAttribute(params) {
|
|
191
|
+
this.setupAriaObserverIfAbsent();
|
|
192
|
+
if (this.ariaObserver && this.ariaObserver.connect) {
|
|
193
|
+
const relatedNodeIds = Array.isArray(params.relatedNodeIds)
|
|
194
|
+
? params.relatedNodeIds.map((el) => getRealDOMId(el)).join(' ')
|
|
195
|
+
: getRealDOMId(params.relatedNodeIds);
|
|
196
|
+
|
|
197
|
+
this.ariaObserver.connect({
|
|
198
|
+
...params,
|
|
199
|
+
targetSelector: INPUT_ELEMENT_SELECTOR,
|
|
200
|
+
relatedNodeIds,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@api
|
|
206
|
+
get ariaErrorMessageElements() {
|
|
207
|
+
return this._ariaErrorMessageElements;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
set ariaErrorMessageElements(elements) {
|
|
211
|
+
this._ariaErrorMessageElements = elements;
|
|
212
|
+
this.connectAriaDescribedByElements();
|
|
146
213
|
}
|
|
147
214
|
|
|
148
215
|
@api
|
|
@@ -151,13 +218,16 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
151
218
|
}
|
|
152
219
|
|
|
153
220
|
set inputDescribedByElements(elements) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this._inputDescribedBy = [elements];
|
|
158
|
-
}
|
|
221
|
+
this._inputDescribedBy = elements;
|
|
222
|
+
this.connectAriaDescribedByElements();
|
|
223
|
+
}
|
|
159
224
|
|
|
160
|
-
|
|
225
|
+
connectAriaDescribedByElements() {
|
|
226
|
+
this.connectAriaAttribute({
|
|
227
|
+
attribute: ARIA_DESCRIBEDBY,
|
|
228
|
+
relatedNodeIds: this._inputDescribedBy,
|
|
229
|
+
relatedNodes: this.ariaErrorMessageElements,
|
|
230
|
+
});
|
|
161
231
|
}
|
|
162
232
|
|
|
163
233
|
@api
|
|
@@ -165,31 +235,31 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
165
235
|
return this._inputLabelledBy;
|
|
166
236
|
}
|
|
167
237
|
|
|
168
|
-
set inputLabelledByElement(
|
|
169
|
-
this._inputLabelledBy =
|
|
170
|
-
|
|
238
|
+
set inputLabelledByElement(element) {
|
|
239
|
+
this._inputLabelledBy = element;
|
|
240
|
+
|
|
241
|
+
this.connectAriaAttribute({
|
|
242
|
+
attribute: ARIA_LABELLEDBY,
|
|
243
|
+
relatedNodeIds: element,
|
|
244
|
+
});
|
|
171
245
|
}
|
|
172
246
|
|
|
173
|
-
|
|
174
|
-
|
|
247
|
+
@api
|
|
248
|
+
get rootAriaNode() {
|
|
249
|
+
return this.ariaObserver.root;
|
|
175
250
|
}
|
|
176
251
|
|
|
177
|
-
|
|
178
|
-
|
|
252
|
+
set rootAriaNode(root) {
|
|
253
|
+
this.setupAriaObserverIfAbsent();
|
|
254
|
+
if (this.ariaObserver) {
|
|
255
|
+
this.ariaObserver.root = root;
|
|
256
|
+
}
|
|
179
257
|
}
|
|
180
258
|
|
|
181
259
|
get inputId() {
|
|
182
260
|
return getRealDOMId(this.inputElement);
|
|
183
261
|
}
|
|
184
262
|
|
|
185
|
-
get computedAriaDescribedBy() {
|
|
186
|
-
const ariaValues = [];
|
|
187
|
-
this._inputDescribedBy.forEach((el) => {
|
|
188
|
-
ariaValues.push(getRealDOMId(el));
|
|
189
|
-
});
|
|
190
|
-
return normalizeAriaAttribute(ariaValues);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
263
|
@api
|
|
194
264
|
get dropdownHeight() {
|
|
195
265
|
return this._dropdownHeight;
|
|
@@ -228,7 +298,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
228
298
|
|
|
229
299
|
set disabled(value) {
|
|
230
300
|
this._disabled = normalizeBoolean(value);
|
|
231
|
-
|
|
301
|
+
reflectAttribute(this, 'disabled', this._disabled);
|
|
232
302
|
if (this._disabled && this._dropdownVisible) {
|
|
233
303
|
this.closeDropdown();
|
|
234
304
|
}
|
|
@@ -356,15 +426,16 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
356
426
|
return;
|
|
357
427
|
}
|
|
358
428
|
synchronizeAttrs(input, {
|
|
359
|
-
[ARIA_LABELLEDBY]: this.inputLabelledById,
|
|
360
|
-
[ARIA_DESCRIBEDBY]: this.computedAriaDescribedBy,
|
|
361
|
-
[ARIA_CONTROLS]: this.computedInputControls,
|
|
362
429
|
[ARIA_LABEL]: this.isUserInputDisabled
|
|
363
430
|
? this.computedButtonTriggerAriaLabel
|
|
364
431
|
: this.inputLabel,
|
|
365
432
|
[ARIA_INVALID]: this.computedAriaInvalid,
|
|
366
433
|
[ARIA_ACTIVEDESCENDANT]: this.computedAriaActiveDescendant,
|
|
367
434
|
});
|
|
435
|
+
|
|
436
|
+
if (this.isConnected) {
|
|
437
|
+
this.connectAriaControls();
|
|
438
|
+
}
|
|
368
439
|
}
|
|
369
440
|
|
|
370
441
|
itemId(index) {
|
|
@@ -525,20 +596,8 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
525
596
|
return this.inputId;
|
|
526
597
|
}
|
|
527
598
|
|
|
528
|
-
get
|
|
529
|
-
return
|
|
530
|
-
this.template.querySelector('[data-dropdown-element]')
|
|
531
|
-
);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
get computedInputControls() {
|
|
535
|
-
const ariaValues = [this.computedUniqueDropdownElementId];
|
|
536
|
-
|
|
537
|
-
if (this.inputControlsElement) {
|
|
538
|
-
ariaValues.push(this.inputAriaControlsId);
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
return normalizeAriaAttribute(ariaValues);
|
|
599
|
+
get dropdownElement() {
|
|
600
|
+
return this.template.querySelector('[data-dropdown-element]');
|
|
542
601
|
}
|
|
543
602
|
|
|
544
603
|
get i18n() {
|
|
@@ -883,7 +942,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
883
942
|
}
|
|
884
943
|
|
|
885
944
|
get inputElement() {
|
|
886
|
-
return this.template.querySelector(
|
|
945
|
+
return this.template.querySelector(INPUT_ELEMENT_SELECTOR);
|
|
887
946
|
}
|
|
888
947
|
|
|
889
948
|
// remove-next-line-for-c-namespace
|
|
@@ -896,8 +955,25 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
896
955
|
this._autoPosition = new AutoPosition(this);
|
|
897
956
|
}
|
|
898
957
|
|
|
958
|
+
// when using dropdown-alignment='auto' positioning and standard variant lighting-combobox
|
|
959
|
+
// the selector for 'target' is determined by this.isUserInputDisabled
|
|
960
|
+
// when TRUE the target is a BUTTON element acting as a faux / fake INPUT element
|
|
961
|
+
// when FALSE the target is an INPUT element
|
|
962
|
+
// NOTE: isUserInputDisabled is NOT determined by combobox.disabled
|
|
963
|
+
// instead isUserInputDisabled is determined by
|
|
964
|
+
// this.isStandardVariant && !this.isAutocompleteEnabled (which is an internal variable)
|
|
965
|
+
// this means that the INPUT is often NOT present, and instead a BUTTON is
|
|
966
|
+
// this selector for .start({ target }) is used to
|
|
967
|
+
// position the element from so this.isUserInputDisabled
|
|
968
|
+
// must be taken into account so the proper selector can be used
|
|
969
|
+
// the 'element' below is always the same without IF/ELSE, so there
|
|
970
|
+
// is not a need to switch between selectors
|
|
971
|
+
const selectorToUse = this.isUserInputDisabled
|
|
972
|
+
? FAUX_INPUT_BUTTON_ELEMENT_SELECTOR
|
|
973
|
+
: INPUT_PART_ELEMENT_SELECTOR;
|
|
974
|
+
|
|
899
975
|
this._autoPosition.start({
|
|
900
|
-
target: () => this.
|
|
976
|
+
target: () => this.template.querySelector(selectorToUse),
|
|
901
977
|
element: () => this.template.querySelector('div.slds-dropdown'),
|
|
902
978
|
align: {
|
|
903
979
|
horizontal: Direction.Left,
|