lightning-base-components 1.17.7-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/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
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
2
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
3
|
+
|
|
4
|
+
/* The Input Control Container holds the `start` and `end` slot contents, as well as the input control itself */
|
|
5
|
+
|
|
6
|
+
:host([data-render-mode="shadow"]) [part~='input-container'] {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
min-height: var(--sds-c-inputtext-sizing-height);
|
|
11
|
+
padding-inline-end: var(--sds-c-inputtext-spacing-inline-end, var(--sds-c-inputtext-spacing-inline));
|
|
12
|
+
padding-inline-start: var(--sds-c-inputtext-spacing-inline-start, var(--sds-c-inputtext-spacing-inline));
|
|
13
|
+
background-color: var(--sds-c-inputtext-color-background, var(--sds-g-color-neutral-base-1));
|
|
14
|
+
border-width: var(--sds-c-inputtext-sizing-border, var(--sds-g-sizing-border-1, 1px));
|
|
15
|
+
border-style: solid;
|
|
16
|
+
border-color: var(--sds-c-inputtext-color-border, var(--sds-g-color-neutral-base-contrast-3));
|
|
17
|
+
border-radius: var(--sds-c-inputtext-radius-border);
|
|
18
|
+
box-shadow: var(--sds-c-inputtext-shadow);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* The Input element (in markup) */
|
|
22
|
+
|
|
23
|
+
:host([data-render-mode="shadow"]) [part~='input'] {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
padding: 0;
|
|
27
|
+
font-size: var(--sds-c-inputtext-font-size);
|
|
28
|
+
color: var(--sds-c-inputtext-text-color);
|
|
29
|
+
line-height: 1;
|
|
30
|
+
border: none;
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Placeholder Text */
|
|
35
|
+
|
|
36
|
+
:host([data-render-mode="shadow"]) [part~='input']::placeholder {
|
|
37
|
+
color: var(--sds-c-inputtext-text-color-placeholder);
|
|
38
|
+
font-style: var(--sds-c-inputtext-font-style-placeholder);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Focus State */
|
|
42
|
+
|
|
43
|
+
:host([data-render-mode="shadow"]) [part~='input-container']:focus-within {
|
|
44
|
+
--sds-c-inputtext-color-border: var(
|
|
45
|
+
--sds-c-inputtext-color-border-focus,
|
|
46
|
+
var(--sds-g-color-palette-blue-50, #0176d3)
|
|
47
|
+
);
|
|
48
|
+
--sds-c-inputtext-shadow: var(--sds-c-inputtext-shadow-focus, 0 0 3px var(--sds-g-color-palette-blue-50, #0176d3));
|
|
49
|
+
--sds-c-inputtext-color-background: var(--sds-c-inputtext-color-background-focus);
|
|
50
|
+
--sds-c-inputtext-text-color: var(--sds-c-inputtext-text-color-focus);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([data-render-mode="shadow"]) [part~='input']:focus {
|
|
54
|
+
outline: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Invalid state */
|
|
58
|
+
|
|
59
|
+
:host([data-render-mode="shadow"][aria-invalid='true']) [part~='input-container'] {
|
|
60
|
+
--sds-c-inputtext-color-border: var(--sds-c-inputtext-color-border-invalid);
|
|
61
|
+
--sds-c-inputtext-color-background: var(--sds-c-inputtext-color-background-invalid);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([data-render-mode="shadow"][aria-invalid='true']) [part~='input'] {
|
|
65
|
+
--sds-c-inputtext-text-color: var(--sds-c-inputtext-text-color-invalid);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Valid State */
|
|
69
|
+
|
|
70
|
+
:host([data-render-mode="shadow"][aria-invalid='false']) [part~='input-container'] {
|
|
71
|
+
--sds-c-inputtext-color-border: var(--sds-c-inputtext-color-border-valid);
|
|
72
|
+
--sds-c-inputtext-color-background: var(--sds-c-inputtext-color-background-valid);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([data-render-mode="shadow"][aria-invalid='false']) [part~='input'] {
|
|
76
|
+
--sds-c-inputtext-text-color: var(--sds-c-inputtext-text-color-valid);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Readonly State */
|
|
80
|
+
|
|
81
|
+
:host([data-render-mode="shadow"][readonly]) [part~='input-container'] {
|
|
82
|
+
--sds-c-inputtext-sizing-border: var(--sds-c-inputtext-sizing-border-readonly);
|
|
83
|
+
--sds-c-inputtext-spacing-inline-start: var(
|
|
84
|
+
--sds-c-inputtext-spacing-inline-start-readonly,
|
|
85
|
+
var(--sds-c-inputtext-spacing-inline-readonly)
|
|
86
|
+
);
|
|
87
|
+
--sds-c-inputtext-spacing-inline-end: var(
|
|
88
|
+
--sds-c-inputtext-spacing-inline-end-readonly,
|
|
89
|
+
var(--sds-c-inputtext-spacing-inline-readonly)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Disabled State */
|
|
94
|
+
|
|
95
|
+
:host([data-render-mode="shadow"][disabled]) [part~='input-container'] {
|
|
96
|
+
--sds-c-inputtext-text-color: #3e3e3c; /* TODO: Replace with Global Styling Hook Fallback */
|
|
97
|
+
--sds-c-inputtext-color-background: #ecebea; /* TODO: Replace with Global Styling Hook Fallback */
|
|
98
|
+
--sds-c-inputtext-color-border: #c9c7c5; /* TODO: Replace with Global Styling Hook Fallback */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@supports (--styling-hooks: '') {
|
|
102
|
+
/**
|
|
103
|
+
* Input Text
|
|
104
|
+
*/
|
|
105
|
+
:host([data-render-mode="shadow"]) [part~='input-text'] {
|
|
106
|
+
/* Host reassignments to composed slds-icon */
|
|
107
|
+
--slds-c-icon-color-foreground: var(
|
|
108
|
+
--slds-c-inputtext-icon-color-foreground,
|
|
109
|
+
var(--sds-g-color-neutral-base-50, #747474)
|
|
110
|
+
);
|
|
111
|
+
--slds-c-icon-sizing: var(--slds-c-inputtext-icon-sizing, 14px);
|
|
112
|
+
--sds-c-inputtext-sizing-height: var(
|
|
113
|
+
--slds-c-inputtext-sizing-height,
|
|
114
|
+
var(--sds-g-sizing-9, 2rem)
|
|
115
|
+
);
|
|
116
|
+
--sds-c-inputtext-color-background: var(
|
|
117
|
+
--slds-c-inputtext-color-background,
|
|
118
|
+
var(--sds-g-color-neutral-base-100, #ffffff)
|
|
119
|
+
);
|
|
120
|
+
--sds-c-inputtext-color-background-focus: var(
|
|
121
|
+
--slds-c-inputtext-color-background-focus,
|
|
122
|
+
var(--sds-g-color-neutral-base-100, #ffffff)
|
|
123
|
+
);
|
|
124
|
+
--sds-c-inputtext-text-color: var(--slds-c-inputtext-text-color);
|
|
125
|
+
--sds-c-inputtext-font-size: var(
|
|
126
|
+
--slds-c-inputtext-font-size,
|
|
127
|
+
var(--sds-g-font-scale-neg-2, 0.8125rem)
|
|
128
|
+
);
|
|
129
|
+
--sds-c-inputtext-text-color-placeholder: var(
|
|
130
|
+
--slds-c-inputtext-text-color-placeholder,
|
|
131
|
+
var(--sds-g-color-neutral-base-50, #747474)
|
|
132
|
+
);
|
|
133
|
+
--sds-c-inputtext-color-border: var(
|
|
134
|
+
--slds-c-inputtext-color-border,
|
|
135
|
+
var(--sds-g-color-neutral-base-80, #c9c9c9)
|
|
136
|
+
);
|
|
137
|
+
--sds-c-inputtext-sizing-border: var(--slds-c-inputtext-sizing-border);
|
|
138
|
+
--sds-c-inputtext-radius-border: var(
|
|
139
|
+
--slds-c-inputtext-radius-border,
|
|
140
|
+
var(--sds-g-radius-border-2, 0.25rem)
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-wrap: wrap;
|
|
145
|
+
align-items: center;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Input Container
|
|
150
|
+
*/
|
|
151
|
+
:host([data-render-mode="shadow"]) [part~='input-container'] {
|
|
152
|
+
flex: 1 0 100%;
|
|
153
|
+
align-items: stretch;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([data-render-mode="shadow"]) [part~='input-container'][type~='range'] {
|
|
157
|
+
border: none;
|
|
158
|
+
display: inline-block;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([data-render-mode="shadow"]) [part~='input'][type~='range'] {
|
|
162
|
+
min-height: calc(1.875rem + (1px * 2));
|
|
163
|
+
margin: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:host([data-render-mode="shadow"]) [part~='input-container'][type~='range']:focus-within,:host([data-render-mode="shadow"])
|
|
167
|
+
[part~='input-container'][type~='range']:active {
|
|
168
|
+
--sds-c-inputtext-color-border: var(--sds-g-color-brand-base-60, #1b96ff);
|
|
169
|
+
--sds-c-inputtext-shadow: 0 0 3px var(--sds-g-color-brand-base-50, #0176d3);
|
|
170
|
+
--sds-c-inputtext-color-background: var(--sds-g-color-neutral-base-100, #ffffff);
|
|
171
|
+
|
|
172
|
+
outline: 0;
|
|
173
|
+
border-width: var(--sds-c-inputtext-sizing-border, var(--sds-g-sizing-border-1, 1px));
|
|
174
|
+
border-color: var(--sds-c-inputtext-color-border, var(--sds-g-color-neutral-base-contrast-3));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Input
|
|
179
|
+
*/
|
|
180
|
+
:host([data-render-mode="shadow"]) [part~='input'] {
|
|
181
|
+
padding-inline-start: var(
|
|
182
|
+
--slds-c-inputtext-spacing-inline-start,
|
|
183
|
+
var(--sds-g-spacing-3, 0.75rem));
|
|
184
|
+
padding-inline-end: var(
|
|
185
|
+
--slds-c-inputtext-spacing-inline-end,
|
|
186
|
+
var(--sds-g-spacing-4, 1rem));
|
|
187
|
+
height: unset;
|
|
188
|
+
font-family: var(--sds-g-font-family, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Focus / active State
|
|
193
|
+
*/
|
|
194
|
+
:host([data-render-mode="shadow"]) [part~="input-container"]:focus-within,:host([data-render-mode="shadow"])
|
|
195
|
+
[part~="input-container"]:active {
|
|
196
|
+
--sds-c-inputtext-color-border: var(--sds-g-color-brand-base-60, #1b96ff);
|
|
197
|
+
--sds-c-inputtext-shadow: 0 0 3px var(--sds-g-color-brand-base-50, #0176d3);
|
|
198
|
+
--sds-c-inputtext-color-background: var(--sds-g-color-neutral-base-100, #ffffff);
|
|
199
|
+
|
|
200
|
+
outline: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Read Only State
|
|
205
|
+
*/
|
|
206
|
+
:host([data-render-mode="shadow"][readonly]) [part~='input-text'] {
|
|
207
|
+
--sds-c-inputtext-spacing-inline-start-readonly: 0;
|
|
208
|
+
--sds-c-inputtext-color-border-focus: transparent;
|
|
209
|
+
--slds-c-inputtext-color-border: transparent;
|
|
210
|
+
--slds-c-inputtext-color-background: transparent;
|
|
211
|
+
--slds-c-inputtext-color-background-focus: transparent;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Invalid State
|
|
216
|
+
*
|
|
217
|
+
* Does not use --sds-c-inputtext-color-border-invalid due to this hook being
|
|
218
|
+
* tied to :host([aria-invalid]) which this subsystem does not use. Instead, it
|
|
219
|
+
* uses :host([invalid]).
|
|
220
|
+
*/
|
|
221
|
+
:host([data-render-mode="shadow"][invalid]) [part~='input-text'] {
|
|
222
|
+
--sds-c-inputtext-shadow: 0 0 0 var(--sds-g-sizing-border-1, 1px) inset
|
|
223
|
+
var(--sds-g-color-error-base-50, #ea001e);
|
|
224
|
+
--slds-c-inputtext-color-border: var(--sds-g-color-error-base-50, #ea001e);
|
|
225
|
+
--slds-c-icon-color-foreground: var(--sds-g-color-error-base-50, #ea001e);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Invalid State - Focus
|
|
230
|
+
*
|
|
231
|
+
* The following styling hooks are included in SDS and need to be reassigned
|
|
232
|
+
* here to prevent a bug with the focus state border and box-shadow
|
|
233
|
+
*/
|
|
234
|
+
:host([data-render-mode="shadow"][invalid]) [part~='input-container']:focus-within {
|
|
235
|
+
--sds-c-inputtext-shadow:
|
|
236
|
+
var(--sds-g-color-error-base-50, #ea001e) 0 0 0 var(--sds-g-sizing-border-1, 1px) inset,
|
|
237
|
+
0 0 var(--sds-g-sizing-border-3, 3px) var(--sds-g-color-brand-base-50, #0176d3);
|
|
238
|
+
--sds-c-inputtext-color-border: var(--sds-g-color-error-base-50, #ea001e);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Disabled State
|
|
243
|
+
*
|
|
244
|
+
* Both parts form the visible form control.
|
|
245
|
+
*/
|
|
246
|
+
:host([data-render-mode="shadow"][disabled]) [part~='input-container'],:host([data-render-mode="shadow"][disabled]) [part~='input'] {
|
|
247
|
+
cursor: not-allowed;
|
|
248
|
+
--sds-c-inputtext-color-background: var(--sds-g-color-neutral-base-95, #f3f3f3);
|
|
249
|
+
--sds-c-inputtext-color-border: var(--sds-g-color-neutral-base-80, #c9c9c9);
|
|
250
|
+
--sds-c-inputtext-text-color: var(--sds-g-color-neutral-base-50, #747474);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Label
|
|
255
|
+
*
|
|
256
|
+
* Add [part~='input-text'] to increase specificity and
|
|
257
|
+
* avoid collisions with other components using [part~='label'] (e.g. slds-input-checkbox)
|
|
258
|
+
*/
|
|
259
|
+
:host([data-render-mode="shadow"]) [part~='input-text'] [part~='label'] {
|
|
260
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
261
|
+
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
262
|
+
color: var(
|
|
263
|
+
--slds-c-inputtext-label-color,
|
|
264
|
+
var(--sds-g-color-neutral-base-30, #444444)
|
|
265
|
+
);
|
|
266
|
+
font-size: var(
|
|
267
|
+
--slds-c-inputtext-label-font-size,
|
|
268
|
+
var(--sds-g-font-scale-neg-3, 0.75rem)
|
|
269
|
+
);
|
|
270
|
+
margin-block-end: var(--sds-g-sizing-1, 0.125rem);
|
|
271
|
+
|
|
272
|
+
/* We inline flex to control the spacing between elements and not have to rely on whitespace characters */
|
|
273
|
+
display: inline-flex;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Start
|
|
278
|
+
*
|
|
279
|
+
* Only expects an SLDS icon. We assign the SLDS Icon Styling Hook here
|
|
280
|
+
* so we don't add spacing to other icons composed in the component, e.g.,
|
|
281
|
+
* the icon in the inline help text.
|
|
282
|
+
*/
|
|
283
|
+
:host([data-render-mode="shadow"]) [part~='start'] {
|
|
284
|
+
--slds-c-icon-spacing-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Label Inline Variant
|
|
289
|
+
*
|
|
290
|
+
* Note: all the 33% values you see are remnants of legacy SLDS. We need to
|
|
291
|
+
* keep this implementation intact so visual output is the same when used
|
|
292
|
+
* in a form that has non-shadow components. Attempting to refactor to a
|
|
293
|
+
* modern solution like flex is proving tricky due to the presence of the
|
|
294
|
+
* optional inline-help and the input needing to have exactly 33% of spacing
|
|
295
|
+
* from the inline-start.
|
|
296
|
+
*
|
|
297
|
+
* Ref: https://github.com/salesforce-ux/design-system-internal/blob/240-winter-23/ui/components/form-element/horizontal/_index.scss#L63
|
|
298
|
+
*/
|
|
299
|
+
@media (min-width: 48em) {
|
|
300
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='input-text'] {
|
|
301
|
+
display: block;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='label'] {
|
|
305
|
+
float: left;
|
|
306
|
+
|
|
307
|
+
/* TODO: Get rid of these magic numbers */
|
|
308
|
+
max-width: calc(33% - 1.125rem);
|
|
309
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='input-container'] {
|
|
313
|
+
margin-inline-start: 33%;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='inline-help'] {
|
|
317
|
+
float: left;
|
|
318
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
:host([data-render-mode="shadow"]) input[type="search"] + lightning-primitive-icon::part(icon) {
|
|
323
|
+
left: var(--sds-g-spacing-3, 0.75rem);
|
|
324
|
+
fill: var(--slds-g-color-neutral-base-50, #747474);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon .slds-button_icon {
|
|
328
|
+
background-color: transparent;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon .slds-button_icon:focus,:host([data-render-mode="shadow"])
|
|
332
|
+
.slds-input-has-icon .slds-button_icon:hover {
|
|
333
|
+
--slds-c-icon-color-foreground: var(--sds-g-color-brand-base-30, #014486);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon .slds-input__icon {
|
|
337
|
+
width: 0.875rem;
|
|
338
|
+
height: 0.875rem;
|
|
339
|
+
position: absolute;
|
|
340
|
+
top: 50%;
|
|
341
|
+
margin-top: -0.4375rem;
|
|
342
|
+
line-height: 1;
|
|
343
|
+
border: 0;
|
|
344
|
+
z-index: 2;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Has Icon Left
|
|
349
|
+
*/
|
|
350
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon_left {
|
|
351
|
+
--slds-c-inputtext-spacing-inline-start: var(--sds-g-spacing-6, 2rem);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon_left .slds-input__icon,:host([data-render-mode="shadow"])
|
|
355
|
+
.slds-input-has-icon_left-right .slds-input__icon_left {
|
|
356
|
+
inset-inline-start: var(--sds-g-spacing-3, 0.75rem);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Has Icon Right
|
|
361
|
+
*/
|
|
362
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon_right {
|
|
363
|
+
--slds-c-inputtext-spacing-inline-end: var(--sds-g-spacing-6, 2rem);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon_right .slds-input__icon,:host([data-render-mode="shadow"])
|
|
367
|
+
.slds-input-has-icon_left-right .slds-input__icon_right {
|
|
368
|
+
inset-inline-end: var(--sds-g-spacing-3, 0.75rem);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Has Icon Left & Right
|
|
373
|
+
*/
|
|
374
|
+
:host([data-render-mode="shadow"]) .slds-input-has-icon_left-right {
|
|
375
|
+
--slds-c-inputtext-spacing-inline-start: var(--sds-g-spacing-6, 2rem);
|
|
376
|
+
--slds-c-inputtext-spacing-inline-end: var(--sds-g-spacing-6, 2rem);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* A temporarily baked-in utility class until SLDS gets a proper utility package.
|
|
381
|
+
*
|
|
382
|
+
* This is a hybrid patch between synthetic and native shadow. The ideal final
|
|
383
|
+
* outcome is the removal of this class and replacing the class with the SLDS
|
|
384
|
+
* utility package solution.
|
|
385
|
+
*/
|
|
386
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
387
|
+
position: absolute !important;
|
|
388
|
+
margin: -1px !important;
|
|
389
|
+
border: 0 !important;
|
|
390
|
+
padding: 0 !important;
|
|
391
|
+
width: 1px !important;
|
|
392
|
+
height: 1px !important;
|
|
393
|
+
overflow: hidden !important;
|
|
394
|
+
clip: rect(0 0 0 0) !important;
|
|
395
|
+
text-transform: none !important;
|
|
396
|
+
white-space: nowrap !important;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
<template for:each={computedSelectedList} for:item="option" for:index="index">
|
|
49
49
|
<li key={option.value} role="presentation" class="slds-listbox__item">
|
|
50
50
|
<div class={option.classList} aria-selected={option.selected} role="option" tabindex={option.tabIndex} data-index={index}
|
|
51
|
-
data-value={option.value} data-type={computedSelectedListId}
|
|
52
|
-
onkeydown={handleOptionKeyDown}>
|
|
51
|
+
aria-disabled={option.isLocked} draggable={option.draggable} data-value={option.value} data-type={computedSelectedListId}
|
|
52
|
+
onclick={handleOptionClick} onkeydown={handleOptionKeyDown}>
|
|
53
53
|
<span class="slds-media__body">
|
|
54
54
|
<span class="slds-truncate" title={option.label}>{option.label}</span>
|
|
55
55
|
</span>
|
|
56
56
|
<template if:true={option.isLocked}>
|
|
57
57
|
<span class="slds-media__figure slds-media__figure_reverse">
|
|
58
|
-
<lightning-icon icon-name="utility:lock" size="x-small" alternative-text={computedLockAssistiveText}></lightning-icon>
|
|
58
|
+
<lightning-icon icon-name="utility:lock" size="x-small" alternative-text={computedLockAssistiveText} class="slds-icon_container slds-current-color"></lightning-icon>
|
|
59
59
|
</span>
|
|
60
60
|
</template>
|
|
61
61
|
</div>
|
|
@@ -17,7 +17,8 @@ import labelLoadingText from '@salesforce/label/LightningCombobox.loadingText';
|
|
|
17
17
|
import labelMovedOptionsSingular from '@salesforce/label/LightningDualListbox.movedOptionsSingular';
|
|
18
18
|
import labelMovedOptionsPlural from '@salesforce/label/LightningDualListbox.movedOptionsPlural';
|
|
19
19
|
import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helptextAlternativeText';
|
|
20
|
-
import {
|
|
20
|
+
import { api, track } from 'lwc';
|
|
21
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
21
22
|
import { handleKeyDownOnOption } from './keyboard';
|
|
22
23
|
import { classSet, formatLabel } from 'lightning/utils';
|
|
23
24
|
import {
|
|
@@ -59,7 +60,7 @@ const i18n = {
|
|
|
59
60
|
/**
|
|
60
61
|
* A pair of listboxes that enables multiple options to be selected and reordered.
|
|
61
62
|
*/
|
|
62
|
-
export default class LightningDualListbox extends
|
|
63
|
+
export default class LightningDualListbox extends LightningShadowBaseClass {
|
|
63
64
|
// Component attributes
|
|
64
65
|
/**
|
|
65
66
|
* Label for the source options listbox.
|
|
@@ -354,6 +355,7 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
connectedCallback() {
|
|
358
|
+
super.connectedCallback();
|
|
357
359
|
this.classList.add('slds-form-element');
|
|
358
360
|
this.updateClassList();
|
|
359
361
|
this.keyboardInterface = this.selectKeyboardInterface();
|
|
@@ -457,6 +459,7 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
457
459
|
const option = optionsMap[optionValue];
|
|
458
460
|
if (option) {
|
|
459
461
|
option.isLocked = true;
|
|
462
|
+
option.draggable = false;
|
|
460
463
|
}
|
|
461
464
|
});
|
|
462
465
|
|
|
@@ -475,15 +478,33 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
475
478
|
);
|
|
476
479
|
}
|
|
477
480
|
|
|
481
|
+
isOptionDisabled(elm) {
|
|
482
|
+
return !!(elm?.getAttribute('aria-disabled') === 'true');
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
isOptionRequiredOrLocked(option) {
|
|
486
|
+
return !!(
|
|
487
|
+
this.requiredOptions.includes(option.value) || option.isLocked
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
|
|
478
491
|
computeListOptions(options, focusableOptionValue) {
|
|
479
492
|
if (options.length > 0) {
|
|
480
493
|
const focusableOption = options.find((option) => {
|
|
481
|
-
return
|
|
494
|
+
return (
|
|
495
|
+
option.value === focusableOptionValue &&
|
|
496
|
+
!this.isOptionRequiredOrLocked(option)
|
|
497
|
+
);
|
|
482
498
|
});
|
|
483
499
|
|
|
500
|
+
const firstFocusableOption = options.find(
|
|
501
|
+
(option) => !this.isOptionRequiredOrLocked(option)
|
|
502
|
+
);
|
|
503
|
+
|
|
484
504
|
const focusableValue = focusableOption
|
|
485
505
|
? focusableOption.value
|
|
486
|
-
:
|
|
506
|
+
: firstFocusableOption?.value;
|
|
507
|
+
|
|
487
508
|
return options.map((option) => {
|
|
488
509
|
return this.computeOptionProperties(option, focusableValue);
|
|
489
510
|
});
|
|
@@ -632,7 +653,7 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
632
653
|
|
|
633
654
|
handleOptionClick(event) {
|
|
634
655
|
this.interactingState.interacting();
|
|
635
|
-
if (this.disabled) {
|
|
656
|
+
if (this.disabled || this.isOptionDisabled(event.currentTarget)) {
|
|
636
657
|
return;
|
|
637
658
|
}
|
|
638
659
|
const selectMultiple = event.metaKey || event.ctrlKey || event.shiftKey;
|
|
@@ -803,7 +824,7 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
803
824
|
this.highlightedOptionsLabel = [];
|
|
804
825
|
for (let i = 0; i < options.length; i++) {
|
|
805
826
|
select = (i - start) * (i - end) <= 0;
|
|
806
|
-
if (select) {
|
|
827
|
+
if (select && !this.isOptionDisabled(options[i])) {
|
|
807
828
|
val = options[i].getAttribute('data-value');
|
|
808
829
|
this.highlightedOptions.push(val);
|
|
809
830
|
}
|
|
@@ -811,6 +832,10 @@ export default class LightningDualListbox extends LightningElement {
|
|
|
811
832
|
}
|
|
812
833
|
|
|
813
834
|
updateSelectedOptions(option, select, isMultiple) {
|
|
835
|
+
if (this.isOptionDisabled(option)) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
|
|
814
839
|
const value = option.getAttribute('data-value');
|
|
815
840
|
const listId = this.getListId(option);
|
|
816
841
|
const optionIndex = this.getOptionIndex(option);
|