lightning-base-components 1.14.6-alpha → 1.15.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 +31 -4
- package/package.json +13 -2
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/scopedImports/@salesforce-label-LightningMap.defaultTitle.js +1 -0
- package/scopedImports/@salesforce-label-LightningProgressBar.progressBar.js +1 -0
- package/src/lightning/alert/__docs__/alert.md +99 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.js +14 -0
- package/src/lightning/alert/alert.html +3 -0
- package/src/lightning/alert/alert.js +78 -0
- package/src/lightning/alert/alert.js-meta.xml +6 -0
- package/src/lightning/baseCombobox/baseCombobox.html +2 -1
- package/src/lightning/baseCombobox/baseCombobox.js +41 -6
- package/src/lightning/button/__wdio__/utam/utam.html +3 -0
- package/src/lightning/button/__wdio__/utam/utam.js +3 -0
- package/src/lightning/button/__wdio__/utam/utam.spec.js +20 -0
- package/src/lightning/button/button.js +22 -1
- package/src/lightning/buttonMenu/buttonMenu.js +12 -0
- package/src/lightning/checkboxGroup/checkboxGroup.html +2 -2
- package/src/lightning/checkboxGroup/checkboxGroup.js +9 -5
- package/src/lightning/combobox/__docs__/combobox.md +3 -1
- package/src/lightning/combobox/combobox.js +0 -1
- package/src/lightning/confirm/__docs__/confirm.md +98 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.js +14 -0
- package/src/lightning/confirm/confirm.html +3 -0
- package/src/lightning/confirm/confirm.js +80 -0
- package/src/lightning/confirm/confirm.js-meta.xml +6 -0
- package/src/lightning/datatable/__docs__/datatable.md +45 -0
- package/src/lightning/datatable/__wdio__/utam/utam.html +32 -0
- package/src/lightning/datatable/__wdio__/utam/utam.js +91 -0
- package/src/lightning/datatable/__wdio__/utam/utam.spec.js +214 -0
- package/src/lightning/datatable/columns.js +166 -71
- package/src/lightning/datatable/datatable.js +103 -20
- package/src/lightning/datatable/headerActions.js +2 -2
- package/src/lightning/datatable/inlineEdit.js +0 -5
- package/src/lightning/datatable/inlineEditShared.js +4 -2
- package/src/lightning/datatable/keyboard.js +17 -13
- package/src/lightning/datatable/renderManager.js +45 -13
- package/src/lightning/datatable/resizeSensor.js +11 -3
- package/src/lightning/datatable/rowSelection.js +9 -3
- package/src/lightning/datatable/rowSelectionShared.js +33 -20
- package/src/lightning/datatable/rows.js +3 -2
- package/src/lightning/datatable/sort.js +8 -8
- package/src/lightning/datatable/state.js +9 -1
- package/src/lightning/datatable/templates/div/div.html +6 -2
- package/src/lightning/datatable/templates/table/table.html +7 -4
- package/src/lightning/datatable/tree.js +25 -0
- package/src/lightning/datatable/types.js +77 -9
- package/src/lightning/datatable/utils.js +51 -24
- package/src/lightning/datatable/virtualization.js +319 -0
- package/src/lightning/datatable/wrapText.js +54 -16
- package/src/lightning/datepicker/__perf__DISABLED/datepickerWithCalendarOpen.perf.js +55 -0
- package/src/lightning/datepicker/datepicker.html +1 -0
- package/src/lightning/datepicker/datepicker.js +10 -0
- package/src/lightning/datetimepicker/datetimepicker.html +2 -0
- package/src/lightning/datetimepicker/datetimepicker.js +8 -0
- package/src/lightning/dualListbox/dualListbox.js +2 -1
- package/src/lightning/formattedAddress/__docs__/formattedAddress.md +3 -0
- package/src/lightning/formattedAddress/__examples__/customLocale/customLocale.html +22 -0
- package/src/lightning/formattedAddress/__examples__/customLocale/customLocale.js +3 -0
- package/src/lightning/formattedAddress/formattedAddress.js +7 -1
- package/src/lightning/groupedCombobox/groupedCombobox.html +2 -1
- package/src/lightning/groupedCombobox/groupedCombobox.js +16 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +8 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +8 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +4 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +4 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +5 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +5 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/input/__docs__/input.md +2 -0
- package/src/lightning/input/input.html +6 -0
- package/src/lightning/input/input.js +2 -1
- package/src/lightning/inputAddress/__docs__/inputAddress.md +5 -0
- package/src/lightning/inputAddress/__examples__/customLocale/customLocale.html +12 -0
- package/src/lightning/inputAddress/__examples__/customLocale/customLocale.js +3 -0
- package/src/lightning/inputAddress/inputAddress.html +2 -0
- package/src/lightning/inputAddress/inputAddress.js +26 -3
- package/src/lightning/inputName/__docs__/inputName.md +2 -0
- package/src/lightning/inputName/inputName.html +4 -1
- package/src/lightning/inputUtils/inputUtils.js +11 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.css +494 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.html +63 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js +200 -0
- package/src/lightning/menuItem/menuItem.js +4 -1
- package/src/lightning/modalBase/modalBase.css +20 -0
- package/src/lightning/modalBase/modalBase.html +54 -0
- package/src/lightning/modalBase/modalBase.js +1039 -0
- package/src/lightning/overlay/__docs__/overlay.md +90 -0
- package/src/lightning/overlay/__examples__/alert/alert.html +27 -0
- package/src/lightning/overlay/__examples__/alert/alert.js +33 -0
- package/src/lightning/overlay/__examples__/basic/basic.css +7 -0
- package/src/lightning/overlay/__examples__/basic/basic.html +18 -0
- package/src/lightning/overlay/__examples__/basic/basic.js +61 -0
- package/src/lightning/overlay/__examples__/demo/demo.html +29 -0
- package/src/lightning/overlay/__examples__/demo/demo.js +40 -0
- package/src/lightning/overlay/__examples__/panel/panel.html +17 -0
- package/src/lightning/overlay/__examples__/panel/panel.js +21 -0
- package/src/lightning/overlay/overlay.html +3 -0
- package/src/lightning/overlay/overlay.js +45 -0
- package/src/lightning/overlayContainer/__docs__/overlayContainer.md +0 -0
- package/src/lightning/overlayContainer/overlayContainer.html +3 -0
- package/src/lightning/overlayContainer/overlayContainer.js +138 -0
- package/src/lightning/overlayManager/overlayManager.js +54 -0
- package/src/lightning/overlayUtils/overlayUtils.js +17 -0
- package/src/lightning/picklist/picklist.js +6 -1
- package/src/lightning/progressBar/progressBar.html +2 -1
- package/src/lightning/progressBar/progressBar.js +18 -1
- package/src/lightning/prompt/__docs__/prompt.md +100 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.js +15 -0
- package/src/lightning/prompt/prompt.css +81 -0
- package/src/lightning/prompt/prompt.html +8 -0
- package/src/lightning/prompt/prompt.js +92 -0
- package/src/lightning/prompt/prompt.js-meta.xml +6 -0
- package/src/lightning/radioGroup/radioGroup.js +9 -0
- package/src/lightning/select/select.html +3 -1
- package/src/lightning/select/select.js +5 -1
- package/src/lightning/textarea/textarea.html +1 -0
- package/src/lightning/textarea/textarea.js +5 -0
- package/src/lightning/timepicker/timepicker.html +3 -1
- package/src/lightning/timepicker/timepicker.js +8 -0
- package/src/lightning/utilsPrivate/aria.js +26 -0
- package/src/lightning/utilsPrivate/linkify.js +1 -1
- package/src/lightning/utilsPrivate/utilsPrivate.js +7 -1
- package/src/lightning/icon/__component__/icon-spirite.spec.js +0 -59
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg class={computedClass} focusable="false" data-key={name} aria-hidden="true" viewBox="0 0 52 52">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M12.1 32.3a5 5 0 01-5 5 5 5 0 010-10h5zM14.6 32.3a5 5 0 015-5 5.08 5.08 0 015 5V45a5 5 0 01-5 5 5.08 5.08 0 01-5-5zM19.7 12.1a5 5 0 01-5-5 5 5 0 0110 0v5zM19.7 14.6a5 5 0 015 5 5.08 5.08 0 01-5 5H7a5 5 0 01-5-5 5.08 5.08 0 015-5zM39.9 19.7a5 5 0 115 5h-5zM37.4 19.7a5 5 0 01-10 0V7a5 5 0 015-5 5.08 5.08 0 015 5zM32.3 39.9a5 5 0 11-5 5v-5zM32.3 37.4a5 5 0 01-5-5 5.08 5.08 0 015-5H45a5 5 0 015 5 5.08 5.08 0 01-5 5z"></path>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg class={computedClass} focusable="false" data-key={name} aria-hidden="true" viewBox="0 0 52 52">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M33.9 27.2h-6.6v7.2h-2.6v-7.2h-6.6v-2.6h6.6v-7.2h2.6v7.2h6.6zM20.7 36.5h-5.9v-6.6h-2.2v6.6h-6v2h6V45h2.2v-6.5h5.9zM45.5 13.2h-5.9V6.7h-2.2v6.5h-5.9v2.1h5.9v6.5h2.2v-6.5h5.9zM31 43.6h-4v-4.5h-1.9v4.5H21v1.8h4.1V50H27v-4.6h4zM20.7 13.2h-6V6.7h-2.1v6.5h-6v2h6v6.6h2.1v-6.6h6zM50 25h-4v-4.5h-1.9V25H40v1.8h4.1v4.5H46v-4.5h4zM45.5 36.5h-5.9v-6.6h-2.2v6.6h-5.9v2h5.9V45h2.2v-6.5h5.9zM30.7 6.5h-4V2h-1.4v4.5h-4v1.4h4v4.4h1.5V7.9h4zM11.4 25.2h-4v-4.4H6v4.4H2v1.4h4V31h1.4v-4.4h4z"></path>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg class={computedClass} focusable="false" data-key={name} aria-hidden="true" viewBox="0 0 52 52">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M49.69 4.64l-.06-.07-2.2-2.21a1.81 1.81 0 00-2.53.35L34.4 13.18l-2.29 2.29H9.21a2.13 2.13 0 00-2.13 2.13v16.8a2.13 2.13 0 002.13 2.13h1.84L2.68 44.9a2 2 0 00-.32 2.52l2.21 2.21A1.75 1.75 0 007 49.38l.06-.07L49.32 7.09a1.75 1.75 0 00.37-2.45zM32.68 35.92a2.13 2.13 0 002.13-2.13v-4.34l8.6 6.15a.87.87 0 001.49-.6V17.82l-18.09 18.1z" fill-rule="evenodd"></path>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -544,6 +544,8 @@ define a pattern for field validation.
|
|
|
544
544
|
|
|
545
545
|
An input field for entering text. This is the default input type.
|
|
546
546
|
|
|
547
|
+
The `value` attribute for this input type only supports string values. To clear a text field by setting the `value` attribute, use `""` to specify an empty string because `null` isn't supported.
|
|
548
|
+
|
|
547
549
|
```html
|
|
548
550
|
<template>
|
|
549
551
|
<lightning-input label="Name"> </lightning-input>
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
<span class={computedLabelClass}>{label}</span>
|
|
66
66
|
<input type="checkbox" id="checkbox-toggle"
|
|
67
67
|
aria-label={computedAriaLabel}
|
|
68
|
+
aria-invalid={computedAriaInvalid}
|
|
68
69
|
accesskey={accesskey}
|
|
69
70
|
onblur={handleBlur}
|
|
70
71
|
onfocus={handleFocus}
|
|
@@ -101,6 +102,7 @@
|
|
|
101
102
|
</template>
|
|
102
103
|
<input type="checkbox" id="checkbox"
|
|
103
104
|
aria-label={computedAriaLabel}
|
|
105
|
+
aria-invalid={computedAriaInvalid}
|
|
104
106
|
accesskey={accesskey}
|
|
105
107
|
onblur={handleBlur}
|
|
106
108
|
onfocus={handleFocus}
|
|
@@ -127,6 +129,7 @@
|
|
|
127
129
|
<div class="slds-checkbox_add-button">
|
|
128
130
|
<input type="checkbox" id="checkbox-button"
|
|
129
131
|
aria-label={computedAriaLabel}
|
|
132
|
+
aria-invalid={computedAriaInvalid}
|
|
130
133
|
accesskey={accesskey}
|
|
131
134
|
class="slds-assistive-text"
|
|
132
135
|
onblur={handleBlur}
|
|
@@ -146,6 +149,7 @@
|
|
|
146
149
|
<div class="slds-form-element__control">
|
|
147
150
|
<span class="slds-radio">
|
|
148
151
|
<input type="radio" id="radio"
|
|
152
|
+
aria-invalid={computedAriaInvalid}
|
|
149
153
|
accesskey={accesskey}
|
|
150
154
|
onblur={handleBlur}
|
|
151
155
|
onfocus={handleFocus}
|
|
@@ -174,6 +178,7 @@
|
|
|
174
178
|
<lightning-primitive-file-droppable-zone multiple={multiple} disabled={disabled}>
|
|
175
179
|
<input type="file" id="input-file"
|
|
176
180
|
aria-label={computedAriaLabel}
|
|
181
|
+
aria-invalid={computedAriaInvalid}
|
|
177
182
|
accesskey={accesskey}
|
|
178
183
|
class="slds-file-selector__input slds-assistive-text"
|
|
179
184
|
onblur={handleBlur}
|
|
@@ -228,6 +233,7 @@
|
|
|
228
233
|
autocomplete={autocomplete}
|
|
229
234
|
accesskey={accesskey}
|
|
230
235
|
aria-label={computedAriaLabel}
|
|
236
|
+
aria-invalid={computedAriaInvalid}
|
|
231
237
|
disabled={disabled}
|
|
232
238
|
minlength="4"
|
|
233
239
|
maxlength="7"
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
synchronizeAttrs,
|
|
31
31
|
decorateInputForDragon,
|
|
32
32
|
setDecoratedDragonInputValueWithoutEvent,
|
|
33
|
+
computeAriaInvalid,
|
|
33
34
|
} from 'lightning/utilsPrivate';
|
|
34
35
|
import AriaObserver from 'lightning/ariaObserver';
|
|
35
36
|
import { normalizeInput } from './normalize';
|
|
@@ -1178,7 +1179,7 @@ export default class LightningInput extends LightningElement {
|
|
|
1178
1179
|
|
|
1179
1180
|
get computedAriaInvalid() {
|
|
1180
1181
|
// W-8796658: aria-invalid should always follow the visual indication of errors
|
|
1181
|
-
return
|
|
1182
|
+
return computeAriaInvalid(this._helpMessage, this.value);
|
|
1182
1183
|
}
|
|
1183
1184
|
|
|
1184
1185
|
get isLabelHidden() {
|
|
@@ -6,6 +6,9 @@ examples:
|
|
|
6
6
|
- name: stateAndCountryPicklists
|
|
7
7
|
label: Address With State and Country Picklists
|
|
8
8
|
description: Address fields support predefined lists of states and countries.
|
|
9
|
+
- name: customLocale
|
|
10
|
+
label: Address With Custom Locale
|
|
11
|
+
description: Address input fields ordered depending on custom locale value.
|
|
9
12
|
---
|
|
10
13
|
|
|
11
14
|
A `lightning-input-address` component creates a compound field that includes the following constituent fields.
|
|
@@ -290,6 +293,8 @@ The `label` attribute creates an HTML `<label>` element for your address.
|
|
|
290
293
|
To hide the compound field label from view and make it available to assistive technology, use the `label-hidden` variant.
|
|
291
294
|
This variant keeps the constituent field labels in view.
|
|
292
295
|
|
|
296
|
+
This component uses `button` elements for picklists to comply with the [Lightning Design System combobox blueprint](https://www.lightningdesignsystem.com/components/combobox/#%22Input%22-markup) for select-only comboboxes.
|
|
297
|
+
|
|
293
298
|
#### Custom Events
|
|
294
299
|
|
|
295
300
|
**`change`**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lightning-input-address
|
|
3
|
+
address-label="Address"
|
|
4
|
+
street-label="Street"
|
|
5
|
+
city-label="City"
|
|
6
|
+
country-label="Country"
|
|
7
|
+
province-label="Prefecture"
|
|
8
|
+
postal-code-label="Postal Code"
|
|
9
|
+
locale="ja-JP"
|
|
10
|
+
field-level-help="Help Text for input address field" >
|
|
11
|
+
</lightning-input-address>
|
|
12
|
+
</template>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
class="slds-form-element slds-show slds-size_6-of-6"
|
|
16
16
|
onchange={handleAddress}
|
|
17
17
|
placeholder={addressLookupPlaceholder}
|
|
18
|
+
label={addressLookupLabel}
|
|
18
19
|
disabled={disabled}>
|
|
19
20
|
</lightning-lookup-address>
|
|
20
21
|
</div>
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
<template if:true={field.isPicklist}>
|
|
66
67
|
<lightning-picklist
|
|
67
68
|
key={field.name}
|
|
69
|
+
suppress-none-option={field.suppressNoneOption}
|
|
68
70
|
data-field={field.name}
|
|
69
71
|
class={field.classnames}
|
|
70
72
|
name={field.name}
|
|
@@ -111,6 +111,13 @@ export default class LightningInputAddress extends LightningElement {
|
|
|
111
111
|
*/
|
|
112
112
|
@api addressLookupPlaceholder;
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* The label for the address lookup field option.
|
|
116
|
+
* Only visible when show-address-lookup is set to true and label string is passed
|
|
117
|
+
* @type {string}
|
|
118
|
+
*/
|
|
119
|
+
@api addressLookupLabel;
|
|
120
|
+
|
|
114
121
|
/**
|
|
115
122
|
* The array of label-value pairs for the province. Displays a dropdown menu of options.
|
|
116
123
|
* @type {list}
|
|
@@ -130,6 +137,12 @@ export default class LightningInputAddress extends LightningElement {
|
|
|
130
137
|
*/
|
|
131
138
|
@api countryDisabled;
|
|
132
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Determines the order of the inputs for the address field.
|
|
142
|
+
* @type {string}
|
|
143
|
+
*/
|
|
144
|
+
@api locale = locale;
|
|
145
|
+
|
|
133
146
|
@track _showAddressLookup;
|
|
134
147
|
@track _fieldLevelHelp;
|
|
135
148
|
@track _variant;
|
|
@@ -469,12 +482,12 @@ export default class LightningInputAddress extends LightningElement {
|
|
|
469
482
|
get inputOrder() {
|
|
470
483
|
const hasCountryPicklist =
|
|
471
484
|
this.fieldsTypeMeta.country.type === FIELD_TYPE.PICKLIST;
|
|
472
|
-
const [langCode, countryCode] = locale.split('-');
|
|
485
|
+
const [langCode, countryCode] = this.locale.split('-');
|
|
473
486
|
return getInputOrder(langCode, countryCode, hasCountryPicklist);
|
|
474
487
|
}
|
|
475
488
|
|
|
476
489
|
get requiredFields() {
|
|
477
|
-
const [langCode, countryCode] = locale.split('-');
|
|
490
|
+
const [langCode, countryCode] = this.locale.split('-');
|
|
478
491
|
return getRequiredFields(langCode, countryCode);
|
|
479
492
|
}
|
|
480
493
|
|
|
@@ -502,18 +515,28 @@ export default class LightningInputAddress extends LightningElement {
|
|
|
502
515
|
const rowList = row.map((field) => {
|
|
503
516
|
const { name, type, required, maxlength, autocomplete } = field;
|
|
504
517
|
const widthClass = getFieldWidthClass(field);
|
|
518
|
+
const value = this.getFieldValue(name);
|
|
519
|
+
const suppressNoneOption =
|
|
520
|
+
this.required &&
|
|
521
|
+
!!required &&
|
|
522
|
+
type === FIELD_TYPE.PICKLIST &&
|
|
523
|
+
value &&
|
|
524
|
+
value !== ''
|
|
525
|
+
? true
|
|
526
|
+
: false;
|
|
505
527
|
|
|
506
528
|
return {
|
|
507
529
|
isInput: type === FIELD_TYPE.INPUT,
|
|
508
530
|
isPicklist: type === FIELD_TYPE.PICKLIST,
|
|
509
531
|
isTextArea: type === FIELD_TYPE.TEXTAREA,
|
|
510
|
-
value:
|
|
532
|
+
value: value,
|
|
511
533
|
options: this.getFieldOptions(name),
|
|
512
534
|
required: this.required && !!required,
|
|
513
535
|
disabled: this.getFieldDisabled(name) || this.disabled,
|
|
514
536
|
classnames: `slds-form-element slds-show ${widthClass}`,
|
|
515
537
|
placeholder: this.getFieldPlaceholder(name),
|
|
516
538
|
label: this.getFieldLabel(name),
|
|
539
|
+
suppressNoneOption: suppressNoneOption,
|
|
517
540
|
autocomplete,
|
|
518
541
|
maxlength,
|
|
519
542
|
name,
|
|
@@ -154,6 +154,8 @@ See the __Custom Events__ section for a list of `event.target` properties. For m
|
|
|
154
154
|
You can use custom labels that display translated values. For more information, see the
|
|
155
155
|
[Access Static Resources, Labels, Internationalization Properties, and User IDs](docs/component-library/documentation/lwc/create_global_value_providers).
|
|
156
156
|
|
|
157
|
+
This component uses `button` elements for dropdown menus to comply with the [Lightning Design System combobox blueprint](https://www.lightningdesignsystem.com/components/combobox/#%22Input%22-markup) for select-only comboboxes.
|
|
158
|
+
|
|
157
159
|
#### Input Validation
|
|
158
160
|
|
|
159
161
|
When you set `required`, a red asterisk is displayed on the Last Name
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
<fieldset class="slds-form-element">
|
|
3
3
|
<legend class={computedLegendClass}>
|
|
4
4
|
<template if:true={required}>
|
|
5
|
-
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
5
|
+
<abbr class="slds-required" title={i18n.required} aria-hidden="true">*</abbr>
|
|
6
6
|
</template>
|
|
7
7
|
{label}
|
|
8
|
+
<template if:true={required}>
|
|
9
|
+
<span class="slds-assistive-text">{i18n.required}</span>
|
|
10
|
+
</template>
|
|
8
11
|
</legend>
|
|
9
12
|
<template if:true={fieldLevelHelp}>
|
|
10
13
|
<lightning-helptext content={fieldLevelHelp}></lightning-helptext>
|
|
@@ -15,3 +15,14 @@ export function isEmptyString(s) {
|
|
|
15
15
|
(typeof s === 'string' && s.trim() === '')
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
export function isEmptyObject(obj) {
|
|
20
|
+
if (obj === undefined || obj === null || typeof obj !== 'object') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
// eslint-disable-next-line guard-for-in
|
|
24
|
+
for (const name in obj) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|