lightning-base-components 1.21.9-alpha → 1.22.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 +9 -0
- package/package.json +3 -5
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/src/lightning/accordionSection/button.slds.css +18 -10
- package/src/lightning/baseCombobox/dropdown.slds.css +7 -7
- package/src/lightning/baseCombobox/input-text.slds.css +7 -6
- package/src/lightning/baseComboboxFormattedText/baseComboboxFormattedText.js-meta.xml +1 -1
- package/src/lightning/button/button.slds.css +18 -10
- package/src/lightning/buttonIcon/button-icon.slds.css +23 -15
- package/src/lightning/buttonIcon/buttonIcon.js +29 -26
- package/src/lightning/buttonIconStateful/button-icon.slds.css +23 -15
- package/src/lightning/buttonIconStateful/button.slds.css +18 -10
- package/src/lightning/buttonMenu/button-icon.slds.css +23 -15
- package/src/lightning/buttonMenu/button.slds.css +18 -10
- package/src/lightning/buttonMenu/dropdown.slds.css +7 -7
- package/src/lightning/buttonStateful/button-stateful.slds.css +23 -0
- package/src/lightning/buttonStateful/button.slds.css +18 -10
- package/src/lightning/buttonStateful/buttonStateful.js-meta.xml +3 -0
- package/src/lightning/calendar/calendar.lbc.native.css +1 -0
- package/src/lightning/calendar/calendar.slds.css +13 -10
- package/src/lightning/calendar/dropdown.slds.css +7 -7
- package/src/lightning/calendar/keyboard.js +11 -3
- package/src/lightning/colorPickerCustom/input-text.slds.css +7 -6
- package/src/lightning/colorPickerPanel/colorPickerPanel.js +1 -11
- package/src/lightning/combobox/combobox.html +1 -1
- package/src/lightning/combobox/combobox.js +5 -13
- package/src/lightning/combobox/form-element.slds.css +1 -1
- package/src/lightning/datatable/__examples__/withVirtualization/withVirtualization.js +0 -1
- package/src/lightning/datatable/autoWidthStrategy.js +32 -44
- package/src/lightning/datatable/columns.js +4 -1
- package/src/lightning/datatable/datatable.js +15 -34
- package/src/lightning/datatable/keyboard.js +13 -12
- package/src/lightning/datatable/renderManager.js +1 -3
- package/src/lightning/datatable/rows.js +17 -9
- package/src/lightning/datatable/state.js +0 -1
- package/src/lightning/datatable/virtualization.js +11 -14
- package/src/lightning/datepicker/form-element.slds.css +1 -1
- package/src/lightning/datepicker/input-text.slds.css +7 -6
- package/src/lightning/datetimepicker/form-element.slds.css +1 -1
- package/src/lightning/datetimepicker/input-text.slds.css +7 -6
- package/src/lightning/dualListbox/form-element.slds.css +1 -1
- 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/groupedCombobox/form-element.slds.css +1 -1
- package/src/lightning/groupedCombobox/groupedCombobox.js +21 -28
- package/src/lightning/groupedCombobox/input-text.slds.css +7 -6
- package/src/lightning/helptext/button-icon.slds.css +23 -15
- package/src/lightning/helptext/form-element.slds.css +1 -1
- package/src/lightning/helptext/helptext.html +2 -1
- package/src/lightning/helptext/helptext.js +0 -12
- package/src/lightning/helptext/helptext.js-meta.xml +3 -0
- package/src/lightning/input/form-element.slds.css +1 -1
- package/src/lightning/inputAddress/__docs__/inputAddress.md +44 -3
- package/src/lightning/inputAddress/form-element.slds.css +1 -1
- package/src/lightning/inputAddress/input-text.slds.css +7 -6
- package/src/lightning/inputAddress/inputAddress.js +8 -6
- package/src/lightning/inputLocation/form-element.slds.css +1 -1
- package/src/lightning/inputLocation/input-text.slds.css +7 -6
- package/src/lightning/inputName/form-element.slds.css +1 -1
- package/src/lightning/inputName/input-text.slds.css +7 -6
- package/src/lightning/inputName/inputName.js-meta.xml +3 -0
- package/src/lightning/interactiveDialogBase/button.slds.css +515 -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/form-element.slds.css +1 -1
- package/src/lightning/lookupAddress/lookupAddress.js-meta.xml +3 -0
- package/src/lightning/menuDivider/menuDivider.js-meta.xml +3 -0
- 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 +18 -10
- package/src/lightning/primitiveBubble/primitiveBubble.js +9 -4
- package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +1 -1
- package/src/lightning/primitiveDatatableTooltipBubble/primitiveDatatableTooltipBubble.html +1 -1
- package/src/lightning/primitiveFileDroppableZone/primitiveFileDroppableZone.js +3 -2
- package/src/lightning/primitiveHeaderActions/primitiveHeaderActions.html +1 -0
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +1 -1
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +1 -1
- package/src/lightning/primitiveInputColor/form-element.slds.css +1 -1
- package/src/lightning/primitiveInputColor/input-text.slds.css +7 -6
- package/src/lightning/primitiveInputFile/button.slds.css +18 -10
- package/src/lightning/primitiveInputFile/form-element.slds.css +1 -1
- package/src/lightning/primitiveInputFile/input-file.slds.css +3 -2
- package/src/lightning/primitiveInputSimple/form-element.slds.css +1 -1
- package/src/lightning/primitiveInputSimple/input-text.slds.css +7 -6
- package/src/lightning/primitiveInputToggle/form-element.slds.css +1 -1
- 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 +507 -0
- package/src/lightning/prompt/prompt.lbc.native.css +2 -0
- package/src/lightning/purifyLib/purify.js +838 -586
- package/src/lightning/radioGroup/form-element.slds.css +1 -1
- package/src/lightning/radioGroup/radioGroup.js-meta.xml +3 -0
- package/src/lightning/select/form-element.slds.css +1 -1
- package/src/lightning/select/select.slds.css +1 -1
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +6 -4
- package/src/lightning/tabBar/tab-bar.slds.css +17 -3
- package/src/lightning/textarea/form-element.slds.css +1 -1
- package/src/lightning/textarea/textarea.js-meta.xml +3 -0
- package/src/lightning/timepicker/form-element.slds.css +1 -1
- package/src/lightning/toast/button-icon.slds.css +23 -15
- package/src/lightning/toast/toast.js-meta.xml +3 -0
- package/src/lightning/toastContainer/toastContainer.js-meta.xml +3 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +15 -4
- package/src/lightning/utilsPrivate/utilsPrivate.js +4 -4
- package/src/lightning/verticalNavigationOverflow/button.slds.css +18 -10
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import locale from '@salesforce/i18n/locale';
|
|
2
|
-
import {
|
|
2
|
+
import { api, track } from 'lwc';
|
|
3
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
3
4
|
import { normalizeBoolean } from 'lightning/utilsPrivate';
|
|
4
5
|
import { addressFormat } from 'lightning/internationalizationLibrary';
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ const MAP_HOST = 'https://www.google.com/maps?q=';
|
|
|
10
11
|
* The link is opened in a new tab.
|
|
11
12
|
* A static map can be displayed with the address for better context.
|
|
12
13
|
*/
|
|
13
|
-
export default class LightningFormattedAddress extends
|
|
14
|
+
export default class LightningFormattedAddress extends LightningShadowBaseClass {
|
|
14
15
|
@track
|
|
15
16
|
state = {
|
|
16
17
|
street: '',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api, track } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import { dateTimeFormat } from 'lightning/internationalizationLibrary';
|
|
3
4
|
import {
|
|
4
5
|
normalizeBoolean,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
/**
|
|
10
11
|
* Displays formatted date and time.
|
|
11
12
|
*/
|
|
12
|
-
export default class LightningFormattedDateTime extends
|
|
13
|
+
export default class LightningFormattedDateTime extends LightningShadowBaseClass {
|
|
13
14
|
/**
|
|
14
15
|
* The value to be formatted, which can be a Date object, timestamp, or an ISO8601 formatted string.
|
|
15
16
|
* @type {object}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import { toFormattedLocation } from 'lightning/utilsPrivate';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Displays a geolocation in decimal degrees using the format [latitude, longitude].
|
|
6
7
|
*/
|
|
7
|
-
export default class LightningFormattedLocation extends
|
|
8
|
+
export default class LightningFormattedLocation extends LightningShadowBaseClass {
|
|
8
9
|
/**
|
|
9
10
|
* The latitude of the geolocation. Latitude values must be within -90 and 90.
|
|
10
11
|
* @type {number}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import { toNorthAmericanPhoneNumber } from 'lightning/utilsPrivate';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Displays a phone number as a hyperlink with the tel: URL scheme.
|
|
6
7
|
*/
|
|
7
|
-
export default class LightningFormattedPhone extends
|
|
8
|
+
export default class LightningFormattedPhone extends LightningShadowBaseClass {
|
|
8
9
|
/**
|
|
9
10
|
* Sets the phone number to display.
|
|
10
11
|
* @type {number}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { track, api } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import { normalizeISOTime } from 'lightning/internationalizationLibrary';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Displays a formatted time in user's locale format.
|
|
6
7
|
*/
|
|
7
|
-
export default class FormattedTime extends
|
|
8
|
+
export default class FormattedTime extends LightningShadowBaseClass {
|
|
8
9
|
@track _formattedTimeValue = null;
|
|
9
10
|
_inputValue = null;
|
|
10
11
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api, track } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import { makeAbsoluteUrl } from 'lightning/utilsPrivate';
|
|
3
4
|
import { updateRawLinkInfo } from 'lightning/routingService';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Displays a URL as a hyperlink.
|
|
7
8
|
*/
|
|
8
|
-
export default class LightningFormattedUrl extends
|
|
9
|
+
export default class LightningFormattedUrl extends LightningShadowBaseClass {
|
|
9
10
|
/**
|
|
10
11
|
* Specifies where to open the link. Options include _blank, _parent, _self, and _top.
|
|
11
12
|
* This value defaults to _self.
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -382,10 +382,7 @@ export default class LightningGroupedCombobox extends LightningShadowBaseClass {
|
|
|
382
382
|
this.interactingState.enter();
|
|
383
383
|
this._expandPillContainer = true;
|
|
384
384
|
|
|
385
|
-
|
|
386
|
-
this._hasFocus = true;
|
|
387
|
-
this.dispatchEvent(new CustomEvent('focus'));
|
|
388
|
-
}
|
|
385
|
+
this.dispatchEvent(new CustomEvent('focus'));
|
|
389
386
|
}
|
|
390
387
|
|
|
391
388
|
handlePillsFocus() {
|
|
@@ -401,36 +398,32 @@ export default class LightningGroupedCombobox extends LightningShadowBaseClass {
|
|
|
401
398
|
}
|
|
402
399
|
|
|
403
400
|
handleBlur() {
|
|
404
|
-
this._hasFocus = false;
|
|
405
|
-
|
|
406
401
|
// Once https://github.com/salesforce/lwc/issues/444 is fixed, consider switching to
|
|
407
402
|
// `onfocusout` and `event.relatedTarget` to determine whether the focus stayed in the component,
|
|
408
403
|
// this way the use of async blur can be avoided.
|
|
409
404
|
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
410
405
|
requestAnimationFrame(() => {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
pillContainer.scrollTop = 0;
|
|
430
|
-
}
|
|
406
|
+
this.interactingState.leave();
|
|
407
|
+
|
|
408
|
+
this.dispatchEvent(new CustomEvent('blur'));
|
|
409
|
+
if (this.pills && this.pills.length > 0) {
|
|
410
|
+
// Sometimes (involves focusing on lower pills) the pill container scrolls and the top
|
|
411
|
+
// line with the "+ n more" button does not show so we have to manually scroll to the top.
|
|
412
|
+
// We need to figure a better solution for this.
|
|
413
|
+
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
414
|
+
requestAnimationFrame(() => {
|
|
415
|
+
if (this._connected) {
|
|
416
|
+
// If a new pill has been added but the markup-conditional hasn't had a chance to
|
|
417
|
+
// initialize the pill container, and causes a null gack. Adding a quick safety
|
|
418
|
+
// check here to avoid this case
|
|
419
|
+
const pillContainer = this.template.querySelector(
|
|
420
|
+
'lightning-pill-container'
|
|
421
|
+
);
|
|
422
|
+
if (pillContainer) {
|
|
423
|
+
pillContainer.scrollTop = 0;
|
|
431
424
|
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
425
|
+
}
|
|
426
|
+
});
|
|
434
427
|
}
|
|
435
428
|
});
|
|
436
429
|
}
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
--sds-c-inputtext-text-color: var(--slds-c-inputtext-text-color);
|
|
247
247
|
--sds-c-inputtext-font-size: var(
|
|
248
248
|
--slds-c-inputtext-font-size,
|
|
249
|
-
var(--slds-g-font-
|
|
249
|
+
var(--slds-g-font-size-base)
|
|
250
250
|
);
|
|
251
251
|
--sds-c-inputtext-text-color-placeholder: var(
|
|
252
252
|
--slds-c-inputtext-text-color-placeholder,
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-wrap: wrap;
|
|
267
|
-
|
|
267
|
+
flex-direction: column;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Input Container
|
|
@@ -371,6 +371,10 @@
|
|
|
371
371
|
--sds-c-inputtext-color-border: var(--slds-g-color-border-disabled-1);
|
|
372
372
|
--sds-c-inputtext-text-color: var(--slds-g-color-on-disabled-2);
|
|
373
373
|
}
|
|
374
|
+
:host([data-render-mode="shadow"][disabled]) [part='input-text'] {
|
|
375
|
+
--sds-c-inputtext-text-color-placeholder:
|
|
376
|
+
var(--slds-g-color-on-disabled-2);
|
|
377
|
+
}
|
|
374
378
|
/**
|
|
375
379
|
* Label
|
|
376
380
|
*
|
|
@@ -384,10 +388,7 @@
|
|
|
384
388
|
--slds-c-inputtext-label-color,
|
|
385
389
|
var(--slds-g-color-on-surface-2)
|
|
386
390
|
);
|
|
387
|
-
font-size: var(
|
|
388
|
-
--slds-c-inputtext-label-font-size,
|
|
389
|
-
var(--slds-g-font-scale-neg-3)
|
|
390
|
-
);
|
|
391
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
391
392
|
margin-block-end: var(--slds-g-sizing-1);
|
|
392
393
|
|
|
393
394
|
/* We inline flex to control the spacing between elements and not have to rely on whitespace characters */
|
|
@@ -283,7 +283,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
283
283
|
|
|
284
284
|
/* Text color */
|
|
285
285
|
--sds-c-button-text-color: var(--slds-c-button-neutral-text-color, var(--slds-g-color-accent-2));
|
|
286
|
-
--sds-c-button-text-color-hover: var(--slds-c-button-neutral-text-color-hover, var(--slds-g-color-accent-3));
|
|
286
|
+
--sds-c-button-text-color-hover: var(--slds-c-button-neutral-text-color-hover, var(--slds-s-button-color-hover, var(--slds-g-color-accent-3)));
|
|
287
287
|
--sds-c-button-text-color-focus: var(--slds-c-button-neutral-text-color-focus, var(--slds-g-color-accent-3));
|
|
288
288
|
--sds-c-button-text-color-active: var(
|
|
289
289
|
--slds-c-button-neutral-text-color-active,
|
|
@@ -299,6 +299,14 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
299
299
|
--sds-c-button-color-border-disabled: var(--slds-g-color-border-disabled-1);
|
|
300
300
|
--sds-c-button-text-color-disabled: var(--slds-g-color-on-disabled-1);
|
|
301
301
|
--sds-c-button-color-background-disabled: var(--slds-g-color-disabled-container-1);
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Needed to override
|
|
305
|
+
* `pointer-event: none` coming from sds
|
|
306
|
+
* that prevent tooltip from showing
|
|
307
|
+
*/
|
|
308
|
+
pointer-events: auto;
|
|
309
|
+
cursor: default;
|
|
302
310
|
}
|
|
303
311
|
/**
|
|
304
312
|
* A note about fallbacks on the default variant:
|
|
@@ -318,36 +326,36 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
318
326
|
:host([data-render-mode="shadow"][variant='brand']) [part~='button'] {
|
|
319
327
|
--slds-c-button-neutral-color-background: var(
|
|
320
328
|
--slds-c-button-brand-color-background,
|
|
321
|
-
var(--slds-g-color-accent-container-
|
|
329
|
+
var(--slds-g-color-accent-container-1)
|
|
322
330
|
);
|
|
323
331
|
--slds-c-button-neutral-color-background-hover: var(
|
|
324
332
|
--slds-c-button-brand-color-background-hover,
|
|
325
|
-
var(--slds-g-color-accent-container-
|
|
333
|
+
var(--slds-g-color-accent-container-2)
|
|
326
334
|
);
|
|
327
335
|
--slds-c-button-neutral-color-background-focus: var(
|
|
328
336
|
--slds-c-button-brand-color-background-focus,
|
|
329
|
-
var(--slds-g-color-accent-container-
|
|
337
|
+
var(--slds-g-color-accent-container-2)
|
|
330
338
|
);
|
|
331
339
|
--slds-c-button-neutral-color-background-active: var(
|
|
332
340
|
--slds-c-button-brand-color-background-active,
|
|
333
|
-
var(--slds-g-color-accent-container-
|
|
341
|
+
var(--slds-g-color-accent-container-2)
|
|
334
342
|
);
|
|
335
343
|
|
|
336
344
|
--slds-c-button-neutral-color-border: var(
|
|
337
345
|
--slds-c-button-brand-color-border,
|
|
338
|
-
var(--slds-g-color-border-accent-
|
|
346
|
+
var(--slds-g-color-border-accent-1)
|
|
339
347
|
);
|
|
340
348
|
--slds-c-button-neutral-color-border-hover: var(
|
|
341
349
|
--slds-c-button-brand-color-border-hover,
|
|
342
|
-
var(--slds-g-color-border-accent-
|
|
350
|
+
var(--slds-g-color-border-accent-2)
|
|
343
351
|
);
|
|
344
352
|
--slds-c-button-neutral-color-border-focus: var(
|
|
345
353
|
--slds-c-button-brand-color-border-focus,
|
|
346
|
-
var(--slds-g-color-border-accent-
|
|
354
|
+
var(--slds-g-color-border-accent-2)
|
|
347
355
|
);
|
|
348
356
|
--slds-c-button-neutral-color-border-active: var(
|
|
349
357
|
--slds-c-button-brand-color-border-active,
|
|
350
|
-
var(--slds-g-color-border-accent-
|
|
358
|
+
var(--slds-g-color-border-accent-2)
|
|
351
359
|
);
|
|
352
360
|
|
|
353
361
|
/* Since the text color is white for all states, bypassing inheritence and setting the color value from SDS */
|
|
@@ -399,7 +407,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
399
407
|
--slds-c-button-neutral-color-border-hover: var(--slds-g-color-border-success-2);
|
|
400
408
|
--slds-c-button-neutral-color-border-focus: var(--slds-g-color-border-success-2);
|
|
401
409
|
--slds-c-button-neutral-color-border-active: var(--slds-g-color-border-success-2);
|
|
402
|
-
--slds-c-button-neutral-text-color: var(--slds-g-color-on-success-
|
|
410
|
+
--slds-c-button-neutral-text-color: var(--slds-g-color-on-success-1);
|
|
403
411
|
--slds-c-button-neutral-text-color-hover: var(--slds-g-color-on-success-1);
|
|
404
412
|
--slds-c-button-neutral-text-color-focus: var(--slds-g-color-on-success-1);
|
|
405
413
|
--slds-c-button-neutral-text-color-active: var(--slds-g-color-on-success-1);
|
|
@@ -545,19 +553,19 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
545
553
|
--sds-c-button-color-border-disabled: var(--slds-g-color-border-disabled-1);
|
|
546
554
|
}
|
|
547
555
|
/* slds-icon interaction states */
|
|
548
|
-
:host([data-render-mode="shadow"]) [part~='button-icon']:
|
|
556
|
+
:host([data-render-mode="shadow"]) [part~='button-icon']:hover {
|
|
549
557
|
--slds-c-icon-color-foreground: var(
|
|
550
|
-
--slds-c-buttonicon-color-foreground-hover,
|
|
558
|
+
--slds-c-buttonicon-color-foreground-hover,
|
|
551
559
|
var(--slds-g-color-accent-3)
|
|
552
560
|
);
|
|
553
561
|
}
|
|
554
|
-
:host([data-render-mode="shadow"]) [part~='button-icon']:
|
|
562
|
+
:host([data-render-mode="shadow"]) [part~='button-icon']:focus {
|
|
555
563
|
--slds-c-icon-color-foreground: var(
|
|
556
564
|
--slds-c-buttonicon-color-foreground-focus,
|
|
557
565
|
var(--slds-g-color-accent-3)
|
|
558
566
|
);
|
|
559
567
|
}
|
|
560
|
-
:host([data-render-mode="shadow"]) [part~='button-icon']:
|
|
568
|
+
:host([data-render-mode="shadow"]) [part~='button-icon']:active {
|
|
561
569
|
--slds-c-icon-color-foreground: var(
|
|
562
570
|
--slds-c-buttonicon-color-foreground-active,
|
|
563
571
|
var(--slds-g-color-accent-3)
|
|
@@ -635,7 +643,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
635
643
|
|
|
636
644
|
/* Icon */
|
|
637
645
|
--slds-c-buttonicon-color-foreground: var(--slds-g-color-neutral-base-100);
|
|
638
|
-
--slds-c-buttonicon-color-foreground-hover: var(--slds-g-color-
|
|
646
|
+
--slds-c-buttonicon-color-foreground-hover: color-mix(in oklab, var(--slds-g-color-on-surface-inverse-1), transparent 25%);
|
|
639
647
|
--slds-c-buttonicon-color-foreground-focus: var(--slds-g-color-neutral-base-95);
|
|
640
648
|
--slds-c-buttonicon-color-foreground-active: var(--slds-g-color-neutral-base-90);
|
|
641
649
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
icon-class={computedIconClass}
|
|
6
6
|
variant={computedButtonVariant}
|
|
7
7
|
alternative-text={alternativeText}
|
|
8
|
+
disable-alternative-text-title
|
|
8
9
|
tooltip={content}
|
|
9
|
-
onprivatebuttoniconregister={handleButtonIconRegister}
|
|
10
10
|
tabindex={tabIndex}
|
|
11
|
+
tooltip-type="toggle"
|
|
11
12
|
></lightning-button-icon>
|
|
12
13
|
</div>
|
|
13
14
|
</template>
|
|
@@ -3,7 +3,6 @@ import { api, track } from 'lwc';
|
|
|
3
3
|
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
4
4
|
import { isValidName } from 'lightning/iconUtils';
|
|
5
5
|
import { normalizeString } from 'lightning/utilsPrivate';
|
|
6
|
-
import { TooltipType } from 'lightning/tooltipLibrary';
|
|
7
6
|
|
|
8
7
|
const DEFAULT_BUTTON_ALT_TEXT = labelButtonAlternativeText;
|
|
9
8
|
const DEFAULT_ICON_NAME = 'utility:info';
|
|
@@ -145,15 +144,4 @@ export default class LightningHelptext extends LightningShadowBaseClass {
|
|
|
145
144
|
return '';
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Set lightning-button-icon tooltips to be created with toggle events
|
|
151
|
-
* and without the title attribute computed from alternative text (see W-12496300)
|
|
152
|
-
* @param {*} event
|
|
153
|
-
*/
|
|
154
|
-
handleButtonIconRegister(event) {
|
|
155
|
-
event.stopPropagation();
|
|
156
|
-
event.detail.setTooltipType(TooltipType.Toggle);
|
|
157
|
-
event.detail.showTitle(false);
|
|
158
|
-
}
|
|
159
147
|
}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -149,6 +149,7 @@ To enable autocompletion of the address fields using an address lookup field, in
|
|
|
149
149
|
```html
|
|
150
150
|
<template>
|
|
151
151
|
<lightning-input-address
|
|
152
|
+
show-address-lookup
|
|
152
153
|
address-label="Address"
|
|
153
154
|
street-label="Street"
|
|
154
155
|
city-label="City"
|
|
@@ -159,7 +160,6 @@ To enable autocompletion of the address fields using an address lookup field, in
|
|
|
159
160
|
city="San Francisco"
|
|
160
161
|
country="US"
|
|
161
162
|
province="CA"
|
|
162
|
-
show-address-lookup
|
|
163
163
|
>
|
|
164
164
|
</lightning-input-address>
|
|
165
165
|
</template>
|
|
@@ -167,9 +167,50 @@ To enable autocompletion of the address fields using an address lookup field, in
|
|
|
167
167
|
|
|
168
168
|
When you start typing an address in the lookup field, a dropdown menu displays matching addresses returned by the Google Maps Places API. Select an address from the dropdown to populate the address fields.
|
|
169
169
|
|
|
170
|
-
Using `show-address-lookup` is not supported in
|
|
170
|
+
Using `show-address-lookup` is not supported in Experience Builder sites, Lightning Out,
|
|
171
171
|
Lightning Components for Visualforce, and standalone apps. While it may work, these targets are not optimized and not officially supported.
|
|
172
172
|
|
|
173
|
+
#### Using Compact Address Fields
|
|
174
|
+
|
|
175
|
+
By default, the Street address field is a textarea field. Use compact address fields if you want to separate the Street address field into two input fields instead.
|
|
176
|
+
|
|
177
|
+
To display compact address fields, include the `show-compact-address` attribute. Use `street-label` to provide a label for the first line of address, and use `subpremise-label` for the second line of address. You can add supplementary information on this field, such as a building number or unit name.
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<lightning-input-address
|
|
181
|
+
show-compact-address
|
|
182
|
+
address-label="Address"
|
|
183
|
+
street-label="Street Line 1"
|
|
184
|
+
subpremise-label="Street Line 2"
|
|
185
|
+
city-label="City"
|
|
186
|
+
country-label="Country"
|
|
187
|
+
province-label="Province"
|
|
188
|
+
postal-code-label="Postal Code"></lightning-input-address>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### Using the Compact Address Fields with Address Lookup
|
|
192
|
+
|
|
193
|
+
To enable compact address fields with address lookup, include the `show-address-lookup` and `show-compact-address` attributes. These attributes enable the first street address field as a lookup field.
|
|
194
|
+
|
|
195
|
+
To provide a label on the second input field, use the `subpremise-label` attribute. You can provide a subpremise value using the `subpremise` attribute. The first input field continues to use `street-label`.
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<lightning-input-address
|
|
199
|
+
show-address-lookup
|
|
200
|
+
show-compact-address
|
|
201
|
+
address-label="Address"
|
|
202
|
+
street-label="Street Line 1"
|
|
203
|
+
subpremise-label="Street Line 2"
|
|
204
|
+
city-label="City"
|
|
205
|
+
country-label="Country"
|
|
206
|
+
province-label="Province"
|
|
207
|
+
postal-code-label="Postal Code"></lightning-input-address>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
When you start typing an address in the lookup field, a dropdown menu displays matching addresses returned by the Google Maps Places API. Select an address from the dropdown to populate the address fields.
|
|
211
|
+
|
|
212
|
+
The `subpremise` field doesn't require a value for submission. You can add supplementary information on this field, such as a building number or unit name.
|
|
213
|
+
|
|
173
214
|
#### Validating Required Fields
|
|
174
215
|
|
|
175
216
|
When you set `required`, a red asterisk is displayed on every address
|
|
@@ -279,7 +320,7 @@ See [Input: Styling Hooks Overview](https://www.lightningdesignsystem.com/compon
|
|
|
279
320
|
|
|
280
321
|
#### Usage Considerations
|
|
281
322
|
|
|
282
|
-
Using `show-address-lookup` is not supported in
|
|
323
|
+
Using `show-address-lookup` is not supported in Experience Builder sites, Lightning Out,
|
|
283
324
|
Lightning Components for Visualforce, and standalone apps.
|
|
284
325
|
|
|
285
326
|
When working with address fields such as with the `MailingAddress` field on Salesforce records, consider using the record form components. The `lightning-record-form`, `lightning-record-view-form`, and `lightning-record-edit-form` components provide a form-based UI that's metadata-driven. The components are automatically wired up to your record data, labels, and field-level help text. For more information, see [Work with Records Using Base Components](https://developer.salesforce.com/docs/platform/lwc/guide/data-get-user-input-intro).
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
--sds-c-inputtext-text-color: var(--slds-c-inputtext-text-color);
|
|
247
247
|
--sds-c-inputtext-font-size: var(
|
|
248
248
|
--slds-c-inputtext-font-size,
|
|
249
|
-
var(--slds-g-font-
|
|
249
|
+
var(--slds-g-font-size-base)
|
|
250
250
|
);
|
|
251
251
|
--sds-c-inputtext-text-color-placeholder: var(
|
|
252
252
|
--slds-c-inputtext-text-color-placeholder,
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-wrap: wrap;
|
|
267
|
-
|
|
267
|
+
flex-direction: column;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Input Container
|
|
@@ -371,6 +371,10 @@
|
|
|
371
371
|
--sds-c-inputtext-color-border: var(--slds-g-color-border-disabled-1);
|
|
372
372
|
--sds-c-inputtext-text-color: var(--slds-g-color-on-disabled-2);
|
|
373
373
|
}
|
|
374
|
+
:host([data-render-mode="shadow"][disabled]) [part='input-text'] {
|
|
375
|
+
--sds-c-inputtext-text-color-placeholder:
|
|
376
|
+
var(--slds-g-color-on-disabled-2);
|
|
377
|
+
}
|
|
374
378
|
/**
|
|
375
379
|
* Label
|
|
376
380
|
*
|
|
@@ -384,10 +388,7 @@
|
|
|
384
388
|
--slds-c-inputtext-label-color,
|
|
385
389
|
var(--slds-g-color-on-surface-2)
|
|
386
390
|
);
|
|
387
|
-
font-size: var(
|
|
388
|
-
--slds-c-inputtext-label-font-size,
|
|
389
|
-
var(--slds-g-font-scale-neg-3)
|
|
390
|
-
);
|
|
391
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
391
392
|
margin-block-end: var(--slds-g-sizing-1);
|
|
392
393
|
|
|
393
394
|
/* We inline flex to control the spacing between elements and not have to rely on whitespace characters */
|
|
@@ -60,7 +60,7 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* The label for the subpremise field.
|
|
63
|
-
*
|
|
63
|
+
* Use this attribute with show-compact-address.
|
|
64
64
|
* @type {string}
|
|
65
65
|
*/
|
|
66
66
|
@api subpremiseLabel;
|
|
@@ -97,7 +97,7 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* The placeholder for the subpremise field.
|
|
100
|
-
*
|
|
100
|
+
* Use this attribute with show-compact-address.
|
|
101
101
|
* @type {string}
|
|
102
102
|
*/
|
|
103
103
|
@api subpremisePlaceholder;
|
|
@@ -211,7 +211,7 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
211
211
|
/**
|
|
212
212
|
* The value for the street field.
|
|
213
213
|
* Maximum length is 255 characters when rendered as a textarea.
|
|
214
|
-
* Maximum length is 80 characters when rendered as an input
|
|
214
|
+
* Maximum length is 80 characters when rendered as an input using show-compact-address.
|
|
215
215
|
* @type {string}
|
|
216
216
|
*
|
|
217
217
|
*/
|
|
@@ -226,6 +226,7 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
226
226
|
/**
|
|
227
227
|
* The value for the subpremise field.
|
|
228
228
|
* Maximum length is 80 characters.
|
|
229
|
+
* Use this attribute with show-compact-address.
|
|
229
230
|
* @type {string}
|
|
230
231
|
*/
|
|
231
232
|
@api
|
|
@@ -306,7 +307,8 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
306
307
|
}
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
|
-
* If present, address lookup using Google Maps is
|
|
310
|
+
* If present, an address lookup field using Google Maps is displayed.
|
|
311
|
+
* When used with show-compact-address, the first street field functions as the address lookup field.
|
|
310
312
|
* @type {boolean}
|
|
311
313
|
* @default false
|
|
312
314
|
*/
|
|
@@ -320,8 +322,8 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
320
322
|
|
|
321
323
|
/**
|
|
322
324
|
* If present, the street field is rendered as two separate inputs instead of a single textarea.
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
+
* To provide a label for the first street field, use street-label.
|
|
326
|
+
* To provide a label for the second street field, use subpremise-label.
|
|
325
327
|
* @type {boolean}
|
|
326
328
|
* @default false
|
|
327
329
|
*/
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
hyphens: auto;
|
|
47
47
|
display: inline-block;
|
|
48
48
|
color: var(--slds-g-color-on-surface-2);
|
|
49
|
-
font-size: var(--slds-g-font-scale-neg-
|
|
49
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
50
50
|
padding-inline-end: var(--slds-g-spacing-2);
|
|
51
51
|
padding-block-start: var(--slds-g-spacing-1);
|
|
52
52
|
margin-block-end: calc(var(--slds-g-spacing-1) / 2);
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
--sds-c-inputtext-text-color: var(--slds-c-inputtext-text-color);
|
|
247
247
|
--sds-c-inputtext-font-size: var(
|
|
248
248
|
--slds-c-inputtext-font-size,
|
|
249
|
-
var(--slds-g-font-
|
|
249
|
+
var(--slds-g-font-size-base)
|
|
250
250
|
);
|
|
251
251
|
--sds-c-inputtext-text-color-placeholder: var(
|
|
252
252
|
--slds-c-inputtext-text-color-placeholder,
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-wrap: wrap;
|
|
267
|
-
|
|
267
|
+
flex-direction: column;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Input Container
|
|
@@ -371,6 +371,10 @@
|
|
|
371
371
|
--sds-c-inputtext-color-border: var(--slds-g-color-border-disabled-1);
|
|
372
372
|
--sds-c-inputtext-text-color: var(--slds-g-color-on-disabled-2);
|
|
373
373
|
}
|
|
374
|
+
:host([data-render-mode="shadow"][disabled]) [part='input-text'] {
|
|
375
|
+
--sds-c-inputtext-text-color-placeholder:
|
|
376
|
+
var(--slds-g-color-on-disabled-2);
|
|
377
|
+
}
|
|
374
378
|
/**
|
|
375
379
|
* Label
|
|
376
380
|
*
|
|
@@ -384,10 +388,7 @@
|
|
|
384
388
|
--slds-c-inputtext-label-color,
|
|
385
389
|
var(--slds-g-color-on-surface-2)
|
|
386
390
|
);
|
|
387
|
-
font-size: var(
|
|
388
|
-
--slds-c-inputtext-label-font-size,
|
|
389
|
-
var(--slds-g-font-scale-neg-3)
|
|
390
|
-
);
|
|
391
|
+
font-size: var(--slds-s-label-font-size, var(--slds-g-font-scale-neg-2));
|
|
391
392
|
margin-block-end: var(--slds-g-sizing-1);
|
|
392
393
|
|
|
393
394
|
/* We inline flex to control the spacing between elements and not have to rely on whitespace characters */
|