lightning-base-components 1.19.11-alpha → 1.20.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 +15 -3
- package/package.json +1 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/src/lightning/datatable/datatable.js +15 -0
- package/src/lightning/datatable/templates/div/div.html +1 -0
- package/src/lightning/datatable/templates/table/table.html +2 -1
- package/src/lightning/datepicker/datepicker.html +3 -3
- package/src/lightning/input/__docs__/input.md +8 -2
- package/src/lightning/input/input.js +16 -4
- package/src/lightning/pill/link.html +0 -1
- package/src/lightning/pill/pill.js +2 -0
- package/src/lightning/pill/plainLink.html +0 -2
- package/src/lightning/pillContainer/pillContainer.js +4 -38
- package/src/lightning/pillContainer/standardPillContainer.html +4 -4
- package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +12 -0
- package/src/lightning/progressBar/progressBar.html +3 -4
- package/src/lightning/timepicker/timepicker.html +3 -3
package/metadata/raptor.json
CHANGED
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
]
|
|
643
643
|
},
|
|
644
644
|
"commerceApi": {},
|
|
645
|
-
"
|
|
645
|
+
"commerceChannelManagementApi": {},
|
|
646
646
|
"commerceConfigurationApi": {},
|
|
647
647
|
"commerceEsfApi": {},
|
|
648
648
|
"commerceExtensionApi": {},
|
|
@@ -709,7 +709,9 @@
|
|
|
709
709
|
"dataProviderApi": {},
|
|
710
710
|
"datatable": {
|
|
711
711
|
"minVersion": "41.0",
|
|
712
|
-
"slotNames": [
|
|
712
|
+
"slotNames": [
|
|
713
|
+
"customdatatypes"
|
|
714
|
+
],
|
|
713
715
|
"properties": [
|
|
714
716
|
{
|
|
715
717
|
"name": "columnWidthsMode"
|
|
@@ -2963,6 +2965,7 @@
|
|
|
2963
2965
|
},
|
|
2964
2966
|
"placeOrderApi": {},
|
|
2965
2967
|
"placeQuoteApi": {},
|
|
2968
|
+
"platformCdpMachineLearningApi": {},
|
|
2966
2969
|
"platformContentTaxonomyApi": {},
|
|
2967
2970
|
"platformExternalServicesApi": {},
|
|
2968
2971
|
"platformGlobalizationApi": {},
|
|
@@ -3325,6 +3328,9 @@
|
|
|
3325
3328
|
{
|
|
3326
3329
|
"name": "isoDate"
|
|
3327
3330
|
},
|
|
3331
|
+
{
|
|
3332
|
+
"name": "labelHidden"
|
|
3333
|
+
},
|
|
3328
3334
|
{
|
|
3329
3335
|
"name": "locale"
|
|
3330
3336
|
},
|
|
@@ -3338,7 +3344,7 @@
|
|
|
3338
3344
|
"name": "name"
|
|
3339
3345
|
},
|
|
3340
3346
|
{
|
|
3341
|
-
"name": "
|
|
3347
|
+
"name": "readOnly"
|
|
3342
3348
|
},
|
|
3343
3349
|
{
|
|
3344
3350
|
"name": "required"
|
|
@@ -3636,6 +3642,9 @@
|
|
|
3636
3642
|
{
|
|
3637
3643
|
"name": "hreflang"
|
|
3638
3644
|
},
|
|
3645
|
+
{
|
|
3646
|
+
"name": "label"
|
|
3647
|
+
},
|
|
3639
3648
|
{
|
|
3640
3649
|
"name": "ping"
|
|
3641
3650
|
},
|
|
@@ -4513,6 +4522,9 @@
|
|
|
4513
4522
|
},
|
|
4514
4523
|
"serviceDataCategoryApi": {},
|
|
4515
4524
|
"serviceEinsteinllmApi": {},
|
|
4525
|
+
"serviceKnowledgeApi": {
|
|
4526
|
+
"minVersion": "60.0"
|
|
4527
|
+
},
|
|
4516
4528
|
"serviceNetworkDataCategoryApi": {},
|
|
4517
4529
|
"serviceServiceCatalogCategoryApi": {},
|
|
4518
4530
|
"showToastEvent": {},
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '
|
|
1
|
+
export default '248';
|
|
@@ -1230,6 +1230,21 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1230
1230
|
|
|
1231
1231
|
/************************** EVENT HANDLERS ***************************/
|
|
1232
1232
|
|
|
1233
|
+
handleCustomTypesChange() {
|
|
1234
|
+
const assignedNodes = this.template
|
|
1235
|
+
.querySelector('slot[name="customdatatypes"]')
|
|
1236
|
+
.assignedNodes();
|
|
1237
|
+
if (assignedNodes.length) {
|
|
1238
|
+
const provider = assignedNodes[0];
|
|
1239
|
+
if (typeof provider.getDataTypes === 'function') {
|
|
1240
|
+
this._privateTypes = new DatatableTypes(
|
|
1241
|
+
provider.getDataTypes()
|
|
1242
|
+
);
|
|
1243
|
+
this.updateColumns(this._columns);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1233
1248
|
/**
|
|
1234
1249
|
* Handles the `keydown` event on <table> and the
|
|
1235
1250
|
* corresponding <div> on the role-based table
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<slot onslotchange={handleCustomTypesChange} name="customdatatypes"></slot>
|
|
2
3
|
<!-- aria-live region to announce the keyboard navigation mode -->
|
|
3
4
|
<span aria-live="polite">
|
|
4
5
|
<span data-keyboard-mode="navigation" class={computedAriaLiveClassForNavMode}>{i18n.ariaLiveNavigationMode}</span>
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
<template for:each={state.columns} for:item="def" for:index="colIndex">
|
|
50
51
|
<!-- Column Header -->
|
|
51
52
|
<th style={def.style}
|
|
52
|
-
role="
|
|
53
|
+
role="columnheader"
|
|
53
54
|
scope="col"
|
|
54
55
|
tabindex={def.tabIndex}
|
|
55
56
|
aria-label={def.ariaLabel}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="slds-dropdown-trigger slds-dropdown-trigger_click slds-size_1-of-1" role="group" part="input-text">
|
|
3
3
|
<template if:false={hasExternalLabel}>
|
|
4
|
-
<template if:true={required}>
|
|
5
|
-
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
6
|
-
</template>
|
|
7
4
|
<label class={computedLabelClass} for="input" part="label">
|
|
5
|
+
<template if:true={required}>
|
|
6
|
+
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
7
|
+
</template>
|
|
8
8
|
{label}
|
|
9
9
|
</label>
|
|
10
10
|
<lightning-helptext if:true={fieldLevelHelp} content={fieldLevelHelp} alternative-text={helptextAlternativeText}></lightning-helptext>
|
|
@@ -59,7 +59,7 @@ supports the following input types:
|
|
|
59
59
|
- `checkbox`
|
|
60
60
|
- `checkbox-button`
|
|
61
61
|
- `date`
|
|
62
|
-
- `datetime`
|
|
62
|
+
- `datetime`/`datetime-local`
|
|
63
63
|
- `time`
|
|
64
64
|
- `email`
|
|
65
65
|
- `file`
|
|
@@ -71,7 +71,9 @@ supports the following input types:
|
|
|
71
71
|
- `text` (default)
|
|
72
72
|
- `toggle`
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
There is no behavioral difference between the `datetime` and `datetime-local` types.
|
|
75
|
+
|
|
76
|
+
The following HTML input types aren't supported.
|
|
75
77
|
|
|
76
78
|
- `button`
|
|
77
79
|
- `hidden`
|
|
@@ -79,6 +81,8 @@ The following HTML input types are not supported.
|
|
|
79
81
|
- `radio`
|
|
80
82
|
- `reset`
|
|
81
83
|
- `submit`
|
|
84
|
+
- `week`
|
|
85
|
+
- `month`
|
|
82
86
|
|
|
83
87
|
Use [`lightning-button`](bundle/lightning-button/documentation)
|
|
84
88
|
instead for input types `button`, `reset`, and
|
|
@@ -87,6 +91,8 @@ instead for input types `button`, `reset`, and
|
|
|
87
91
|
Use [`lightning-radio-group`](bundle/lightning-radio-group/documentation)
|
|
88
92
|
instead of input type `radio` for radio buttons.
|
|
89
93
|
|
|
94
|
+
Use [`lightning-combobox`](bundle/lightning-combobox/documentation) or input type `number` instead of input types `week` and `month`. The `week` and `month` types are browser-dependent and may cause issues with styling, accessibility, and general functionality in specific browsers.
|
|
95
|
+
|
|
90
96
|
When working with forms that interact with 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).
|
|
91
97
|
|
|
92
98
|
Alternatively, to create your own custom UI to work with Salesforce records, use `lightning-input` with the `lightning/ui*Api` wire adapters and functions, such as `getRecord` and `updateRecord`. For more information, see [Use the Wire Service with Base Components](https://developer.salesforce.com/docs/platform/lwc/guide/data-wire-base-components).
|
|
@@ -1815,16 +1815,21 @@ export default class LightningInput extends LightningElement {
|
|
|
1815
1815
|
* @returns {boolean} - wether the value is valid or not
|
|
1816
1816
|
*/
|
|
1817
1817
|
_validateType(type) {
|
|
1818
|
+
if (VALID_INPUT_TYPES.includes(type)) {
|
|
1819
|
+
return true;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
const invalidMsg = `<lightning-input> The type attribute value "${type}" is invalid.`;
|
|
1818
1823
|
assert(
|
|
1819
1824
|
type !== 'hidden',
|
|
1820
|
-
|
|
1825
|
+
`${invalidMsg} Use a regular <input type="hidden"> instead.`
|
|
1821
1826
|
);
|
|
1822
1827
|
assert(
|
|
1823
1828
|
type !== 'submit' &&
|
|
1824
1829
|
type !== 'reset' &&
|
|
1825
1830
|
type !== 'image' &&
|
|
1826
1831
|
type !== 'button',
|
|
1827
|
-
|
|
1832
|
+
`${invalidMsg} Use <lightning:button> instead.`
|
|
1828
1833
|
);
|
|
1829
1834
|
if (this.isTypeRadio) {
|
|
1830
1835
|
assert(
|
|
@@ -1832,12 +1837,19 @@ export default class LightningInput extends LightningElement {
|
|
|
1832
1837
|
`<lightning-input> The required attribute is not supported on radio inputs directly. It should be implemented at the radio group level.`
|
|
1833
1838
|
);
|
|
1834
1839
|
}
|
|
1840
|
+
|
|
1835
1841
|
if (type === 'phone') {
|
|
1836
1842
|
console.warn(
|
|
1837
|
-
|
|
1843
|
+
`${invalidMsg} Please use <lightning-input type="tel"> instead. Defaulting to text type.`
|
|
1838
1844
|
);
|
|
1845
|
+
} else if (type === 'week' || type === 'month') {
|
|
1846
|
+
console.warn(
|
|
1847
|
+
`${invalidMsg} Please use <lightning-combobox> and/or <lightning-input type="number"> instead to avoid inconsistencies and breakages across browsers.`
|
|
1848
|
+
);
|
|
1849
|
+
} else {
|
|
1850
|
+
console.warn(`${invalidMsg} Defaulting to text type.`);
|
|
1839
1851
|
}
|
|
1840
|
-
return
|
|
1852
|
+
return false;
|
|
1841
1853
|
}
|
|
1842
1854
|
|
|
1843
1855
|
/**
|
|
@@ -194,6 +194,7 @@ export default class LightningPill extends LightningElement {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
|
+
* Reserved for internal use.
|
|
197
198
|
* Specifies the aria-selected of an element.
|
|
198
199
|
*/
|
|
199
200
|
@api
|
|
@@ -206,6 +207,7 @@ export default class LightningPill extends LightningElement {
|
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
/**
|
|
210
|
+
* Reserved for internal use.
|
|
209
211
|
* Specifies the role of an element.
|
|
210
212
|
*/
|
|
211
213
|
@api
|
|
@@ -302,38 +302,9 @@ export default class LightningPillContainer extends LightningElement {
|
|
|
302
302
|
|
|
303
303
|
switchFocus(newValue) {
|
|
304
304
|
this.switchFocusedIndex(newValue);
|
|
305
|
-
this._tabFromLink = true;
|
|
306
305
|
this.focus();
|
|
307
306
|
}
|
|
308
307
|
|
|
309
|
-
moveFocus(shiftKeyPressed) {
|
|
310
|
-
if (shiftKeyPressed) {
|
|
311
|
-
switch (this._tabFromLink) {
|
|
312
|
-
case true:
|
|
313
|
-
this.switchFocusedIndex(this.focusedIndex - 1);
|
|
314
|
-
this._tabFromLink = this.focusedNode.isPlainLink
|
|
315
|
-
? false
|
|
316
|
-
: true;
|
|
317
|
-
break;
|
|
318
|
-
case false:
|
|
319
|
-
this._tabFromLink = true;
|
|
320
|
-
break;
|
|
321
|
-
default:
|
|
322
|
-
}
|
|
323
|
-
} else {
|
|
324
|
-
switch (this.focusedNode.isPlainLink && this._tabFromLink) {
|
|
325
|
-
case true:
|
|
326
|
-
this._tabFromLink = false;
|
|
327
|
-
break;
|
|
328
|
-
case false:
|
|
329
|
-
this.switchFocusedIndex(this.focusedIndex + 1);
|
|
330
|
-
this._tabFromLink = true;
|
|
331
|
-
break;
|
|
332
|
-
default:
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
308
|
handleKeyDown(event) {
|
|
338
309
|
if (this.pills.length <= 0) {
|
|
339
310
|
return;
|
|
@@ -350,13 +321,6 @@ export default class LightningPillContainer extends LightningElement {
|
|
|
350
321
|
this.switchFocus(index + 1);
|
|
351
322
|
event.preventDefault();
|
|
352
323
|
break;
|
|
353
|
-
case keyCodes.tab:
|
|
354
|
-
this.moveFocus(event.shiftKey);
|
|
355
|
-
break;
|
|
356
|
-
case keyCodes.shift:
|
|
357
|
-
case keyCodes.enter:
|
|
358
|
-
case keyCodes.space:
|
|
359
|
-
break;
|
|
360
324
|
default:
|
|
361
325
|
}
|
|
362
326
|
}
|
|
@@ -364,10 +328,12 @@ export default class LightningPillContainer extends LightningElement {
|
|
|
364
328
|
handlePillFocus(event) {
|
|
365
329
|
if (!this._hasFocus) {
|
|
366
330
|
this._hasFocus = true;
|
|
367
|
-
this._tabFromLink = true;
|
|
368
|
-
this.focusedIndex = parseInt(event.currentTarget.name, 10);
|
|
369
331
|
this.dispatchEvent(new CustomEvent('focus'));
|
|
370
332
|
}
|
|
333
|
+
const currentTargetIndex = parseInt(event.currentTarget?.name, 10);
|
|
334
|
+
this.focusedIndex = Number.isNaN(currentTargetIndex)
|
|
335
|
+
? -1
|
|
336
|
+
: currentTargetIndex;
|
|
371
337
|
}
|
|
372
338
|
|
|
373
339
|
handlePillBlur(event) {
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
part="listbox"
|
|
12
12
|
>
|
|
13
13
|
<template for:each={pillViewModels} for:item="pillViewModel" for:index="index">
|
|
14
|
-
<li key={pillViewModel.pill.item.label} class="slds-listbox-item"
|
|
15
|
-
<lightning-pill label={pillViewModel.pill.item.label}
|
|
14
|
+
<li key={pillViewModel.pill.item.label} class="slds-listbox-item">
|
|
15
|
+
<lightning-pill label={pillViewModel.pill.item.label}
|
|
16
|
+
onclick={handlePillClick}
|
|
16
17
|
name={index}
|
|
17
18
|
href={pillViewModel.pill.item.href}
|
|
18
19
|
onremove={handleRemove}
|
|
19
20
|
onblur={handlePillBlur}
|
|
20
21
|
onfocus={handlePillFocus}
|
|
21
|
-
variant={pillViewModel.pill.variant}
|
|
22
|
-
aria-selected="true">
|
|
22
|
+
variant={pillViewModel.pill.variant}>
|
|
23
23
|
<template if:true={pillViewModel.pill.isIcon}>
|
|
24
24
|
<lightning-icon
|
|
25
25
|
class="slds-icon_container"
|
|
@@ -220,6 +220,18 @@ export default class PrimitiveHeaderFactory extends PrimitiveDatatableCell {
|
|
|
220
220
|
? 'slds-line-clamp_small '
|
|
221
221
|
: 'slds-truncate';
|
|
222
222
|
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Get th Action styles (needed for wrapping headers)
|
|
226
|
+
*
|
|
227
|
+
* @return {string} The computed classes
|
|
228
|
+
*/
|
|
229
|
+
get thActionStyles() {
|
|
230
|
+
const heightStyle = this._wrapTableHeader ? 'min-height: 3rem' : '';
|
|
231
|
+
return `
|
|
232
|
+
${heightStyle}
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
223
235
|
|
|
224
236
|
/**
|
|
225
237
|
* Computes an option name
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
aria-valuemax="100"
|
|
5
5
|
aria-valuenow={percentValue}
|
|
6
6
|
aria-busy={ariaBusy}
|
|
7
|
-
role="progressbar"
|
|
8
|
-
aria-label={computeAriaLabel}
|
|
9
|
-
aria-labelledby="progress-bar-assistive-text">
|
|
7
|
+
role="progressbar"
|
|
8
|
+
aria-label={computeAriaLabel}>
|
|
10
9
|
<span class="slds-progress-bar__value" style={computedStyle}>
|
|
11
|
-
<span class="slds-assistive-text"
|
|
10
|
+
<span class="slds-assistive-text">{assistiveText}</span>
|
|
12
11
|
</span>
|
|
13
12
|
</div>
|
|
14
13
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<template if:false={hasExternalLabel}>
|
|
3
|
-
<template if:true={required}>
|
|
4
|
-
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
5
|
-
</template>
|
|
6
3
|
<label class={computedLabelClass}>
|
|
4
|
+
<template if:true={required}>
|
|
5
|
+
<abbr class="slds-required" title={i18n.required}>*</abbr>
|
|
6
|
+
</template>
|
|
7
7
|
{label}
|
|
8
8
|
</label>
|
|
9
9
|
<lightning-helptext if:true={fieldLevelHelp} content={fieldLevelHelp} alternative-text={helptextAlternativeText}></lightning-helptext>
|