lightning-base-components 1.21.8-alpha → 1.22.1-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 +3 -0
- package/package.json +3 -5
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/src/lightning/accordionSection/button.slds.css +16 -13
- package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js-meta.xml +1 -1
- package/src/lightning/button/button.slds.css +16 -13
- package/src/lightning/buttonIcon/button-icon.slds.css +16 -13
- package/src/lightning/buttonIconStateful/button-icon.slds.css +16 -13
- package/src/lightning/buttonIconStateful/button.slds.css +16 -13
- package/src/lightning/buttonMenu/button-icon.slds.css +16 -13
- package/src/lightning/buttonMenu/button.slds.css +16 -13
- package/src/lightning/buttonMenu/buttonMenu.js +5 -3
- package/src/lightning/buttonStateful/button-stateful.slds.css +23 -0
- package/src/lightning/buttonStateful/button.slds.css +16 -13
- package/src/lightning/buttonStateful/buttonStateful.js-meta.xml +3 -0
- package/src/lightning/calendar/keyboard.js +11 -3
- package/src/lightning/combobox/combobox.js +5 -13
- package/src/lightning/datatable/__examples__/withVirtualization/withVirtualization.js +0 -1
- package/src/lightning/datatable/datatable.js +35 -39
- package/src/lightning/datatable/keyboard.js +11 -10
- package/src/lightning/datatable/renderManager.js +1 -3
- package/src/lightning/datatable/rows.js +16 -9
- package/src/lightning/datatable/state.js +0 -1
- package/src/lightning/datatable/templates/div/div.html +8 -8
- package/src/lightning/datatable/templates/div/div.lbc.synthetic.css +7 -0
- package/src/lightning/datatable/virtualization.js +11 -14
- package/src/lightning/formattedAddress/formattedAddress.js +3 -2
- package/src/lightning/formattedDateTime/formattedDateTime.js +3 -2
- package/src/lightning/formattedDateTime/formattedDateTime.js-meta.xml +1 -1
- package/src/lightning/formattedLocation/formattedLocation.js +3 -2
- package/src/lightning/formattedPhone/formattedPhone.js +3 -2
- package/src/lightning/formattedTime/formattedTime.js +3 -2
- package/src/lightning/formattedUrl/formattedUrl.js +3 -2
- package/src/lightning/helptext/button-icon.slds.css +16 -13
- package/src/lightning/helptext/helptext.js-meta.xml +3 -0
- package/src/lightning/inputAddress/__docs__/inputAddress.md +44 -3
- package/src/lightning/inputAddress/inputAddress.js +8 -6
- package/src/lightning/inputName/inputName.js-meta.xml +3 -0
- package/src/lightning/interactiveDialogBase/button.slds.css +507 -0
- package/src/lightning/interactiveDialogBase/interactive-dialog-base.slds.css +45 -17
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.lbc.native.css +6 -1
- package/src/lightning/interactiveDialogBase/modal-base.slds.css +242 -0
- package/src/lightning/interactiveDialogBase/modal-body.slds.css +60 -0
- package/src/lightning/interactiveDialogBase/modal-footer.slds.css +79 -0
- package/src/lightning/interactiveDialogBase/modal-header.slds.css +76 -0
- package/src/lightning/lookupAddress/lookupAddress.js-meta.xml +3 -0
- package/src/lightning/menuDivider/menuDivider.js-meta.xml +3 -0
- package/src/lightning/menuItem/menuItem.js +19 -3
- package/src/lightning/menuSubheader/menuSubheader.js-meta.xml +3 -0
- package/src/lightning/modal/modal.js-meta.xml +3 -0
- package/src/lightning/modalBase/modalBase.js +7 -5
- package/src/lightning/modalBody/modalBody.js-meta.xml +3 -0
- package/src/lightning/modalFooter/modalFooter.js-meta.xml +3 -0
- package/src/lightning/modalHeader/modalHeader.js-meta.xml +3 -0
- package/src/lightning/picklist/picklist.js +3 -2
- package/src/lightning/pill/pill.js +1 -1
- package/src/lightning/pillContainer/button.slds.css +16 -13
- package/src/lightning/primitiveDatatableTooltip/primitiveDatatableTooltip.js +11 -7
- package/src/lightning/primitiveDatatableTooltipBubble/primitiveDatatableTooltipBubble.html +1 -1
- package/src/lightning/primitiveFileDroppableZone/primitiveFileDroppableZone.js +3 -2
- package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +1 -1
- package/src/lightning/primitiveInputFile/button.slds.css +16 -13
- package/src/lightning/primitiveInputFile/input-file.slds.css +3 -2
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +13 -7
- package/src/lightning/progressBar/progressBar.js-meta.xml +3 -0
- package/src/lightning/progressRing/progressRing.js-meta.xml +3 -0
- package/src/lightning/prompt/form-element.slds.css +319 -0
- package/src/lightning/prompt/input-text.slds.css +506 -0
- package/src/lightning/prompt/prompt.lbc.native.css +2 -0
- package/src/lightning/purifyLib/purify.js +838 -586
- package/src/lightning/radioGroup/radioGroup.js-meta.xml +3 -0
- package/src/lightning/textarea/textarea.js-meta.xml +3 -0
- package/src/lightning/toast/button-icon.slds.css +16 -13
- package/src/lightning/toast/toast.js-meta.xml +3 -0
- package/src/lightning/toastContainer/toastContainer.js-meta.xml +3 -0
- package/src/lightning/verticalNavigationOverflow/button.slds.css +16 -13
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Remap to SLDS blueprint hooks for parity
|
|
7
|
+
* https://www.lightningdesignsystem.com/components/modals/#Styling-Hooks-Overview
|
|
8
|
+
*
|
|
9
|
+
* "Shared" Styling Hooks for modal base/header/body/footer
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
:host([data-render-mode="shadow"]) [part='modal-backdrop'] {
|
|
13
|
+
--slds-c-backdrop-color-background: var(--slds-c-modalbase-backdrop-color-background);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([data-render-mode="shadow"]) [part='modal'] {
|
|
17
|
+
/* Map modal component hooks to single "shared" hooks from blueprint */
|
|
18
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
19
|
+
|
|
20
|
+
/* '--slds-c-modal-shadow' is used in body/footer */
|
|
21
|
+
--slds-c-modalbody-shadow: var(--slds-c-modal-shadow);
|
|
22
|
+
--slds-c-modalfooter-shadow: var(--slds-c-modal-shadow);
|
|
23
|
+
|
|
24
|
+
/* '--slds-c-modal-color-border' is used in header/footer */
|
|
25
|
+
--slds-c-modalheader-color-border: var(--slds-c-modal-color-border);
|
|
26
|
+
--slds-c-modalfooter-color-border: var(--slds-c-modal-color-border);
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/* '--slds-c-modal-radius-border' is used in header/body/footer */
|
|
30
|
+
--slds-c-modalheader-radius-border: var(--slds-c-modal-radius-border);
|
|
31
|
+
--slds-c-modalbody-radius-border: var(--slds-c-modal-radius-border);
|
|
32
|
+
--slds-c-modalfooter-radius-border: var(--slds-c-modal-radius-border);
|
|
33
|
+
|
|
34
|
+
/* '--slds-c-modal-sizing-border' is used in header/footer */
|
|
35
|
+
--slds-c-modalheader-sizing-border: var(--slds-c-modal-sizing-border);
|
|
36
|
+
--slds-c-modalfooter-sizing-border: var(--slds-c-modal-sizing-border);
|
|
37
|
+
|
|
38
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([data-render-mode="shadow"]) .slds-backdrop {
|
|
43
|
+
transition-duration: 0.4s;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
visibility: hidden;
|
|
48
|
+
position: fixed;
|
|
49
|
+
inset-block-start: 0;
|
|
50
|
+
inset-inline-end: 0;
|
|
51
|
+
inset-block-end: 0;
|
|
52
|
+
inset-inline-start: 0;
|
|
53
|
+
background: var(--slds-c-modalbase-backdrop-color-background, var(--slds-g-color-neutral-10-opacity-50, rgba(8, 7, 7, 60%)));
|
|
54
|
+
z-index: 9000;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([data-render-mode="shadow"]) .slds-backdrop_open {
|
|
58
|
+
visibility: visible;
|
|
59
|
+
opacity: 1;
|
|
60
|
+
transition: opacity 0.4s linear;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([data-render-mode="shadow"]) .slds-modal {
|
|
64
|
+
opacity: 0;
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
transition: transform 0.1s linear, opacity 0.1s;
|
|
67
|
+
position: fixed;
|
|
68
|
+
inset-block-start: 0;
|
|
69
|
+
inset-inline-end: 0;
|
|
70
|
+
inset-block-end: 0;
|
|
71
|
+
inset-inline-start: 0;
|
|
72
|
+
z-index: 9001
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([data-render-mode="shadow"]) .slds-modal__container {
|
|
76
|
+
position: relative;
|
|
77
|
+
transform: translate(0, 0);
|
|
78
|
+
transition: transform 0.1s linear, opacity 0.1s linear;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
margin: 0 var(--slds-g-spacing-6);
|
|
83
|
+
height: 100%;
|
|
84
|
+
padding: var(--slds-g-spacing-8) 0 var(--slds-g-spacing-12) 0;
|
|
85
|
+
border-radius: var(--slds-g-spacing-1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([data-render-mode="shadow"]) .slds-modal__close {
|
|
89
|
+
width: 2rem;
|
|
90
|
+
height: 2rem;
|
|
91
|
+
margin-inline-start: auto;
|
|
92
|
+
position: relative;
|
|
93
|
+
inset-block-end: var(--slds-g-spacing-2);
|
|
94
|
+
inset-inline-end: (var(--slds-g-spacing-2) * -1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([data-render-mode="shadow"]) .slds-fade-in-open {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
visibility: visible;
|
|
100
|
+
transition: opacity 0.1s linear;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([data-render-mode="shadow"]) .slds-fade-in-open .slds-modal__container-reset {
|
|
104
|
+
opacity: 1;
|
|
105
|
+
visibility: visible;
|
|
106
|
+
transform: translate(0, 0);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Sizes: Small, Medium, Large */
|
|
110
|
+
|
|
111
|
+
@media (width >= 48em) {
|
|
112
|
+
:host([data-render-mode="shadow"]) .slds-modal__container {
|
|
113
|
+
margin: 0 auto;
|
|
114
|
+
width: 50%;
|
|
115
|
+
max-width: 40rem;
|
|
116
|
+
min-width: 20rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([data-render-mode="shadow"]) .slds-modal_small .slds-modal__container {
|
|
120
|
+
width: 60%;
|
|
121
|
+
max-width: 52.0625rem;
|
|
122
|
+
min-width: 40rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([data-render-mode="shadow"]) .slds-modal_medium .slds-modal__container {
|
|
126
|
+
width: 70%;
|
|
127
|
+
max-width: 75rem;
|
|
128
|
+
min-width: 40rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([data-render-mode="shadow"]) .slds-modal_large .slds-modal__container {
|
|
132
|
+
width: 90%;
|
|
133
|
+
max-width: none;
|
|
134
|
+
min-width: 40rem;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Sizes: Full */
|
|
139
|
+
|
|
140
|
+
/* .slds-modal_full {} */
|
|
141
|
+
|
|
142
|
+
/* Behaves like large size when not in a small viewport */
|
|
143
|
+
|
|
144
|
+
@media (width >= 48em) {
|
|
145
|
+
:host([data-render-mode="shadow"]) .slds-modal_full .slds-modal__container {
|
|
146
|
+
width: 90%;
|
|
147
|
+
max-width: none;
|
|
148
|
+
min-width: 40rem;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Original SLDS implementation was desktop-first. This is now mobile-first for <=480px */
|
|
153
|
+
|
|
154
|
+
@media (width <= 30em) {
|
|
155
|
+
:host([data-render-mode="shadow"]) .slds-modal_full {
|
|
156
|
+
/* Account for iOS safe areas so our modal doesn't load underneath iOS elements. */
|
|
157
|
+
inset-block-start: env(safe-area-inset-top, 0);
|
|
158
|
+
|
|
159
|
+
/* Override slds-modal's bottom: 0 so we can make the height dynamic. */
|
|
160
|
+
inset-block-end: auto;
|
|
161
|
+
|
|
162
|
+
/* Viewport may be dynamic, e.g., iOS Safari toolbar hiding behavior, so we use dvh. Safe areas may not be required here. */
|
|
163
|
+
/* stylelint-disable-next-line unit-no-unknown */
|
|
164
|
+
height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host([data-render-mode="shadow"]) .slds-modal_full .slds-modal__container {
|
|
168
|
+
width: 100%;
|
|
169
|
+
max-width: none;
|
|
170
|
+
min-width: 0;
|
|
171
|
+
margin: 0;
|
|
172
|
+
padding: var(--slds-g-spacing-4) 0 0 0;
|
|
173
|
+
background-color: var(--slds-c-modalbase-color-background, var(--slds-g-color-surface-1));
|
|
174
|
+
border-radius: 0;
|
|
175
|
+
|
|
176
|
+
/* Establishes the main layout of the modal. Grid is defined by grid-template-areas
|
|
177
|
+
which explicitly defines the grid and allows optional elements to be omitted like
|
|
178
|
+
the header or footer. */
|
|
179
|
+
display: grid;
|
|
180
|
+
/* stylelint-disable-next-line unit-no-unknown */
|
|
181
|
+
height: 100dvh;
|
|
182
|
+
grid-template-columns: 1fr;
|
|
183
|
+
grid-template-rows: min-content min-content 1fr min-content;
|
|
184
|
+
grid-template-areas: "close" "header" "content" "footer";
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host([data-render-mode="shadow"]) .slds-modal_full .slds-modal__close {
|
|
188
|
+
grid-area: close;
|
|
189
|
+
inset-inline-end: var(--slds-g-spacing-4);
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A few things going on here:
|
|
193
|
+
* - We want to avoid a markup change for a single modifier so we reassign/override.
|
|
194
|
+
* - Button icon doesn't have component level hooks (yet), so we don't include them here
|
|
195
|
+
* and we have to override the CSS property instead of reassign.
|
|
196
|
+
* - States on button have a bug, they override instead of reassign hooks
|
|
197
|
+
* so the values of empty hooks default to initial values. In the case
|
|
198
|
+
* of background colors, the background will disappear (initial = transparent).
|
|
199
|
+
*/
|
|
200
|
+
--slds-c-button-color-background: var(--slds-g-color-surface-container-1, white);
|
|
201
|
+
--slds-c-button-color-background-active: var(--slds-g-color-surface-container-1, white);
|
|
202
|
+
|
|
203
|
+
color: var(--slds-g-color-on-surface-1);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:host([data-render-mode="shadow"]) .slds-modal_full .slds-modal__close:hover,:host([data-render-mode="shadow"])
|
|
207
|
+
.slds-modal_full .slds-modal__close:focus {
|
|
208
|
+
color: var(--slds-g-color-accent-3);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* INTERNAL USE ONLY - SUBJECT TO CHANGE AND REMOVAL
|
|
213
|
+
*
|
|
214
|
+
* SLDS Blueprint <> LBC Parity Patch
|
|
215
|
+
*
|
|
216
|
+
* SLDS blueprints and LBC implementation are not 1:1. This patch is needed to
|
|
217
|
+
* account for the differences introduced in the LBC implementation. Location
|
|
218
|
+
* of this code would ideally live within the LBC component CSS module but
|
|
219
|
+
* synthetic shadow and how LBC deconstructs the modal into individual components
|
|
220
|
+
* makes this not feasible. Not ideal, but this is the best solution for now.
|
|
221
|
+
* Selectors are scoped to lightning-* to avoid any potential outside conflicts.
|
|
222
|
+
*/
|
|
223
|
+
:host([data-render-mode="shadow"]) .slds-modal_full lightning-button-icon+div,:host([data-render-mode="shadow"])
|
|
224
|
+
.slds-modal_full lightning-modal {
|
|
225
|
+
display: contents;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* TODO W-12674349: remove after assistive text util is added */
|
|
230
|
+
|
|
231
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
232
|
+
position: absolute !important;
|
|
233
|
+
margin: -1px !important;
|
|
234
|
+
border: 0 !important;
|
|
235
|
+
padding: 0 !important;
|
|
236
|
+
width: 1px !important;
|
|
237
|
+
height: 1px !important;
|
|
238
|
+
overflow: hidden !important;
|
|
239
|
+
clip: rect(0 0 0 0) !important;
|
|
240
|
+
text-transform: none !important;
|
|
241
|
+
white-space: nowrap !important;
|
|
242
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
|
|
5
|
+
:host([data-render-mode="shadow"]) .slds-modal__content_headless {
|
|
6
|
+
border-start-end-radius: var(--slds-c-modalbody-radius-border, var(--slds-g-radius-border-2));
|
|
7
|
+
border-start-start-radius: var(--slds-c-modalbody-radius-border, var(--slds-g-radius-border-2));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([data-render-mode="shadow"]) .slds-modal__content {
|
|
11
|
+
/**
|
|
12
|
+
* Remap to SLDS blueprint hooks for parity
|
|
13
|
+
* https://www.lightningdesignsystem.com/components/modals/#Styling-Hooks-Overview
|
|
14
|
+
*/
|
|
15
|
+
--slds-c-modal-content-color-background: var(--slds-c-modalbody-color-background);
|
|
16
|
+
--slds-c-modal-content-text-color: var(--slds-c-modalbody-text-color);
|
|
17
|
+
|
|
18
|
+
background-color: var(--slds-c-modalbody-color-background, var(--slds-g-color-surface-container-1));
|
|
19
|
+
color: var(--slds-c-modalbody-text-color);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([data-render-mode="shadow"]) .slds-modal__content_footless {
|
|
25
|
+
border-bottom-right-radius: var(--slds-c-modalbody-radius-border, var(--slds-g-radius-border-2));
|
|
26
|
+
border-bottom-left-radius: var(--slds-c-modalbody-radius-border, var(--slds-g-radius-border-2));
|
|
27
|
+
box-shadow: var(--slds-c-modalbody-shadow, var(--slds-g-shadow-2));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Sizes: Full */
|
|
31
|
+
|
|
32
|
+
/* Original SLDS implementation was desktop-first. This is now mobile-first for <=480px */
|
|
33
|
+
|
|
34
|
+
@media (width <= 30em) {
|
|
35
|
+
:host([data-render-mode="shadow"][data-size='full']) [part='modal-body'] {
|
|
36
|
+
grid-area: content;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([data-render-mode="shadow"][data-size='full'][data-variant-footless]) [part='modal-body'] {
|
|
40
|
+
border-end-end-radius: 0;
|
|
41
|
+
border-end-start-radius: 0;
|
|
42
|
+
box-shadow: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* INTERNAL USE ONLY - SUBJECT TO CHANGE AND REMOVAL
|
|
47
|
+
*
|
|
48
|
+
* SLDS Blueprint <> LBC Parity Patch
|
|
49
|
+
*
|
|
50
|
+
* SLDS blueprints and LBC implementation are not 1:1. This patch is needed to
|
|
51
|
+
* account for the differences introduced in the LBC implementation. Location
|
|
52
|
+
* of this code would ideally live within the LBC component CSS module but
|
|
53
|
+
* synthetic shadow and how LBC deconstructs the modal into individual components
|
|
54
|
+
* makes this not feasible. Not ideal, but this is the best solution for now.
|
|
55
|
+
* Selectors are scoped to lightning-* to avoid any potential outside conflicts.
|
|
56
|
+
*/
|
|
57
|
+
:host([data-render-mode="shadow"][data-size='full']) {
|
|
58
|
+
display: contents;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
|
|
5
|
+
:host([data-render-mode="shadow"]) .slds-modal__footer {
|
|
6
|
+
|
|
7
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-deprecated */
|
|
8
|
+
|
|
9
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Remap to SLDS blueprint hooks for parity
|
|
13
|
+
* https://www.lightningdesignsystem.com/components/modals/#Styling-Hooks-Overview
|
|
14
|
+
*/
|
|
15
|
+
--slds-c-modal-footer-color-background: var(--slds-c-modalfooter-color-background);
|
|
16
|
+
--slds-c-modal-footer-text-color: var(--slds-c-modalfooter-text-color);
|
|
17
|
+
--slds-c-modal-footer-spacing-block-start: var(--slds-c-modalfooter-spacing-block-start);
|
|
18
|
+
--slds-c-modal-footer-spacing-inline-end: var(--slds-c-modalfooter-spacing-inline-end);
|
|
19
|
+
--slds-c-modal-footer-spacing-block-end: var(--slds-c-modalfooter-spacing-block-end);
|
|
20
|
+
--slds-c-modal-footer-spacing-inline-start: var(--slds-c-modalfooter-spacing-inline-start);
|
|
21
|
+
|
|
22
|
+
border-end-end-radius: var(--slds-c-modalfooter-radius-border, var(--slds-g-radius-border-2));
|
|
23
|
+
border-end-start-radius: var(--slds-c-modalfooter-radius-border, var(--slds-g-radius-border-2));
|
|
24
|
+
border-block-start-width: var(--slds-c-modalfooter-sizing-border, var(--slds-g-sizing-border-2));
|
|
25
|
+
border-block-start-style: solid;
|
|
26
|
+
border-block-start-color: var(--slds-c-modalfooter-color-border, var(--slds-g-color-border-1));
|
|
27
|
+
background-color: var(--slds-c-modalfooter-color-background, var(--slds-g-color-surface-container-2));
|
|
28
|
+
color: var(--slds-c-modalfooter-text-color);
|
|
29
|
+
-ms-flex-negative: 0;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
padding-block-start: var(--slds-c-modalfooter-spacing-block-start, var(--slds-g-spacing-3));
|
|
32
|
+
padding-inline-end: var(--slds-c-modalfooter-spacing-inline-end, var(--slds-g-spacing-4));
|
|
33
|
+
padding-block-end: var(--slds-c-modalfooter-spacing-block-end, var(--slds-g-spacing-3));
|
|
34
|
+
padding-inline-start: var(--slds-c-modalfooter-spacing-inline-start, var(--slds-g-spacing-4));
|
|
35
|
+
text-align: right;
|
|
36
|
+
box-shadow: var(--slds-c-modalfooter-shadow, 0 2px 3px 0 rgba(0, 0, 0, 16%));
|
|
37
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-deprecated */
|
|
38
|
+
|
|
39
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* TODO W-12674349: Replace with visibility utility classes when available */
|
|
43
|
+
|
|
44
|
+
:host([data-render-mode="shadow"]) .slds-hide {
|
|
45
|
+
display: none !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Sizes: Full */
|
|
49
|
+
|
|
50
|
+
/* Original SLDS implementation was desktop-first. This is now mobile-first for <=480px */
|
|
51
|
+
|
|
52
|
+
@media (width <= 30em) {
|
|
53
|
+
:host([data-render-mode="shadow"][data-size='full']) [part='modal-footer'] {
|
|
54
|
+
grid-area: footer;
|
|
55
|
+
border-start-end-radius: 0;
|
|
56
|
+
border-end-start-radius: 0;
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* INTERNAL USE ONLY - SUBJECT TO CHANGE AND REMOVAL
|
|
62
|
+
*
|
|
63
|
+
* SLDS Blueprint <> LBC Parity Patch
|
|
64
|
+
*
|
|
65
|
+
* SLDS blueprints and LBC implementation are not 1:1. This patch is needed to
|
|
66
|
+
* account for the differences introduced in the LBC implementation. Location
|
|
67
|
+
* of this code would ideally live within the LBC component CSS module but
|
|
68
|
+
* synthetic shadow and how LBC deconstructs the modal into individual components
|
|
69
|
+
* makes this not feasible. Not ideal, but this is the best solution for now.
|
|
70
|
+
* Selectors are scoped to lightning-* to avoid any potential outside conflicts.
|
|
71
|
+
*/
|
|
72
|
+
:host([data-render-mode="shadow"][data-size='full']) {
|
|
73
|
+
display: contents;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([data-render-mode="shadow"]) .slds-modal__footer .slds-button + .slds-button {
|
|
78
|
+
margin-left: var(--slds-g-spacing-2);
|
|
79
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
|
+
|
|
5
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-deprecated */
|
|
6
|
+
|
|
7
|
+
/* stylelint-disable sds-stylelint-plugin/styling-hooks-pattern */
|
|
8
|
+
|
|
9
|
+
:host([data-render-mode="shadow"]) .slds-modal__header {
|
|
10
|
+
/**
|
|
11
|
+
* Remap to SLDS blueprint hooks for parity
|
|
12
|
+
* https://www.lightningdesignsystem.com/components/modals/#Styling-Hooks-Overview
|
|
13
|
+
*/
|
|
14
|
+
--slds-c-modal-header-color-background: var(--slds-c-modalheader-color-background);
|
|
15
|
+
--slds-c-modal-header-text-color: var(--slds-c-modalheader-text-color);
|
|
16
|
+
--slds-c-modal-header-spacing-block-start: var(--slds-c-modalheader-spacing-block-start);
|
|
17
|
+
--slds-c-modal-header-spacing-inline-end: var(--slds-c-modalheader-spacing-inline-end);
|
|
18
|
+
--slds-c-modal-header-spacing-block-end: var(--slds-c-modalheader-spacing-block-end);
|
|
19
|
+
--slds-c-modal-header-spacing-inline-start: var(--slds-c-modalheader-spacing-inline-start);
|
|
20
|
+
|
|
21
|
+
--slds-c-modal-heading-font-size: var(--slds-c-modalheader-heading-font-size);
|
|
22
|
+
--slds-c-modal-heading-font-weight: var(--slds-c-modalheader-heading-font-weight);
|
|
23
|
+
--slds-c-modal-heading-font-lineheight: var(--slds-c-modalheader-heading-font-lineheight);
|
|
24
|
+
|
|
25
|
+
position: relative;
|
|
26
|
+
border-start-end-radius: var(--slds-c-modalheader-radius-border, var(--slds-g-radius-border-2));
|
|
27
|
+
border-start-start-radius: var(--slds-c-modalheader-radius-border, var(--slds-g-radius-border-2));
|
|
28
|
+
border-block-end-width: var(--slds-c-modalheader-sizing-border, var(--slds-g-sizing-border-2));
|
|
29
|
+
border-block-end-style: solid;
|
|
30
|
+
border-block-end-color: var(--slds-c-modalheader-color-border, var(--slds-g-color-border-1));
|
|
31
|
+
background-color: var(--slds-c-modalheader-color-background, var(--slds-g-color-surface-container-1));
|
|
32
|
+
color: var(--slds-c-modalheader-text-color);
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
padding-block-start: var(--slds-c-modalheader-spacing-block-start, var(--slds-g-spacing-4));
|
|
35
|
+
padding-inline-end: var(--slds-c-modalheader-spacing-inline-end, var(--slds-g-spacing-4));
|
|
36
|
+
padding-block-end: var(--slds-c-modalheader-spacing-block-end, var(--slds-g-spacing-4));
|
|
37
|
+
padding-inline-start: var(--slds-c-modalheader-spacing-inline-start, var(--slds-g-spacing-4));
|
|
38
|
+
text-align: center;
|
|
39
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-deprecated */
|
|
40
|
+
|
|
41
|
+
/* stylelint-enable sds-stylelint-plugin/styling-hooks-pattern */
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([data-render-mode="shadow"]) .slds-modal__title {
|
|
45
|
+
font-weight: var(--slds-c-modalheader-heading-font-weight);
|
|
46
|
+
font-size: var(--slds-c-modalheader-heading-font-size, 1.25rem);
|
|
47
|
+
line-height: var(--slds-c-modalheader-heading-font-lineheight, var(--slds-g-font-lineheight-2));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Sizes: Full */
|
|
51
|
+
|
|
52
|
+
/* Original SLDS implementation was desktop-first. This is now mobile-first for <=480px */
|
|
53
|
+
|
|
54
|
+
@media (width <= 30em) {
|
|
55
|
+
:host([data-render-mode="shadow"][data-size='full']) [part='modal-header'] {
|
|
56
|
+
grid-area: header;
|
|
57
|
+
border-start-start-radius: 0;
|
|
58
|
+
border-start-end-radius: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* INTERNAL USE ONLY - SUBJECT TO CHANGE AND REMOVAL
|
|
63
|
+
*
|
|
64
|
+
* SLDS Blueprint <> LBC Parity Patch
|
|
65
|
+
*
|
|
66
|
+
* SLDS blueprints and LBC implementation are not 1:1. This patch is needed to
|
|
67
|
+
* account for the differences introduced in the LBC implementation. Location
|
|
68
|
+
* of this code would ideally live within the LBC component CSS module but
|
|
69
|
+
* synthetic shadow and how LBC deconstructs the modal into individual components
|
|
70
|
+
* makes this not feasible. Not ideal, but this is the best solution for now.
|
|
71
|
+
* Selectors are scoped to lightning-* to avoid any potential outside conflicts.
|
|
72
|
+
*/
|
|
73
|
+
:host([data-render-mode="shadow"][data-size='full']) {
|
|
74
|
+
display: contents;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
|
|
3
3
|
<isExposed>true</isExposed>
|
|
4
|
+
<capabilities>
|
|
5
|
+
<capability>lightning__ServerRenderableWithHydration</capability>
|
|
6
|
+
</capabilities>
|
|
4
7
|
</LightningComponentBundle>
|
|
@@ -272,7 +272,14 @@ export default class LightningMenuItem extends LightningShadowBaseClass {
|
|
|
272
272
|
event.preventDefault();
|
|
273
273
|
} else {
|
|
274
274
|
// do nothing and take default action of navigating to the specified
|
|
275
|
-
// href
|
|
275
|
+
// href, unless value exists and cancelled.
|
|
276
|
+
if (this.value) {
|
|
277
|
+
// override href logic
|
|
278
|
+
const cancelled = !this.dispatchSelect();
|
|
279
|
+
if (cancelled) {
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
276
283
|
}
|
|
277
284
|
} else {
|
|
278
285
|
event.preventDefault();
|
|
@@ -294,7 +301,15 @@ export default class LightningMenuItem extends LightningShadowBaseClass {
|
|
|
294
301
|
// follow HREF if a value was provided
|
|
295
302
|
if (this.href) {
|
|
296
303
|
// trigger click behavior
|
|
297
|
-
this.
|
|
304
|
+
if (this.value) {
|
|
305
|
+
// override href logic
|
|
306
|
+
const cancelled = !this.dispatchSelect();
|
|
307
|
+
if (!cancelled) {
|
|
308
|
+
this.template.querySelector('a').click();
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
this.template.querySelector('a').click();
|
|
312
|
+
}
|
|
298
313
|
} else {
|
|
299
314
|
// if no HREF is provided follow usual select behavior
|
|
300
315
|
this.dispatchSelect();
|
|
@@ -312,7 +327,7 @@ export default class LightningMenuItem extends LightningShadowBaseClass {
|
|
|
312
327
|
**/
|
|
313
328
|
dispatchSelect() {
|
|
314
329
|
if (!this.disabled) {
|
|
315
|
-
this.dispatchEvent(
|
|
330
|
+
return this.dispatchEvent(
|
|
316
331
|
new CustomEvent('privateselect', {
|
|
317
332
|
bubbles: true,
|
|
318
333
|
cancelable: true,
|
|
@@ -322,6 +337,7 @@ export default class LightningMenuItem extends LightningShadowBaseClass {
|
|
|
322
337
|
})
|
|
323
338
|
);
|
|
324
339
|
}
|
|
340
|
+
return true;
|
|
325
341
|
}
|
|
326
342
|
|
|
327
343
|
/**
|
|
@@ -579,11 +579,13 @@ export default class LightningModalBase extends LightningShadowBaseClass {
|
|
|
579
579
|
// headerLabelIsPopulated is equivalent labelIsEmpty, but from modalHeader level
|
|
580
580
|
if (headerRegistered) {
|
|
581
581
|
if (headerLabelId && headerLabelIsPopulated) {
|
|
582
|
-
this.ariaObserver
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
582
|
+
if (this.ariaObserver) {
|
|
583
|
+
this.ariaObserver.connect({
|
|
584
|
+
targetNode: this.modalWrapper,
|
|
585
|
+
attribute: 'aria-labelledby',
|
|
586
|
+
relatedNodes: [this.headerTitleRef],
|
|
587
|
+
});
|
|
588
|
+
}
|
|
587
589
|
synchronizeAttrs(this.modalWrapper, { [ARIA.LABEL]: null });
|
|
588
590
|
// if labelId not set OR header label value not set,
|
|
589
591
|
// must console.error
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import labelNoneLabel from '@salesforce/label/LightningPicklist.noneLabel';
|
|
2
2
|
import labelAvailable from '@salesforce/label/LightningPicklist.available';
|
|
3
3
|
import labelChosen from '@salesforce/label/LightningPicklist.chosen';
|
|
4
|
-
import {
|
|
4
|
+
import { api } from 'lwc';
|
|
5
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
5
6
|
import { normalizeBoolean, arraysEqual } from 'lightning/utilsPrivate';
|
|
6
7
|
import formFactor from '@salesforce/client/formFactor';
|
|
7
8
|
import { isCSR } from 'lightning/utilsPrivate';
|
|
@@ -13,7 +14,7 @@ const i18n = {
|
|
|
13
14
|
};
|
|
14
15
|
const PROGRAMMATIC_CHANGE = true;
|
|
15
16
|
|
|
16
|
-
export default class LightningPicklist extends
|
|
17
|
+
export default class LightningPicklist extends LightningShadowBaseClass {
|
|
17
18
|
static delegatesFocus = true;
|
|
18
19
|
|
|
19
20
|
// The value that is passed into the sub-components. dual-listbox accepts an array whereas combobox expects a string
|
|
@@ -362,7 +362,7 @@ export default class LightningPill extends LightningShadowBaseClass {
|
|
|
362
362
|
handleBlur(event) {
|
|
363
363
|
event.stopPropagation();
|
|
364
364
|
const pillRelatedTarget =
|
|
365
|
-
event.relatedTarget || event.detail[buttonRelatedTarget];
|
|
365
|
+
event.relatedTarget || event.detail?.[buttonRelatedTarget];
|
|
366
366
|
if (!pillRelatedTarget || !this.template.contains(pillRelatedTarget))
|
|
367
367
|
this.dispatchBlurEvent(pillRelatedTarget);
|
|
368
368
|
}
|