lightning-base-components 1.18.1-alpha → 1.18.2-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 +5 -0
- package/package.json +43 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- 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/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/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 +82 -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/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/__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/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/button-icon-stateful.slds.css +215 -453
- package/src/lightning/buttonIconStateful/buttonIconStateful.css +2 -2
- 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/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 +15 -1
- package/src/lightning/calendar/calendar.slds.css +2048 -0
- 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/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/datepicker/datepicker.css +3 -0
- package/src/lightning/datepicker/datepicker.html +7 -4
- package/src/lightning/datepicker/datepicker.js +73 -19
- 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 +39 -35
- 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 +31 -6
- 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/linkify.js +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/icon.css +2 -2
- package/src/lightning/icon/icon.js +16 -2
- package/src/lightning/icon/icon.slds.css +29 -17
- package/src/lightning/icon/iconColors.js +1 -0
- 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-checkbox.slds.css +3 -12
- package/src/lightning/input/input-text.slds.css +239 -128
- package/src/lightning/input/input.css +2 -1
- package/src/lightning/input/input.html +8 -8
- package/src/lightning/input/input.js +107 -73
- 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/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/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 +18 -11
- package/src/lightning/progressStep/progressStep.js +10 -13
- package/src/lightning/radioGroup/radioGroup.css +2 -1
- package/src/lightning/radioGroup/radioGroup.js +4 -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/sldsCommon/sldsCommon.css +135 -75
- 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/tabset.html +5 -4
- package/src/lightning/tabset/tabset.js +29 -11
- 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 +18 -15
- package/src/lightning/timepicker/timepicker.slds.css +18 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +21 -19
- 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/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
|
@@ -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,7 @@ 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';
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
38
|
* Breakpoint when viewport height doesn't fit 10 items in the dropdown
|
|
@@ -44,7 +47,7 @@ const ARIA_LABEL = 'aria-label';
|
|
|
44
47
|
const ARIA_ACTIVEDESCENDANT = 'aria-activedescendant';
|
|
45
48
|
const ARIA_INVALID = 'aria-invalid';
|
|
46
49
|
|
|
47
|
-
export default class LightningBaseCombobox extends
|
|
50
|
+
export default class LightningBaseCombobox extends LightningShadowBaseClass {
|
|
48
51
|
static delegatesFocus = true;
|
|
49
52
|
|
|
50
53
|
/**
|
|
@@ -100,6 +103,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
100
103
|
constructor() {
|
|
101
104
|
super();
|
|
102
105
|
this._events = new BaseComboboxEvents(this);
|
|
106
|
+
this.ariaObserver = new AriaObserver(this);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
renderedCallback() {
|
|
@@ -111,10 +115,19 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
111
115
|
},
|
|
112
116
|
})
|
|
113
117
|
);
|
|
118
|
+
|
|
119
|
+
if (this.isConnected) {
|
|
120
|
+
this.ariaObserver.sync();
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
this.synchronizeA11y();
|
|
115
124
|
}
|
|
116
125
|
|
|
117
126
|
connectedCallback() {
|
|
127
|
+
super.connectedCallback();
|
|
128
|
+
if (!this.ariaObserver) {
|
|
129
|
+
this.ariaObserver = new AriaObserver(this);
|
|
130
|
+
}
|
|
118
131
|
this.overrideDropdownAlignment();
|
|
119
132
|
this.classList.add('slds-combobox_container');
|
|
120
133
|
this._connected = true;
|
|
@@ -124,6 +137,10 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
124
137
|
disconnectedCallback() {
|
|
125
138
|
this._connected = false;
|
|
126
139
|
this._listBoxElementCache = undefined;
|
|
140
|
+
if (this.ariaObserver) {
|
|
141
|
+
this.ariaObserver.disconnect();
|
|
142
|
+
this.ariaObserver = undefined;
|
|
143
|
+
}
|
|
127
144
|
}
|
|
128
145
|
|
|
129
146
|
@api
|
|
@@ -142,7 +159,37 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
142
159
|
|
|
143
160
|
set inputControlsElement(el) {
|
|
144
161
|
this._inputAriaControls = el;
|
|
145
|
-
this.
|
|
162
|
+
this.connectAriaControls();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
connectAriaControls() {
|
|
166
|
+
this.connectAriaAttribute({
|
|
167
|
+
attribute: ARIA_CONTROLS,
|
|
168
|
+
relatedNodeIds: this._inputAriaControls,
|
|
169
|
+
relatedNodes: this.dropdownElement,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
connectAriaAttribute(params) {
|
|
174
|
+
const relatedNodeIds = Array.isArray(params.relatedNodeIds)
|
|
175
|
+
? params.relatedNodeIds.map((el) => getRealDOMId(el)).join(' ')
|
|
176
|
+
: getRealDOMId(params.relatedNodeIds);
|
|
177
|
+
|
|
178
|
+
this.ariaObserver.connect({
|
|
179
|
+
...params,
|
|
180
|
+
targetSelector: INPUT_ELEMENT_SELECTOR,
|
|
181
|
+
relatedNodeIds,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@api
|
|
186
|
+
get ariaErrorMessageElements() {
|
|
187
|
+
return this._ariaErrorMessageElements;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
set ariaErrorMessageElements(elements) {
|
|
191
|
+
this._ariaErrorMessageElements = elements;
|
|
192
|
+
this.connectAriaDescribedByElements();
|
|
146
193
|
}
|
|
147
194
|
|
|
148
195
|
@api
|
|
@@ -151,13 +198,16 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
151
198
|
}
|
|
152
199
|
|
|
153
200
|
set inputDescribedByElements(elements) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this._inputDescribedBy = [elements];
|
|
158
|
-
}
|
|
201
|
+
this._inputDescribedBy = elements;
|
|
202
|
+
this.connectAriaDescribedByElements();
|
|
203
|
+
}
|
|
159
204
|
|
|
160
|
-
|
|
205
|
+
connectAriaDescribedByElements() {
|
|
206
|
+
this.connectAriaAttribute({
|
|
207
|
+
attribute: ARIA_DESCRIBEDBY,
|
|
208
|
+
relatedNodeIds: this._inputDescribedBy,
|
|
209
|
+
relatedNodes: this.ariaErrorMessageElements,
|
|
210
|
+
});
|
|
161
211
|
}
|
|
162
212
|
|
|
163
213
|
@api
|
|
@@ -165,31 +215,28 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
165
215
|
return this._inputLabelledBy;
|
|
166
216
|
}
|
|
167
217
|
|
|
168
|
-
set inputLabelledByElement(
|
|
169
|
-
this._inputLabelledBy =
|
|
170
|
-
|
|
218
|
+
set inputLabelledByElement(element) {
|
|
219
|
+
this._inputLabelledBy = element;
|
|
220
|
+
|
|
221
|
+
this.connectAriaAttribute({
|
|
222
|
+
attribute: ARIA_LABELLEDBY,
|
|
223
|
+
relatedNodeIds: element,
|
|
224
|
+
});
|
|
171
225
|
}
|
|
172
226
|
|
|
173
|
-
|
|
174
|
-
|
|
227
|
+
@api
|
|
228
|
+
get rootAriaNode() {
|
|
229
|
+
return this.ariaObserver.root;
|
|
175
230
|
}
|
|
176
231
|
|
|
177
|
-
|
|
178
|
-
|
|
232
|
+
set rootAriaNode(root) {
|
|
233
|
+
this.ariaObserver.root = root;
|
|
179
234
|
}
|
|
180
235
|
|
|
181
236
|
get inputId() {
|
|
182
237
|
return getRealDOMId(this.inputElement);
|
|
183
238
|
}
|
|
184
239
|
|
|
185
|
-
get computedAriaDescribedBy() {
|
|
186
|
-
const ariaValues = [];
|
|
187
|
-
this._inputDescribedBy.forEach((el) => {
|
|
188
|
-
ariaValues.push(getRealDOMId(el));
|
|
189
|
-
});
|
|
190
|
-
return normalizeAriaAttribute(ariaValues);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
240
|
@api
|
|
194
241
|
get dropdownHeight() {
|
|
195
242
|
return this._dropdownHeight;
|
|
@@ -228,7 +275,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
228
275
|
|
|
229
276
|
set disabled(value) {
|
|
230
277
|
this._disabled = normalizeBoolean(value);
|
|
231
|
-
|
|
278
|
+
reflectAttribute(this, 'disabled', this._disabled);
|
|
232
279
|
if (this._disabled && this._dropdownVisible) {
|
|
233
280
|
this.closeDropdown();
|
|
234
281
|
}
|
|
@@ -356,15 +403,16 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
356
403
|
return;
|
|
357
404
|
}
|
|
358
405
|
synchronizeAttrs(input, {
|
|
359
|
-
[ARIA_LABELLEDBY]: this.inputLabelledById,
|
|
360
|
-
[ARIA_DESCRIBEDBY]: this.computedAriaDescribedBy,
|
|
361
|
-
[ARIA_CONTROLS]: this.computedInputControls,
|
|
362
406
|
[ARIA_LABEL]: this.isUserInputDisabled
|
|
363
407
|
? this.computedButtonTriggerAriaLabel
|
|
364
408
|
: this.inputLabel,
|
|
365
409
|
[ARIA_INVALID]: this.computedAriaInvalid,
|
|
366
410
|
[ARIA_ACTIVEDESCENDANT]: this.computedAriaActiveDescendant,
|
|
367
411
|
});
|
|
412
|
+
|
|
413
|
+
if (this.isConnected) {
|
|
414
|
+
this.connectAriaControls();
|
|
415
|
+
}
|
|
368
416
|
}
|
|
369
417
|
|
|
370
418
|
itemId(index) {
|
|
@@ -525,20 +573,8 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
525
573
|
return this.inputId;
|
|
526
574
|
}
|
|
527
575
|
|
|
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);
|
|
576
|
+
get dropdownElement() {
|
|
577
|
+
return this.template.querySelector('[data-dropdown-element]');
|
|
542
578
|
}
|
|
543
579
|
|
|
544
580
|
get i18n() {
|
|
@@ -883,7 +919,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
883
919
|
}
|
|
884
920
|
|
|
885
921
|
get inputElement() {
|
|
886
|
-
return this.template.querySelector(
|
|
922
|
+
return this.template.querySelector(INPUT_ELEMENT_SELECTOR);
|
|
887
923
|
}
|
|
888
924
|
|
|
889
925
|
// remove-next-line-for-c-namespace
|
|
@@ -897,7 +933,7 @@ export default class LightningBaseCombobox extends LightningElement {
|
|
|
897
933
|
}
|
|
898
934
|
|
|
899
935
|
this._autoPosition.start({
|
|
900
|
-
target: () => this.
|
|
936
|
+
target: () => this.template.querySelector("[part~='input-text']"),
|
|
901
937
|
element: () => this.template.querySelector('div.slds-dropdown'),
|
|
902
938
|
align: {
|
|
903
939
|
horizontal: Direction.Left,
|