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
|
@@ -12,7 +12,7 @@ export function addTableHeight(state, prevData, newData) {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* resets state properties relevant to virtualization
|
|
15
|
-
* rowHeights
|
|
15
|
+
* rowHeights
|
|
16
16
|
*
|
|
17
17
|
* @param {Object} state - datatable state
|
|
18
18
|
*/
|
|
@@ -43,7 +43,7 @@ export function resetRowHeights(state) {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* updates state properties relevant to virtualization
|
|
46
|
-
* rowHeights
|
|
46
|
+
* rowHeights
|
|
47
47
|
*
|
|
48
48
|
* @param {Node} template - the custom element root `this.template` from datatable.js
|
|
49
49
|
* @param {Object} state - datatable state
|
|
@@ -71,7 +71,7 @@ export function handleVariableRowHeights(template, state, renderedRows) {
|
|
|
71
71
|
if (rowElement) {
|
|
72
72
|
// first rendered row needs height increased by 1 to account for missing border
|
|
73
73
|
let height = rowElement.getBoundingClientRect().height;
|
|
74
|
-
if (row.rowIndex === currentRange.start) {
|
|
74
|
+
if (row.rowIndex && row.rowIndex === currentRange.start) {
|
|
75
75
|
height++;
|
|
76
76
|
}
|
|
77
77
|
state.heightCache[row.key] = height;
|
|
@@ -102,10 +102,7 @@ export function handleVariableRowHeights(template, state, renderedRows) {
|
|
|
102
102
|
* for a given scrollTop value
|
|
103
103
|
*/
|
|
104
104
|
export function findFirstVisibleIndex(state, scrollTop) {
|
|
105
|
-
const { offsetRanges, offsets, rowHeight
|
|
106
|
-
if (virtualize && fixedHeight) {
|
|
107
|
-
return Math.floor(scrollTop / rowHeight);
|
|
108
|
-
}
|
|
105
|
+
const { offsetRanges, offsets, rowHeight } = state;
|
|
109
106
|
let start = 0;
|
|
110
107
|
let end = offsetRanges.length - 1;
|
|
111
108
|
|
|
@@ -133,7 +130,7 @@ export function findFirstVisibleIndex(state, scrollTop) {
|
|
|
133
130
|
// use scrollTop and rowHeight to calculate firstVisibleIndex
|
|
134
131
|
const diff = scrollTop - endOffset;
|
|
135
132
|
const extraRows = Math.floor(diff / rowHeight);
|
|
136
|
-
state.
|
|
133
|
+
state.firstRowOffset = diff % rowHeight;
|
|
137
134
|
return prevRange.end + extraRows;
|
|
138
135
|
}
|
|
139
136
|
// update start or end for next round of binary search
|
|
@@ -319,7 +316,7 @@ function checkOverlap(range1, range2) {
|
|
|
319
316
|
|
|
320
317
|
/**
|
|
321
318
|
* updates scrollTop and top values for rows when
|
|
322
|
-
* using virtualization
|
|
319
|
+
* using virtualization
|
|
323
320
|
*/
|
|
324
321
|
function updateVirtualizeStyles(template, state, renderedRows) {
|
|
325
322
|
// update scrollTop so firstVisibleIndex is correctly placed in viewport
|
|
@@ -328,12 +325,12 @@ function updateVirtualizeStyles(template, state, renderedRows) {
|
|
|
328
325
|
state.offsets[state.firstVisibleIndex] + state.firstRowOffset;
|
|
329
326
|
|
|
330
327
|
// update top of rendered rows based on offsets
|
|
331
|
-
//
|
|
332
|
-
// 1
|
|
333
|
-
|
|
328
|
+
// if first rendered row isn't first row we need to
|
|
329
|
+
// add 1 to its offset to account for missing top border
|
|
330
|
+
const addOffset = !!renderedRows[0].rowIndex;
|
|
334
331
|
renderedRows.forEach((row, index) => {
|
|
335
|
-
let top = state.offsets[row.rowIndex]
|
|
336
|
-
if (!index) {
|
|
332
|
+
let top = state.offsets[row.rowIndex];
|
|
333
|
+
if (addOffset && !index) {
|
|
337
334
|
top = top + 1; // reset first rendered row to offset in state
|
|
338
335
|
}
|
|
339
336
|
row.style = `position:absolute;top:${top}px;`;
|
|
@@ -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.
|
|
@@ -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,
|
|
@@ -318,36 +318,36 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
318
318
|
:host([data-render-mode="shadow"][variant='brand']) [part~='button'] {
|
|
319
319
|
--slds-c-button-neutral-color-background: var(
|
|
320
320
|
--slds-c-button-brand-color-background,
|
|
321
|
-
var(--slds-g-color-accent-container-
|
|
321
|
+
var(--slds-g-color-accent-container-1)
|
|
322
322
|
);
|
|
323
323
|
--slds-c-button-neutral-color-background-hover: var(
|
|
324
324
|
--slds-c-button-brand-color-background-hover,
|
|
325
|
-
var(--slds-g-color-accent-container-
|
|
325
|
+
var(--slds-g-color-accent-container-2)
|
|
326
326
|
);
|
|
327
327
|
--slds-c-button-neutral-color-background-focus: var(
|
|
328
328
|
--slds-c-button-brand-color-background-focus,
|
|
329
|
-
var(--slds-g-color-accent-container-
|
|
329
|
+
var(--slds-g-color-accent-container-2)
|
|
330
330
|
);
|
|
331
331
|
--slds-c-button-neutral-color-background-active: var(
|
|
332
332
|
--slds-c-button-brand-color-background-active,
|
|
333
|
-
var(--slds-g-color-accent-container-
|
|
333
|
+
var(--slds-g-color-accent-container-2)
|
|
334
334
|
);
|
|
335
335
|
|
|
336
336
|
--slds-c-button-neutral-color-border: var(
|
|
337
337
|
--slds-c-button-brand-color-border,
|
|
338
|
-
var(--slds-g-color-border-accent-
|
|
338
|
+
var(--slds-g-color-border-accent-1)
|
|
339
339
|
);
|
|
340
340
|
--slds-c-button-neutral-color-border-hover: var(
|
|
341
341
|
--slds-c-button-brand-color-border-hover,
|
|
342
|
-
var(--slds-g-color-border-accent-
|
|
342
|
+
var(--slds-g-color-border-accent-2)
|
|
343
343
|
);
|
|
344
344
|
--slds-c-button-neutral-color-border-focus: var(
|
|
345
345
|
--slds-c-button-brand-color-border-focus,
|
|
346
|
-
var(--slds-g-color-border-accent-
|
|
346
|
+
var(--slds-g-color-border-accent-2)
|
|
347
347
|
);
|
|
348
348
|
--slds-c-button-neutral-color-border-active: var(
|
|
349
349
|
--slds-c-button-brand-color-border-active,
|
|
350
|
-
var(--slds-g-color-border-accent-
|
|
350
|
+
var(--slds-g-color-border-accent-2)
|
|
351
351
|
);
|
|
352
352
|
|
|
353
353
|
/* Since the text color is white for all states, bypassing inheritence and setting the color value from SDS */
|
|
@@ -399,7 +399,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
399
399
|
--slds-c-button-neutral-color-border-hover: var(--slds-g-color-border-success-2);
|
|
400
400
|
--slds-c-button-neutral-color-border-focus: var(--slds-g-color-border-success-2);
|
|
401
401
|
--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-
|
|
402
|
+
--slds-c-button-neutral-text-color: var(--slds-g-color-on-success-1);
|
|
403
403
|
--slds-c-button-neutral-text-color-hover: var(--slds-g-color-on-success-1);
|
|
404
404
|
--slds-c-button-neutral-text-color-focus: var(--slds-g-color-on-success-1);
|
|
405
405
|
--slds-c-button-neutral-text-color-active: var(--slds-g-color-on-success-1);
|
|
@@ -427,8 +427,11 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
427
427
|
* SLDS light DOM.
|
|
428
428
|
*
|
|
429
429
|
* E.g. --slds-c-button-color-background
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
*/
|
|
431
|
+
/**
|
|
432
|
+
* text variant is for button-stateful
|
|
433
|
+
*/
|
|
434
|
+
:host([data-render-mode="shadow"][variant='base']) [part~='button'],:host([data-render-mode="shadow"][variant='text']) [part~='button']{
|
|
432
435
|
--sds-c-button-spacing-inline: 0;
|
|
433
436
|
--slds-c-button-neutral-text-color: var(--slds-g-color-accent-2);
|
|
434
437
|
--slds-c-button-neutral-color-border: transparent;
|
|
@@ -440,7 +443,7 @@ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
|
440
443
|
--slds-c-button-neutral-color-background-focus: transparent;
|
|
441
444
|
--slds-c-button-neutral-color-background-active: transparent;
|
|
442
445
|
}
|
|
443
|
-
:host([data-render-mode="shadow"][variant='base']) [part~='button']:disabled {
|
|
446
|
+
:host([data-render-mode="shadow"][variant='base']) [part~='button']:disabled,:host([data-render-mode="shadow"][variant='text']) [part~='button']:disabled {
|
|
444
447
|
--sds-c-button-color-background: transparent;
|
|
445
448
|
--sds-c-button-color-border: transparent;
|
|
446
449
|
}
|
|
@@ -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).
|
|
@@ -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
|
*/
|