lightning-base-components 1.26.3-rc.0-alpha → 1.26.4-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/package.json +77 -1
- package/scopedImports/@salesforce-gate-accordionCloseSingleSection.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-assertContext.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-bc.256.enableInputSearchCommitEvent.js +6 -0
- package/scopedImports/@salesforce-gate-bc.256.enableReactiveCarousel.js +6 -0
- package/scopedImports/@salesforce-gate-colorIconsMenuItem.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-datatableIconSrc.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-formattedDateTimeDateStyle.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-groupedComboboxVariants.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-inputErrorIcon.ce.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-lookups.lookupMetadataLayoutServiceBased.js +6 -0
- package/scopedImports/@salesforce-gate-modalReduceMotionFix.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-overlaySldsScopeClass.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-primitiveThemeProviderDisabled.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-recordFormFieldCaching.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-regexCustomElementCheck.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-sanitizeURL.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-treeGridCustomTypes.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-treeGridStaticCustomTypes.bc.ltng.js +6 -0
- package/scopedImports/@salesforce-gate-treeItemEndIcon.bc.ltng.js +6 -0
- package/src/lightning/features/features.js +50 -0
- package/src/lightning/features/features.js-meta.xml +6 -0
- package/src/lightning/features/gates/imports.js +60 -0
- package/src/lightning/features/gates/index.js +16 -0
- package/src/lightning/input/__docs__/input.md +1 -1
- package/src/lightning/inputAddress/__docs__/inputAddress.md +30 -2
- package/src/lightning/inputAddress/inputAddress.js +2 -2
- package/src/lightning/menuItem/__docs__/menuItem.md +12 -7
- package/src/lightning/positionLibrary/elementProxy.js +14 -8
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +0 -1
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +64 -10
- package/src/lightning/treeGrid/__docs__/treeGrid.md +2 -2
- package/src/lightning/treeGrid/treeGrid.js +20 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lightning-base-components",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.4-alpha",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"external",
|
|
@@ -1354,6 +1354,82 @@
|
|
|
1354
1354
|
"name": "@salesforce/label/LWCFileUpload.AccessCheckError",
|
|
1355
1355
|
"path": "scopedImports/@salesforce-label-LWCFileUpload.AccessCheckError.js"
|
|
1356
1356
|
},
|
|
1357
|
+
{
|
|
1358
|
+
"name": "@salesforce/gate/accordionCloseSingleSection.bc.ltng",
|
|
1359
|
+
"path": "scopedImports/@salesforce-gate-accordionCloseSingleSection.bc.ltng.js"
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "@salesforce/gate/assertContext.bc.ltng",
|
|
1363
|
+
"path": "scopedImports/@salesforce-gate-assertContext.bc.ltng.js"
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
"name": "@salesforce/gate/bc.256.enableInputSearchCommitEvent",
|
|
1367
|
+
"path": "scopedImports/@salesforce-gate-bc.256.enableInputSearchCommitEvent.js"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"name": "@salesforce/gate/bc.256.enableReactiveCarousel",
|
|
1371
|
+
"path": "scopedImports/@salesforce-gate-bc.256.enableReactiveCarousel.js"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"name": "@salesforce/gate/colorIconsMenuItem.bc.ltng",
|
|
1375
|
+
"path": "scopedImports/@salesforce-gate-colorIconsMenuItem.bc.ltng.js"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"name": "@salesforce/gate/datatableIconSrc.bc.ltng",
|
|
1379
|
+
"path": "scopedImports/@salesforce-gate-datatableIconSrc.bc.ltng.js"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
"name": "@salesforce/gate/formattedDateTimeDateStyle.bc.ltng",
|
|
1383
|
+
"path": "scopedImports/@salesforce-gate-formattedDateTimeDateStyle.bc.ltng.js"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "@salesforce/gate/groupedComboboxVariants.bc.ltng",
|
|
1387
|
+
"path": "scopedImports/@salesforce-gate-groupedComboboxVariants.bc.ltng.js"
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
"name": "@salesforce/gate/inputErrorIcon.ce.ltng",
|
|
1391
|
+
"path": "scopedImports/@salesforce-gate-inputErrorIcon.ce.ltng.js"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"name": "@salesforce/gate/lookups.lookupMetadataLayoutServiceBased",
|
|
1395
|
+
"path": "scopedImports/@salesforce-gate-lookups.lookupMetadataLayoutServiceBased.js"
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "@salesforce/gate/modalReduceMotionFix.bc.ltng",
|
|
1399
|
+
"path": "scopedImports/@salesforce-gate-modalReduceMotionFix.bc.ltng.js"
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"name": "@salesforce/gate/overlaySldsScopeClass.bc.ltng",
|
|
1403
|
+
"path": "scopedImports/@salesforce-gate-overlaySldsScopeClass.bc.ltng.js"
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
"name": "@salesforce/gate/primitiveThemeProviderDisabled.bc.ltng",
|
|
1407
|
+
"path": "scopedImports/@salesforce-gate-primitiveThemeProviderDisabled.bc.ltng.js"
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"name": "@salesforce/gate/recordFormFieldCaching.bc.ltng",
|
|
1411
|
+
"path": "scopedImports/@salesforce-gate-recordFormFieldCaching.bc.ltng.js"
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
"name": "@salesforce/gate/regexCustomElementCheck.bc.ltng",
|
|
1415
|
+
"path": "scopedImports/@salesforce-gate-regexCustomElementCheck.bc.ltng.js"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"name": "@salesforce/gate/sanitizeURL.bc.ltng",
|
|
1419
|
+
"path": "scopedImports/@salesforce-gate-sanitizeURL.bc.ltng.js"
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
"name": "@salesforce/gate/treeGridCustomTypes.bc.ltng",
|
|
1423
|
+
"path": "scopedImports/@salesforce-gate-treeGridCustomTypes.bc.ltng.js"
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
"name": "@salesforce/gate/treeGridStaticCustomTypes.bc.ltng",
|
|
1427
|
+
"path": "scopedImports/@salesforce-gate-treeGridStaticCustomTypes.bc.ltng.js"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
"name": "@salesforce/gate/treeItemEndIcon.bc.ltng",
|
|
1431
|
+
"path": "scopedImports/@salesforce-gate-treeItemEndIcon.bc.ltng.js"
|
|
1432
|
+
},
|
|
1357
1433
|
{
|
|
1358
1434
|
"name": "@salesforce/i18n/lang",
|
|
1359
1435
|
"path": "scopedImports/@salesforce-i18n-lang.js"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import gates from './gates/index.js';
|
|
7
|
+
|
|
8
|
+
// [W-18059145] Gymnastics to avoid creating a dependency from utilsPrivate to
|
|
9
|
+
// features. This works as long as there is a single lightning/features
|
|
10
|
+
// dependency on the page because it happens during initialization. This simple
|
|
11
|
+
// approach was favored over moving privateContext inside of lightning/features
|
|
12
|
+
// because this is a temporary workaround. W-18095657 is the work to remove this
|
|
13
|
+
// workaround in 258.
|
|
14
|
+
import { privateContext } from 'lightning/utilsPrivate';
|
|
15
|
+
|
|
16
|
+
const _features = Object.assign(Object.create(null), gates);
|
|
17
|
+
|
|
18
|
+
// We expose features using a read-only object because they should never be
|
|
19
|
+
// modified outside tests. setFeatureForTest() should be used for testing.
|
|
20
|
+
const errorMessage =
|
|
21
|
+
'This object and its prototype are immutable. Object values can only be updated with `setFeatureForTest()`';
|
|
22
|
+
const features = new Proxy(_features, {
|
|
23
|
+
set() {
|
|
24
|
+
throw new TypeError(errorMessage);
|
|
25
|
+
},
|
|
26
|
+
defineProperty() {
|
|
27
|
+
throw new TypeError(errorMessage);
|
|
28
|
+
},
|
|
29
|
+
deleteProperty() {
|
|
30
|
+
throw new TypeError(errorMessage);
|
|
31
|
+
},
|
|
32
|
+
setPrototypeOf() {
|
|
33
|
+
throw new TypeError(errorMessage);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
privateContext.assertContext = privateContext.assertContext.bind({ features });
|
|
38
|
+
|
|
39
|
+
function setFeatureForTest(name, value) {
|
|
40
|
+
if (typeof _features[name] === 'undefined') {
|
|
41
|
+
throw new TypeError(
|
|
42
|
+
`Unrecognized feature "${name}". Expected one of: ${Object.keys(
|
|
43
|
+
_features
|
|
44
|
+
).join(', ')}`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
_features[name] = value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { features, setFeatureForTest };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
// Please add your gate to http://sfdc.co/bc-gates if you haven't already.
|
|
7
|
+
|
|
8
|
+
// Imports below are spaced apart and in lexical order in an attempt to minimize merge conflicts.
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
11
|
+
export { default as ENABLE_ACCORDION_CLOSE_SINGLE_SECTION } from '@salesforce/gate/accordionCloseSingleSection.bc.ltng';
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
14
|
+
export { default as ENABLE_ASSERT_CONTEXT } from '@salesforce/gate/assertContext.bc.ltng';
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
17
|
+
export { default as ENABLE_COLOR_ICONS_MENU_ITEM } from '@salesforce/gate/colorIconsMenuItem.bc.ltng';
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
20
|
+
export { default as ENABLE_DATATABLE_IMG_SRC } from '@salesforce/gate/datatableIconSrc.bc.ltng';
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
23
|
+
export { default as ENABLE_FORMATTED_DATE_TIME_DATE_STYLE } from '@salesforce/gate/formattedDateTimeDateStyle.bc.ltng';
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
26
|
+
export { default as ENABLE_GROUPED_COMBOBOX_VARIANTS } from '@salesforce/gate/groupedComboboxVariants.bc.ltng';
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
29
|
+
export { default as ENABLE_INPUT_ERROR_ICON } from '@salesforce/gate/inputErrorIcon.ce.ltng';
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
32
|
+
export { default as ENABLE_MODAL_REDUCE_MOTION } from '@salesforce/gate/modalReduceMotionFix.bc.ltng';
|
|
33
|
+
|
|
34
|
+
export { default as enableReactiveCarousel } from '@salesforce/gate/bc.256.enableReactiveCarousel';
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
37
|
+
export { default as ENABLE_RECORD_FORM_FIELD_CACHING } from '@salesforce/gate/recordFormFieldCaching.bc.ltng';
|
|
38
|
+
|
|
39
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
40
|
+
export { default as ENABLE_REGEX_CUSTOM_ELEMENT_CHECK } from '@salesforce/gate/regexCustomElementCheck.bc.ltng';
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
43
|
+
export { default as ENABLE_OVERLAY_SLDS_SCOPE_CLASS } from '@salesforce/gate/overlaySldsScopeClass.bc.ltng';
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
46
|
+
export { default as ENABLE_SANITIZE_URL } from '@salesforce/gate/sanitizeURL.bc.ltng';
|
|
47
|
+
|
|
48
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
49
|
+
export { default as ENABLE_TREE_GRID_CUSTOM_TYPES } from '@salesforce/gate/treeGridCustomTypes.bc.ltng';
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
52
|
+
export { default as ENABLE_TREE_GRID_STATIC_CUSTOM_TYPES } from '@salesforce/gate/treeGridStaticCustomTypes.bc.ltng';
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
55
|
+
export { default as ENABLE_TREE_ITEM_END_ICON } from '@salesforce/gate/treeItemEndIcon.bc.ltng';
|
|
56
|
+
|
|
57
|
+
export { default as enableInputSearchCommitEvent } from '@salesforce/gate/bc.256.enableInputSearchCommitEvent';
|
|
58
|
+
|
|
59
|
+
// eslint-disable-next-line lightning-global/no-invalid-feature-name, lightning-global/no-invalid-gate-name
|
|
60
|
+
export { default as primitiveThemeProviderDisabled } from '@salesforce/gate/primitiveThemeProviderDisabled.bc.ltng';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import * as gates from './imports.js';
|
|
7
|
+
|
|
8
|
+
const resolved = Object.create(null);
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @lwc/lwc/no-for-of
|
|
11
|
+
for (const [name, gate] of Object.entries(gates)) {
|
|
12
|
+
// Disabled by default
|
|
13
|
+
resolved[name] = gate.isOpen({ fallback: false });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default resolved;
|
|
@@ -1139,7 +1139,7 @@ The event properties are as follows.
|
|
|
1139
1139
|
|
|
1140
1140
|
**`commit`**
|
|
1141
1141
|
|
|
1142
|
-
The event fired when you press Enter after interacting with the input, or move away from the input so it loses focus. For the input type
|
|
1142
|
+
The event fired when you press Enter after interacting with the input, or move away from the input so it loses focus. For the input type search, the event is only fired when focus leaves the entire component or when the user clicks the "x" button to clear the search. For the input type `number` the event is also fired when you press Up/Down arrow keys to change the number.
|
|
1143
1143
|
|
|
1144
1144
|
The `commit` event doesn’t return any parameters.
|
|
1145
1145
|
|
|
@@ -229,11 +229,39 @@ To enable autocompletion of the address fields using an address lookup field, in
|
|
|
229
229
|
|
|
230
230
|
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.
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
#### Filter Address Lookup Based on Country Options
|
|
233
|
+
|
|
234
|
+
To filter address lookups by country, pass in an array of ISO 3166-1 Alpha-2 country code strings to the `country-lookup-filter` attribute. Country codes are case-insensitive. Enable address lookup by including `show-address-lookup`.
|
|
235
|
+
|
|
236
|
+
```html
|
|
237
|
+
<template>
|
|
238
|
+
<lightning-input-address
|
|
239
|
+
show-address-lookup
|
|
240
|
+
address-label="Address"
|
|
241
|
+
street-label="Street"
|
|
242
|
+
city-label="City"
|
|
243
|
+
province-label="State"
|
|
244
|
+
country-label="Country"
|
|
245
|
+
postal-code-label="Zip Code"
|
|
246
|
+
country-lookup-filter={countries}
|
|
247
|
+
>
|
|
248
|
+
</lightning-input-address>
|
|
249
|
+
</template>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
In your JavaScript file, pass in a list of country codes. You can specify a maximum of five country codes.
|
|
253
|
+
|
|
254
|
+
```javascript
|
|
255
|
+
import { LightningElement } from 'lwc';
|
|
256
|
+
|
|
257
|
+
export default class CountryFilterExample extends LightningElement {
|
|
258
|
+
countries = ['AU', 'GB', 'JP'];
|
|
259
|
+
}
|
|
260
|
+
```
|
|
233
261
|
|
|
234
262
|
For a list of valid country codes, see [Google for Developers: countries.csv](https://developers.google.com/public-data/docs/canonical/countries_csv).
|
|
235
263
|
|
|
236
|
-
**Important:** Using an invalid two-letter country code in the array
|
|
264
|
+
**Important:** Using an invalid two-letter country code in the array prevents the Google Maps Places API from returning results and may trigger console errors. If the array contains a country code longer than two characters or exceeds the five-country filter limit, the component defaults to using no filter. Additionally, if a non-array value is passed to the attribute, the component also defaults to using no filter.
|
|
237
265
|
|
|
238
266
|
Using `show-address-lookup` is not supported in Experience Builder sites, Lightning Out,
|
|
239
267
|
Lightning Components for Visualforce, and standalone apps. While it may work, these targets are not optimized and not officially supported.
|
|
@@ -367,8 +367,8 @@ export default class LightningInputAddress extends LightningShadowBaseClass {
|
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
369
|
* A list of ISO 3166-1 Alpha-2 country codes to filter the address with. Country codes are case-insensitive.
|
|
370
|
-
*
|
|
371
|
-
* Specify up to
|
|
370
|
+
* Use with the show-address-lookup attribute.
|
|
371
|
+
* Specify up to five country codes.
|
|
372
372
|
*
|
|
373
373
|
* @type {list}
|
|
374
374
|
* @default []
|
|
@@ -66,13 +66,8 @@ Use the `icon-name` attribute to add an icon after the text of the menu item.
|
|
|
66
66
|
Use the `prefix-icon-name` attribute to add an icon before the text of the menu
|
|
67
67
|
item.
|
|
68
68
|
|
|
69
|
-
You can also use the `icon-type` attribute to control the appearance of icons in menu items. The `icon-type` attribute accepts two values:
|
|
70
|
-
|
|
71
|
-
- `standard` (default): All icons are displayed in grayscale.
|
|
72
|
-
- `color`: All icons and their respective background colors are supported.
|
|
73
|
-
|
|
74
|
-
|
|
75
69
|
This example displays an icon in grayscale before the menu item text.
|
|
70
|
+
|
|
76
71
|
```html
|
|
77
72
|
<template>
|
|
78
73
|
<lightning-button-menu>
|
|
@@ -83,7 +78,17 @@ This example displays an icon in grayscale before the menu item text.
|
|
|
83
78
|
</template>
|
|
84
79
|
```
|
|
85
80
|
|
|
86
|
-
|
|
81
|
+
#### Adding Icons with Background Colors
|
|
82
|
+
|
|
83
|
+
The [SLDS action and object icons](https://v1.lightningdesignsystem.com/icons/) (standard and custom) are defined with color backgrounds. However, when you use these icons in menu items, the colors aren't displayed by default.
|
|
84
|
+
|
|
85
|
+
To display icons with a background color in menu items, use the `icon-type` attribute. The `icon-type` attribute accepts two values.
|
|
86
|
+
|
|
87
|
+
- `standard` (default): Displays the icon on the menu item in grayscale.
|
|
88
|
+
- `color`: Displays the icon on the menu item with a background color. Action icons and object icons display a white glyph on a colored background that's defined in [SLDS](https://v1.lightningdesignsystem.com/icons/#standard). Doctype and utility icons don't display with a background color.
|
|
89
|
+
|
|
90
|
+
To enable colored icons and backgrounds, use the `icon-type="color"` attribute. In this example, the `standard:event` icon is displayed with a background color and the `utility:settings` icon is displayed in grayscale.
|
|
91
|
+
|
|
87
92
|
```html
|
|
88
93
|
<template>
|
|
89
94
|
<lightning-button-menu>
|
|
@@ -135,10 +135,11 @@ export class ElementProxy {
|
|
|
135
135
|
const element = this._node;
|
|
136
136
|
const rect = element.getBoundingClientRect();
|
|
137
137
|
|
|
138
|
-
const offsetWidth = element.offsetWidth || rect.width || 1;
|
|
139
|
-
const offsetHeight =
|
|
140
|
-
|
|
141
|
-
const
|
|
138
|
+
const offsetWidth = element.offsetWidth || Math.round(rect.width) || 1;
|
|
139
|
+
const offsetHeight =
|
|
140
|
+
element.offsetHeight || Math.round(rect.height) || 1;
|
|
141
|
+
const actualWidth = Math.round(rect.width);
|
|
142
|
+
const actualHeight = Math.round(rect.height);
|
|
142
143
|
const widthRatio = Number((actualWidth / offsetWidth).toFixed(2));
|
|
143
144
|
const heightRatio = Number((actualHeight / offsetHeight).toFixed(2));
|
|
144
145
|
return Math.min(widthRatio, heightRatio);
|
|
@@ -166,17 +167,22 @@ export class ElementProxy {
|
|
|
166
167
|
|
|
167
168
|
//since this.top dosent consist of marginTop , we need to subtract the margin to the top from absTop
|
|
168
169
|
const adjustedAbsPosTop =
|
|
169
|
-
adjustForZoom(absPos.top) +
|
|
170
|
+
adjustForZoom(Math.round(absPos.top)) +
|
|
170
171
|
scrollTop -
|
|
171
|
-
(adjustForZoom(this.top) <
|
|
172
|
+
(adjustForZoom(this.top) <
|
|
173
|
+
adjustForZoom(Math.round(absPos.top)) + scrollTop
|
|
172
174
|
? marginTop
|
|
173
175
|
: -marginTop);
|
|
174
176
|
const marginAdjustment =
|
|
175
177
|
adjustForZoom(this.top) < adjustForZoom(adjustedAbsPosTop)
|
|
176
178
|
? marginTop
|
|
177
179
|
: -marginTop;
|
|
178
|
-
const zoomAdjustedAbsLeft = adjustForZoom(
|
|
179
|
-
|
|
180
|
+
const zoomAdjustedAbsLeft = adjustForZoom(
|
|
181
|
+
Math.round(absPos.left) + scrollLeft
|
|
182
|
+
);
|
|
183
|
+
const zoomAdjustedAbsTop = adjustForZoom(
|
|
184
|
+
Math.round(absPos.top) + scrollTop
|
|
185
|
+
);
|
|
180
186
|
|
|
181
187
|
let leftDif = Math.round(
|
|
182
188
|
adjustForZoom(this.left) - zoomAdjustedAbsLeft
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
import { api } from 'lwc';
|
|
7
|
-
import { features } from 'lightning/features'
|
|
7
|
+
import { features } from 'lightning/features';
|
|
8
8
|
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
9
9
|
import labelRequired from '@salesforce/label/LightningControl.required';
|
|
10
10
|
import labelClearInput from '@salesforce/label/LightningControl.clear';
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
normalizeKeyValue,
|
|
38
38
|
normalizeString,
|
|
39
39
|
setDecoratedDragonInputValueWithoutEvent,
|
|
40
|
-
isDesktopBrowser
|
|
40
|
+
isDesktopBrowser,
|
|
41
41
|
} from 'lightning/utilsPrivate';
|
|
42
42
|
|
|
43
43
|
import { InputSelectionCache } from './selection';
|
|
@@ -59,7 +59,6 @@ const DEFAULT_FORMATTER = VALID_NUMBER_FORMATTERS[0];
|
|
|
59
59
|
|
|
60
60
|
export default class LightningPrimitiveInputSimple extends LightningShadowBaseClass {
|
|
61
61
|
_type;
|
|
62
|
-
|
|
63
62
|
@api hasExternalLabel;
|
|
64
63
|
@api computedLabelClass;
|
|
65
64
|
@api required;
|
|
@@ -201,8 +200,6 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
201
200
|
this._value = normalizeInput(value);
|
|
202
201
|
|
|
203
202
|
if (this._rendered) {
|
|
204
|
-
const badInput = this.validity.badInput;
|
|
205
|
-
|
|
206
203
|
if (this.isTypeNumber) {
|
|
207
204
|
this._value = stringifyNumber(value);
|
|
208
205
|
// the extra check for whether the value has changed is done for cases
|
|
@@ -289,6 +286,8 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
289
286
|
_step;
|
|
290
287
|
_numberRawValue = '';
|
|
291
288
|
_value = '';
|
|
289
|
+
_committedValue;
|
|
290
|
+
_focusOutListenerAttached = false;
|
|
292
291
|
|
|
293
292
|
/********* EVENT HANDLERS *********/
|
|
294
293
|
handleFocus(event) {
|
|
@@ -374,10 +373,33 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
374
373
|
this.reflectPopulatedState();
|
|
375
374
|
}
|
|
376
375
|
|
|
376
|
+
handleFocusOut(event) {
|
|
377
|
+
// commit event for type=search are handled by this focusout handler rather
|
|
378
|
+
// than the handleChange method due to there being a clear button present
|
|
379
|
+
// where the user can once again edit the value
|
|
380
|
+
const { relatedTarget } = event;
|
|
381
|
+
const focusLeftComponent = !(
|
|
382
|
+
relatedTarget instanceof Node &&
|
|
383
|
+
this.template.contains(relatedTarget)
|
|
384
|
+
);
|
|
385
|
+
if (focusLeftComponent) {
|
|
386
|
+
this.dispatchCommitEvent();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
377
390
|
handleChange(event) {
|
|
378
391
|
event.stopPropagation();
|
|
379
392
|
|
|
380
|
-
|
|
393
|
+
// type=search will fire a commit event when focus has left the entire component
|
|
394
|
+
// in the handleFocusOut method.
|
|
395
|
+
if (features.enableInputSearchCommitEvent) {
|
|
396
|
+
if (!this.isTypeSearch) {
|
|
397
|
+
this.dispatchCommitEvent();
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
this.dispatchCommitEvent();
|
|
401
|
+
}
|
|
402
|
+
|
|
381
403
|
if (this.isTypeMobileDateTime) {
|
|
382
404
|
if (
|
|
383
405
|
this.value ===
|
|
@@ -406,7 +428,14 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
406
428
|
/********* EVENT DISPATCHERS *********/
|
|
407
429
|
|
|
408
430
|
dispatchCommitEvent() {
|
|
409
|
-
|
|
431
|
+
if (features.enableInputSearchCommitEvent) {
|
|
432
|
+
if (this._committedValue !== this.value) {
|
|
433
|
+
this._committedValue = this.value;
|
|
434
|
+
this.dispatchEvent(new CustomEvent('commit'));
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
this.dispatchEvent(new CustomEvent('commit'));
|
|
438
|
+
}
|
|
410
439
|
}
|
|
411
440
|
|
|
412
441
|
dispatchChangeEvent() {
|
|
@@ -561,7 +590,11 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
561
590
|
}
|
|
562
591
|
|
|
563
592
|
get showErrorIcon() {
|
|
564
|
-
return
|
|
593
|
+
return (
|
|
594
|
+
features.ENABLE_INPUT_ERROR_ICON &&
|
|
595
|
+
this._helpMessage &&
|
|
596
|
+
!this.isTypeSearch
|
|
597
|
+
);
|
|
565
598
|
}
|
|
566
599
|
|
|
567
600
|
get computedFormElementClass() {
|
|
@@ -669,10 +702,8 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
669
702
|
|
|
670
703
|
this.setInputValue('');
|
|
671
704
|
this._value = '';
|
|
672
|
-
// this._updateValueAndValidityAttribute('');
|
|
673
705
|
|
|
674
706
|
this.inputElement.focus();
|
|
675
|
-
|
|
676
707
|
this.dispatchChangeEventWithDetail({
|
|
677
708
|
value: this._value,
|
|
678
709
|
});
|
|
@@ -732,6 +763,29 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
732
763
|
reflectAttribute(this, 'variant', this.variant);
|
|
733
764
|
reflectAttribute(this, 'disabled', this.disabled);
|
|
734
765
|
reflectAttribute(this, 'readonly', this.readOnly);
|
|
766
|
+
|
|
767
|
+
if (
|
|
768
|
+
this.isTypeSearch &&
|
|
769
|
+
!this._focusOutListenerAttached &&
|
|
770
|
+
features.enableInputSearchCommitEvent
|
|
771
|
+
) {
|
|
772
|
+
this.focusOutEventHandler = this.handleFocusOut.bind(this);
|
|
773
|
+
this.refs.container.addEventListener(
|
|
774
|
+
'focusout',
|
|
775
|
+
this.focusOutEventHandler
|
|
776
|
+
);
|
|
777
|
+
this._focusOutListenerAttached = true;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
disconnectedCallback() {
|
|
782
|
+
if (this.isTypeSearch && features.enableInputSearchCommitEvent) {
|
|
783
|
+
this.refs.container.removeEventListener(
|
|
784
|
+
'focusout',
|
|
785
|
+
this.focusOutEventHandler
|
|
786
|
+
);
|
|
787
|
+
this._focusOutListenerAttached = false;
|
|
788
|
+
}
|
|
735
789
|
}
|
|
736
790
|
constructor() {
|
|
737
791
|
super();
|
|
@@ -231,7 +231,7 @@ aspects of your columns.
|
|
|
231
231
|
|
|
232
232
|
The tree grid formats the data cells of a column based on the type you
|
|
233
233
|
specify for the column. Each data type
|
|
234
|
-
is associated with a base
|
|
234
|
+
is associated with a base component. For example, specifying the
|
|
235
235
|
`text` type renders the associated data using a `lightning-formatted-text`
|
|
236
236
|
component. Some of these types allow you to pass in the attributes via the
|
|
237
237
|
`typeAttributes` attribute to customize your output.
|
|
@@ -294,7 +294,7 @@ When using currency or date and time types, the default user locale is used
|
|
|
294
294
|
when no locale formatting is provided. For more information on attributes, see
|
|
295
295
|
the corresponding component documentation.
|
|
296
296
|
|
|
297
|
-
For more information on creating your own data types, see [Create a Custom Data Type](https://developer.salesforce.com/docs/platform/lwc/guide/
|
|
297
|
+
For more information on creating your own data types, see [Create a Custom Data Type](https://developer.salesforce.com/docs/platform/lwc/guide/tree-grid-custom-types).
|
|
298
298
|
|
|
299
299
|
#### Appending an Icon to Column Data
|
|
300
300
|
|
|
@@ -193,11 +193,6 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
set columns(value) {
|
|
197
|
-
this._rawColumns = value;
|
|
198
|
-
this._columns = normalizeColumns(value);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
196
|
/**
|
|
202
197
|
* Array of the columns object that's used to define the data types.
|
|
203
198
|
* Required properties include 'label', 'fieldName', and 'type'. The default type is 'text'.
|
|
@@ -209,9 +204,9 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
209
204
|
return this._rawColumns;
|
|
210
205
|
}
|
|
211
206
|
|
|
212
|
-
set
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
207
|
+
set columns(value) {
|
|
208
|
+
this._rawColumns = value;
|
|
209
|
+
this._columns = normalizeColumns(value);
|
|
215
210
|
}
|
|
216
211
|
|
|
217
212
|
/**
|
|
@@ -224,9 +219,8 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
224
219
|
return this._rawData;
|
|
225
220
|
}
|
|
226
221
|
|
|
227
|
-
set
|
|
228
|
-
this.
|
|
229
|
-
this._expandedRows = Object.assign([], value);
|
|
222
|
+
set data(value) {
|
|
223
|
+
this._rawData = value;
|
|
230
224
|
this.flattenData();
|
|
231
225
|
}
|
|
232
226
|
|
|
@@ -245,6 +239,12 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
245
239
|
return this._publicExpandedRows;
|
|
246
240
|
}
|
|
247
241
|
|
|
242
|
+
set expandedRows(value) {
|
|
243
|
+
this._publicExpandedRows = Object.assign([], value);
|
|
244
|
+
this._expandedRows = Object.assign([], value);
|
|
245
|
+
this.flattenData();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
248
|
get normalizedColumns() {
|
|
249
249
|
return this._columns;
|
|
250
250
|
}
|
|
@@ -334,7 +334,16 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
334
334
|
this.toggleRow(this.data, name, nextState);
|
|
335
335
|
this._selectedRows = this._selectedRowKeys.slice();
|
|
336
336
|
};
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Enables programmatic row selection with a list of key-field values.
|
|
340
|
+
* @type {list}
|
|
341
|
+
*/
|
|
337
342
|
@api
|
|
343
|
+
get selectedRows() {
|
|
344
|
+
return this._selectedRows;
|
|
345
|
+
}
|
|
346
|
+
|
|
338
347
|
set selectedRows(value) {
|
|
339
348
|
this._selectedRows = value;
|
|
340
349
|
if (Array.isArray(value)) {
|
|
@@ -342,10 +351,6 @@ export default class LightningTreeGrid extends LightningShadowBaseClass {
|
|
|
342
351
|
}
|
|
343
352
|
}
|
|
344
353
|
|
|
345
|
-
get selectedRows() {
|
|
346
|
-
return this._selectedRows;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
354
|
handleToggleAll = (event) => {
|
|
350
355
|
assertContext(this);
|
|
351
356
|
event.stopPropagation();
|