lightning-base-components 1.18.2-alpha → 1.18.3-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 +4 -0
- package/package.json +15 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/src/lightning/accordion/__docs__/accordion.md +2 -2
- package/src/lightning/avatar/__docs__/avatar.md +7 -7
- package/src/lightning/badge/__docs__/badge.md +2 -2
- package/src/lightning/baseCombobox/baseCombobox.js +62 -22
- package/src/lightning/breadcrumbs/__docs__/breadcrumbs.md +3 -3
- package/src/lightning/button/__docs__/button.md +15 -15
- package/src/lightning/buttonIcon/__docs__/buttonIcon.md +9 -9
- package/src/lightning/buttonIconStateful/__docs__/buttonIconStateful.md +9 -9
- package/src/lightning/buttonMenu/__docs__/buttonMenu.md +8 -8
- package/src/lightning/buttonStateful/__docs__/buttonStateful.md +12 -12
- package/src/lightning/calendar/calendar.css +2 -2
- package/src/lightning/calendar/calendar.js +4 -2
- package/src/lightning/card/__docs__/card.md +3 -3
- package/src/lightning/checkboxGroup/__docs__/checkboxGroup.md +2 -2
- package/src/lightning/datatable/__docs__/datatable.md +45 -35
- package/src/lightning/datatable/autoWidthStrategy.js +3 -0
- package/src/lightning/datatable/columnWidthManager.js +1 -1
- package/src/lightning/datatable/datatable.js +8 -7
- package/src/lightning/datatable/rowSelection.js +7 -4
- package/src/lightning/datatable/templates/table/table.html +1 -0
- package/src/lightning/datepicker/datepicker.css +2 -2
- package/src/lightning/datepicker/datepicker.js +4 -2
- package/src/lightning/datetimepicker/datetimepicker.css +2 -2
- package/src/lightning/datetimepicker/datetimepicker.js +4 -2
- package/src/lightning/dualListbox/dualListbox.js +16 -7
- package/src/lightning/formattedRichText/formatted-rich-text.slds.css +230 -0
- package/src/lightning/formattedRichText/formattedRichText.css +2 -0
- package/src/lightning/formattedRichText/formattedRichText.js +4 -2
- package/src/lightning/formattedText/formattedText.css +1 -0
- package/src/lightning/formattedText/formattedText.js +3 -2
- package/src/lightning/helptext/__docs__/helptext.md +2 -2
- package/src/lightning/icon/__docs__/icon.md +5 -5
- package/src/lightning/icon/icon.js +6 -1
- package/src/lightning/iconUtils/iconUtils.js +0 -12
- package/src/lightning/iconUtils/polyfill.js +5 -90
- package/src/lightning/input/__docs__/input.md +7 -7
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.css +6 -0
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.html +2 -1
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.js +1 -1
- package/src/lightning/input/__examples__/number/number.html +0 -5
- package/src/lightning/input/input.css +2 -4
- package/src/lightning/input/input.html +149 -239
- package/src/lightning/input/input.js +209 -532
- package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -3
- package/src/lightning/inputUtils/inputUtils.js +15 -20
- package/src/lightning/inputUtils/normalize.js +7 -0
- package/src/lightning/{input/numberUtil.js → inputUtils/number.js} +1 -1
- package/src/lightning/inputUtils/utils.js +18 -0
- package/src/lightning/modalBody/__docs__/modalBody.md +9 -9
- package/src/lightning/modalFooter/__docs__/modalFooter.md +9 -9
- package/src/lightning/modalHeader/__docs__/modalHeader.md +9 -9
- package/src/lightning/overlayContainer/overlayContainer.js +4 -2
- package/src/lightning/pill/__docs__/pill.md +3 -3
- package/src/lightning/pillContainer/__docs__/pillContainer.md +14 -14
- package/src/lightning/primitiveIcon/primitiveIcon.js +8 -5
- package/src/lightning/radioGroup/__docs__/radioGroup.md +4 -4
- package/src/lightning/select/__docs__/select.md +2 -2
- package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +1 -1
- package/src/lightning/sldsCommon/sldsCommon.css +144 -42
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +10 -0
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.css +18 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +24 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.css +20 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +259 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +8 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.css +57 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +313 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +308 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +18 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +1408 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +295 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.css +14 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.js-meta.xml +4 -0
- package/src/lightning/slider/__docs__/slider.md +2 -2
- package/src/lightning/tabset/__docs__/tabset.md +2 -2
- package/src/lightning/textarea/__docs__/textarea.md +2 -2
- package/src/lightning/timepicker/timepicker.js +4 -2
- package/src/lightning/toast/toast.js-meta.xml +2 -0
- package/src/lightning/toastContainer/__docs__/toastContainer.md +14 -34
- package/src/lightning/toastContainer/toastContainer.js +10 -15
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +12 -5
- package/src/lightning/iconUtils/isIframeInEdge.js +0 -7
- package/src/lightning/iconUtils/supportsSvg.js +0 -16
- package/src/lightning/input/input-checkbox.slds.css +0 -395
- package/src/lightning/input/input-text.slds.css +0 -398
- package/src/lightning/input/normalize.js +0 -6
- package/src/lightning/input/selection.js +0 -131
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.html +0 -0
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.js +0 -0
- /package/src/lightning/{input/emailUtil.js → inputUtils/email.js} +0 -0
|
@@ -42,7 +42,10 @@ include:
|
|
|
42
42
|
|
|
43
43
|
Tables can be populated during initialization using the `data`, `columns`, and
|
|
44
44
|
`key-field` attributes. The `key-field` attribute is required for correct table behavior.
|
|
45
|
-
It associates each row with a unique identifier.
|
|
45
|
+
It associates each row with a unique identifier. The value you use for `key-field` is
|
|
46
|
+
case-sensitive and must match what's in your `data` array.
|
|
47
|
+
If you use `key-field="Id"`, make sure the Id you provide in the `data` array
|
|
48
|
+
uses `Id` and not `id`.
|
|
46
49
|
|
|
47
50
|
This example creates a table whose first column displays a checkbox for row selection.
|
|
48
51
|
The checkbox column is displayed by default, and you can hide it by adding `hide-checkbox-column` in your markup.
|
|
@@ -53,7 +56,7 @@ Selecting the checkbox selects the entire row of data and triggers the `onrowsel
|
|
|
53
56
|
<lightning-datatable
|
|
54
57
|
data={data}
|
|
55
58
|
columns={columns}
|
|
56
|
-
key-field="
|
|
59
|
+
key-field="Id"
|
|
57
60
|
onrowselection={getSelectedName}
|
|
58
61
|
>
|
|
59
62
|
</lightning-datatable>
|
|
@@ -71,51 +74,51 @@ or decreasing confidence trend. The icon is specified with the `cellAttributes`
|
|
|
71
74
|
property. See **Working with Column Properties** for more information about the
|
|
72
75
|
properties for columns.
|
|
73
76
|
|
|
74
|
-
The JavaScript also loads two rows of data in the table. The
|
|
77
|
+
The JavaScript also loads two rows of data in the table. The Id for each
|
|
75
78
|
table row is used as the `key-field`.
|
|
76
79
|
|
|
77
80
|
```javascript
|
|
78
81
|
import { LightningElement } from 'lwc';
|
|
79
82
|
|
|
80
83
|
const columns = [
|
|
81
|
-
{ label: 'Opportunity name', fieldName: '
|
|
84
|
+
{ label: 'Opportunity name', fieldName: 'OpportunityName', type: 'text' },
|
|
82
85
|
{
|
|
83
86
|
label: 'Confidence',
|
|
84
|
-
fieldName: '
|
|
87
|
+
fieldName: 'Confidence',
|
|
85
88
|
type: 'percent',
|
|
86
89
|
cellAttributes: {
|
|
87
|
-
iconName: { fieldName: '
|
|
90
|
+
iconName: { fieldName: 'TrendIcon' },
|
|
88
91
|
iconPosition: 'right',
|
|
89
92
|
},
|
|
90
93
|
},
|
|
91
94
|
{
|
|
92
95
|
label: 'Amount',
|
|
93
|
-
fieldName: '
|
|
96
|
+
fieldName: 'Amount',
|
|
94
97
|
type: 'currency',
|
|
95
98
|
typeAttributes: { currencyCode: 'EUR', step: '0.001' },
|
|
96
99
|
},
|
|
97
|
-
{ label: 'Contact Email', fieldName: '
|
|
98
|
-
{ label: 'Contact Phone', fieldName: '
|
|
100
|
+
{ label: 'Contact Email', fieldName: 'Contact', type: 'email' },
|
|
101
|
+
{ label: 'Contact Phone', fieldName: 'Phone', type: 'phone' },
|
|
99
102
|
];
|
|
100
103
|
|
|
101
104
|
const data = [
|
|
102
105
|
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
Id: 'a',
|
|
107
|
+
OpportunityName: 'Cloudhub',
|
|
108
|
+
Confidence: 0.2,
|
|
109
|
+
Amount: 25000,
|
|
110
|
+
Contact: 'jrogers@cloudhub.com',
|
|
111
|
+
Phone: '2352235235',
|
|
112
|
+
TrendIcon: 'utility:down',
|
|
110
113
|
},
|
|
111
114
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
Id: 'b',
|
|
116
|
+
OpportunityName: 'Quip',
|
|
117
|
+
Confidence: 0.78,
|
|
118
|
+
Amount: 740000,
|
|
119
|
+
Contact: 'quipy@quip.com',
|
|
120
|
+
Phone: '2352235235',
|
|
121
|
+
TrendIcon: 'utility:up',
|
|
119
122
|
},
|
|
120
123
|
];
|
|
121
124
|
|
|
@@ -127,7 +130,7 @@ export default class DatatableExample extends LightningElement {
|
|
|
127
130
|
const selectedRows = event.detail.selectedRows;
|
|
128
131
|
// Display that fieldName of the selected rows
|
|
129
132
|
for (let i = 0; i < selectedRows.length; i++) {
|
|
130
|
-
alert('You selected: ' + selectedRows[i].
|
|
133
|
+
alert('You selected: ' + selectedRows[i].OpportunityName);
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
}
|
|
@@ -154,7 +157,7 @@ public with sharing class ContactController {
|
|
|
154
157
|
}
|
|
155
158
|
```
|
|
156
159
|
|
|
157
|
-
The template wires up the datatable to the contact records using the `
|
|
160
|
+
The template wires up the datatable to the contact records using the `id` field.
|
|
158
161
|
|
|
159
162
|
```html
|
|
160
163
|
<template>
|
|
@@ -552,7 +555,7 @@ there are no more data to load.
|
|
|
552
555
|
<lightning-datatable
|
|
553
556
|
columns={columns}
|
|
554
557
|
data={data}
|
|
555
|
-
key-field="
|
|
558
|
+
key-field="Id"
|
|
556
559
|
enable-infinite-loading
|
|
557
560
|
onloadmore={loadMoreData}
|
|
558
561
|
>
|
|
@@ -657,7 +660,7 @@ Publishing State column matches either the Published or Unpublished state.
|
|
|
657
660
|
<lightning-datatable
|
|
658
661
|
columns={mycolumns}
|
|
659
662
|
data={mydata}
|
|
660
|
-
key-field="
|
|
663
|
+
key-field="Id"
|
|
661
664
|
onheaderaction={handleHeaderAction}
|
|
662
665
|
>
|
|
663
666
|
</lightning-datatable>
|
|
@@ -746,7 +749,7 @@ Supported attributes for the row actions are as follows.
|
|
|
746
749
|
<lightning-datatable
|
|
747
750
|
columns={mycolumns}
|
|
748
751
|
data={mydata}
|
|
749
|
-
key-field="
|
|
752
|
+
key-field="Id"
|
|
750
753
|
onrowaction={handleRowAction}
|
|
751
754
|
>
|
|
752
755
|
</lightning-datatable>
|
|
@@ -890,7 +893,7 @@ Columns have a default minimum width of 50px and maximum width of 1000px. To cha
|
|
|
890
893
|
|
|
891
894
|
```html
|
|
892
895
|
<lightning-datatable
|
|
893
|
-
key-field="
|
|
896
|
+
key-field="Id"
|
|
894
897
|
data={data}
|
|
895
898
|
columns={columns}
|
|
896
899
|
min-column-width="80"
|
|
@@ -904,7 +907,7 @@ Resizing a column fires the `resize` event. For more information, See the **Cust
|
|
|
904
907
|
|
|
905
908
|
```html
|
|
906
909
|
<lightning-datatable
|
|
907
|
-
key-field="
|
|
910
|
+
key-field="Id"
|
|
908
911
|
data={data}
|
|
909
912
|
columns={columns}
|
|
910
913
|
onresize={handleResize}
|
|
@@ -982,7 +985,7 @@ useful when you want to preselect rows.
|
|
|
982
985
|
<lightning-datatable
|
|
983
986
|
columns={columns}
|
|
984
987
|
data={data}
|
|
985
|
-
key-field="
|
|
988
|
+
key-field="Id"
|
|
986
989
|
selected-rows={selectedRows}
|
|
987
990
|
>
|
|
988
991
|
</lightning-datatable>
|
|
@@ -1051,7 +1054,7 @@ press the Enter or Tab key, or move away from the cell.
|
|
|
1051
1054
|
```html
|
|
1052
1055
|
<template>
|
|
1053
1056
|
<lightning-datatable
|
|
1054
|
-
key-field="
|
|
1057
|
+
key-field="Id"
|
|
1055
1058
|
data={data}
|
|
1056
1059
|
columns={columns}
|
|
1057
1060
|
onsave={handleSave}
|
|
@@ -1104,7 +1107,7 @@ Your `lightning-datatable` component should look like this.
|
|
|
1104
1107
|
```html
|
|
1105
1108
|
<template>
|
|
1106
1109
|
<lightning-datatable
|
|
1107
|
-
key-field="
|
|
1110
|
+
key-field="Id"
|
|
1108
1111
|
data={data}
|
|
1109
1112
|
columns={columns}
|
|
1110
1113
|
errors={errors}
|
|
@@ -1187,7 +1190,7 @@ This example displays three lines of text and hides the rest; the text on line 3
|
|
|
1187
1190
|
<lightning-datatable
|
|
1188
1191
|
data={data}
|
|
1189
1192
|
columns={columns}
|
|
1190
|
-
key-field="
|
|
1193
|
+
key-field="Id"
|
|
1191
1194
|
wrap-text-max-lines="3"
|
|
1192
1195
|
>
|
|
1193
1196
|
</lightning-datatable>
|
|
@@ -1247,7 +1250,7 @@ If you have descriptions on an element or on multiple elements for the table, se
|
|
|
1247
1250
|
<h3 id="table-desc2">EMEA Region</h3>
|
|
1248
1251
|
<lightning-datatable
|
|
1249
1252
|
aria-labelledby="table-desc1 table-desc2"
|
|
1250
|
-
key-field="
|
|
1253
|
+
key-field="Id"
|
|
1251
1254
|
data={data}
|
|
1252
1255
|
columns={columns}
|
|
1253
1256
|
>
|
|
@@ -1426,3 +1429,10 @@ The event properties are as follows.
|
|
|
1426
1429
|
| bubbles | false | This event does not bubble. |
|
|
1427
1430
|
| cancelable | false | This event has no default behavior that can be canceled. You cannot call `preventDefault()` on this event. |
|
|
1428
1431
|
| composed | false | This event does not propagate outside the template in which it was dispatched. |
|
|
1432
|
+
|
|
1433
|
+
|
|
1434
|
+
#### LWC Recipes
|
|
1435
|
+
|
|
1436
|
+
The [LWC Recipes GitHub repository](https://github.com/trailheadapps/lwc-recipes) contains code examples for Lightning Web Components that you can test in an org.
|
|
1437
|
+
|
|
1438
|
+
For a recipe that uses `lightning-datatable`, see the `c-datatable-*` components in the LWC Recipes repo.
|
|
@@ -282,6 +282,9 @@ export class AutoWidthStrategy {
|
|
|
282
282
|
if (columnDefinition && columnDefinition.wrapText) {
|
|
283
283
|
return width / widthsMetadata.wrapTextMaxLines;
|
|
284
284
|
}
|
|
285
|
+
if (columnDefinition.fixedWidth) {
|
|
286
|
+
return columnDefinition.fixedWidth;
|
|
287
|
+
}
|
|
285
288
|
return width;
|
|
286
289
|
});
|
|
287
290
|
const headerCellWidths = datatableInterface.getHeaderCellWidths();
|
|
@@ -421,8 +421,8 @@ export default class LightningDatatable extends LightningElement {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Required for better performance.
|
|
425
|
-
*
|
|
424
|
+
* Required for better performance. Associates each row with a unique ID.
|
|
425
|
+
* key-field is case sensitive and must match the value you provide in the data array.
|
|
426
426
|
* @type {string}
|
|
427
427
|
* @required
|
|
428
428
|
*/
|
|
@@ -471,7 +471,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
|
-
* The maximum number of rows that can be selected.
|
|
474
|
+
* The maximum number of rows that can be selected. Value should be a positive integer
|
|
475
475
|
* Checkboxes are used for selection by default,
|
|
476
476
|
* and radio buttons are used when maxRowSelection is 1.
|
|
477
477
|
* @type {number}
|
|
@@ -792,11 +792,12 @@ export default class LightningDatatable extends LightningElement {
|
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
get computedTableStyle() {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
795
|
+
const tableLayout =
|
|
796
|
+
this._columnWidthManager.isAutoResizingUpdateQueued()
|
|
797
|
+
? 'auto'
|
|
798
|
+
: 'fixed';
|
|
798
799
|
return styleToString([
|
|
799
|
-
|
|
800
|
+
`table-layout:${tableLayout}`,
|
|
800
801
|
getCSSWidthStyleOfTable(this.widthsData),
|
|
801
802
|
]);
|
|
802
803
|
}
|
|
@@ -616,10 +616,13 @@ export function setMaxRowSelection(state, value) {
|
|
|
616
616
|
}
|
|
617
617
|
} else {
|
|
618
618
|
state.maxRowSelection = MAX_ROW_SELECTION_DEFAULT;
|
|
619
|
-
//
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
// suppress console error if no value is passed in
|
|
620
|
+
if (value !== null && value !== undefined) {
|
|
621
|
+
// eslint-disable-next-line no-console
|
|
622
|
+
console.error(
|
|
623
|
+
`The maxRowSelection value passed into lightning:datatable should be a positive integer. We receive instead (${value}).`
|
|
624
|
+
);
|
|
625
|
+
}
|
|
623
626
|
}
|
|
624
627
|
}
|
|
625
628
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
@import 'lightning/sldsCommon';
|
|
2
2
|
@import './input-text.slds.css';
|
|
3
|
-
@import './form-element.slds.css';
|
|
3
|
+
@import './form-element.slds.css';
|
|
@@ -7,7 +7,8 @@ import labelMinAndMaxRangeMessage from '@salesforce/label/LightningDateTimePicke
|
|
|
7
7
|
import labelRequired from '@salesforce/label/LightningControl.required';
|
|
8
8
|
import labelSelectDateFor from '@salesforce/label/LightningDateTimePicker.selectDateFor';
|
|
9
9
|
import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helptextAlternativeText';
|
|
10
|
-
import {
|
|
10
|
+
import { api, track } from 'lwc';
|
|
11
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
11
12
|
import {
|
|
12
13
|
normalizeISODate,
|
|
13
14
|
parseFormattedDate,
|
|
@@ -63,7 +64,7 @@ const DATE_STYLE = {
|
|
|
63
64
|
LONG: 'long',
|
|
64
65
|
};
|
|
65
66
|
|
|
66
|
-
export default class LightningDatePicker extends
|
|
67
|
+
export default class LightningDatePicker extends LightningShadowBaseClass {
|
|
67
68
|
static delegatesFocus = true;
|
|
68
69
|
|
|
69
70
|
@track _disabled = false;
|
|
@@ -381,6 +382,7 @@ export default class LightningDatePicker extends LightningElement {
|
|
|
381
382
|
}
|
|
382
383
|
|
|
383
384
|
connectedCallback() {
|
|
385
|
+
super.connectedCallback();
|
|
384
386
|
this.connected = true;
|
|
385
387
|
|
|
386
388
|
this.keyboardInterface = this.datepickerKeyboardInterface();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
@import 'lightning/sldsCommon';
|
|
2
2
|
@import './input-text.slds.css';
|
|
3
|
-
@import './form-element.slds.css';
|
|
3
|
+
@import './form-element.slds.css';
|
|
@@ -4,7 +4,8 @@ import labelRangeUnderflow from '@salesforce/label/LightningDateTimePicker.range
|
|
|
4
4
|
import labelTime from '@salesforce/label/LightningDateTimePicker.timeLabel';
|
|
5
5
|
import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helptextAlternativeText';
|
|
6
6
|
import sfTimeZone from '@salesforce/i18n/timeZone';
|
|
7
|
-
import {
|
|
7
|
+
import { api, track } from 'lwc';
|
|
8
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
8
9
|
import { classSet, formatLabel } from 'lightning/utils';
|
|
9
10
|
import {
|
|
10
11
|
normalizeBoolean,
|
|
@@ -34,7 +35,7 @@ const i18n = {
|
|
|
34
35
|
helpTextAlternativeText: labelHelpTextAlternativeText,
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
export default class LightningDateTimePicker extends
|
|
38
|
+
export default class LightningDateTimePicker extends LightningShadowBaseClass {
|
|
38
39
|
static delegatesFocus = true;
|
|
39
40
|
|
|
40
41
|
@track _disabled = false;
|
|
@@ -409,6 +410,7 @@ export default class LightningDateTimePicker extends LightningElement {
|
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
connectedCallback() {
|
|
413
|
+
super.connectedCallback();
|
|
412
414
|
this.connected = true;
|
|
413
415
|
|
|
414
416
|
// we set the initial values here in order to make sure timezone is available.
|
|
@@ -778,17 +778,26 @@ export default class LightningDualListbox extends LightningShadowBaseClass {
|
|
|
778
778
|
const toMove = values.filter(
|
|
779
779
|
(option) => this.highlightedOptions.indexOf(option) > -1
|
|
780
780
|
);
|
|
781
|
-
const
|
|
782
|
-
toMove.length
|
|
783
|
-
|
|
784
|
-
if (
|
|
781
|
+
const inValidSelection =
|
|
782
|
+
!toMove.length || this.selectedList !== this.computedSelectedListId;
|
|
783
|
+
|
|
784
|
+
if (inValidSelection) {
|
|
785
785
|
return;
|
|
786
786
|
}
|
|
787
|
+
|
|
787
788
|
let start = moveUp ? 0 : toMove.length - 1;
|
|
788
789
|
let index = values.indexOf(toMove[start]);
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
|
|
791
|
+
const nextItemIndex = moveUp ? index - 1 : index + 1;
|
|
792
|
+
const previousItem = this.computedSelectedList[nextItemIndex];
|
|
793
|
+
const isPreviousItemLocked = !!previousItem?.isLocked;
|
|
794
|
+
|
|
795
|
+
const inValidMove =
|
|
796
|
+
(moveUp && index === 0) ||
|
|
797
|
+
(!moveUp && index === values.length - 1) ||
|
|
798
|
+
isPreviousItemLocked;
|
|
799
|
+
|
|
800
|
+
if (inValidMove) {
|
|
792
801
|
return;
|
|
793
802
|
}
|
|
794
803
|
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
|
|
2
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) {
|
|
3
|
+
line-height: var(--sds-g-line-height);
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
word-wrap: break-word;
|
|
6
|
+
-webkit-hyphens: manual;
|
|
7
|
+
-ms-hyphens: manual;
|
|
8
|
+
hyphens: manual;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h1 {
|
|
12
|
+
font-size: var(--sds-g-font-scale-1, 1.125rem);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h2 {
|
|
16
|
+
font-size: var(--sds-g-font-scale-neg-1, 0.875rem);
|
|
17
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h3 {
|
|
21
|
+
font-size: var(--sds-g-font-scale-neg-1, 0.875rem);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h4 {
|
|
25
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
26
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h5 {
|
|
30
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h6 {
|
|
34
|
+
font-size: var(--sds-g-font-scale-neg-4, 0.625rem);
|
|
35
|
+
font-weight: var(--sds-g-font-weight-7, 700);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) h1,:host([data-render-mode="shadow"].slds-rich-text-editor__output) h2,:host([data-render-mode="shadow"].slds-rich-text-editor__output) h3,:host([data-render-mode="shadow"].slds-rich-text-editor__output) h4,:host([data-render-mode="shadow"].slds-rich-text-editor__output) h5,:host([data-render-mode="shadow"].slds-rich-text-editor__output) h6,:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul,:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol,:host([data-render-mode="shadow"].slds-rich-text-editor__output) dl,:host([data-render-mode="shadow"].slds-rich-text-editor__output) img {
|
|
39
|
+
margin-block-end: var(--sds-g-spacing-3, 0.75rem);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) blockquote {
|
|
43
|
+
margin: var(--sds-g-spacing-6, 2rem) var(--sds-g-spacing-5, 1.5rem);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ins {
|
|
47
|
+
color: var(--slds-g-color-success-base-50, var(--sds-g-color-success-base-50, #2e844a));
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) del {
|
|
52
|
+
color: var(--slds-g-color-error-base-30, var(--sds-g-color-error-base-50, #ea001e));
|
|
53
|
+
text-decoration: line-through;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul {
|
|
57
|
+
margin-inline-start: var(--sds-g-spacing-5, 1.5rem);
|
|
58
|
+
list-style: disc;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul ul {
|
|
62
|
+
list-style: circle;
|
|
63
|
+
margin-block-end: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul ul ul {
|
|
67
|
+
list-style: square;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul ul ul ul {
|
|
71
|
+
list-style: disc;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul ul ul ul ul {
|
|
75
|
+
list-style: circle;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ul ol {
|
|
79
|
+
margin-inline-start: var(--sds-g-spacing-5, 1.5rem);
|
|
80
|
+
list-style: decimal;
|
|
81
|
+
margin-block-end: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol {
|
|
85
|
+
margin-inline-start: var(--sds-g-spacing-5, 1.5rem);
|
|
86
|
+
list-style: decimal;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol ol {
|
|
90
|
+
list-style: lower-alpha;
|
|
91
|
+
margin-block-end: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol ol ol {
|
|
95
|
+
list-style: lower-roman;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol ol ol ol {
|
|
99
|
+
list-style: decimal;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol ol ol ol ol {
|
|
103
|
+
list-style: lower-alpha;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) ol ul {
|
|
107
|
+
margin-inline-start: var(--sds-g-spacing-5, 1.5rem);
|
|
108
|
+
list-style: disc;
|
|
109
|
+
margin-block-end: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) dd {
|
|
113
|
+
margin-inline-start: var(--sds-g-spacing-7, 2.5rem);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) abbr[title],:host([data-render-mode="shadow"].slds-rich-text-editor__output) acronym[title] {
|
|
117
|
+
border-bottom: var(--sds-g-sizing-border-1, 1px) dotted;
|
|
118
|
+
cursor: help;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) table {
|
|
122
|
+
overflow-wrap: normal;
|
|
123
|
+
word-wrap: normal;
|
|
124
|
+
word-break: normal;
|
|
125
|
+
width: auto;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) table caption {
|
|
129
|
+
text-align: center;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) th,:host([data-render-mode="shadow"].slds-rich-text-editor__output) td {
|
|
133
|
+
padding: var(--sds-g-spacing-2, 0.5rem);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .sans-serif {
|
|
137
|
+
font-family: sans-serif;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .courier {
|
|
141
|
+
font-family: courier;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .verdana {
|
|
145
|
+
font-family: verdana;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .tahoma {
|
|
149
|
+
font-family: tahoma;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .garamond {
|
|
153
|
+
font-family: garamond;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .serif {
|
|
157
|
+
font-family: serif;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-1:not(.ql-direction-rtl) {
|
|
161
|
+
padding-inline-start: var(--sds-g-spacing-8, 3rem);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-1.ql-direction-rtl.ql-align-right {
|
|
165
|
+
padding-inline-end: var(--sds-g-spacing-8, 3rem);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-2:not(.ql-direction-rtl) {
|
|
169
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 2);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-2.ql-direction-rtl.ql-align-right {
|
|
173
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 2);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-3:not(.ql-direction-rtl) {
|
|
177
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 3);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-3.ql-direction-rtl.ql-align-right {
|
|
181
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 3);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-4:not(.ql-direction-rtl) {
|
|
185
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 4);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-4.ql-direction-rtl.ql-align-right {
|
|
189
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 4);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-5:not(.ql-direction-rtl) {
|
|
193
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 5);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-5.ql-direction-rtl.ql-align-right {
|
|
197
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 5);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-6:not(.ql-direction-rtl) {
|
|
201
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 6);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-6.ql-direction-rtl.ql-align-right {
|
|
205
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 6);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-7:not(.ql-direction-rtl) {
|
|
209
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 7);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-7.ql-direction-rtl.ql-align-right {
|
|
213
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 7);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-8:not(.ql-direction-rtl) {
|
|
217
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 8);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-8.ql-direction-rtl.ql-align-right {
|
|
221
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 8);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-9:not(.ql-direction-rtl) {
|
|
225
|
+
padding-inline-start: calc(var(--sds-g-spacing-8, 3rem) * 9);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:host([data-render-mode="shadow"].slds-rich-text-editor__output) .ql-indent-9.ql-direction-rtl.ql-align-right {
|
|
229
|
+
padding-inline-end: calc(var(--sds-g-spacing-8, 3rem) * 9);
|
|
230
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import sanitizeHTML from 'lightning/purifyLib';
|
|
3
4
|
import { linkify } from './linkify';
|
|
4
5
|
import { richTextConfig } from './richTextConfig';
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
* Displays rich text that's formatted with allowed tags and attributes.
|
|
13
14
|
* Other tags and attributes are removed and only their text content is displayed.
|
|
14
15
|
*/
|
|
15
|
-
export default class LightningFormattedRichText extends
|
|
16
|
+
export default class LightningFormattedRichText extends LightningShadowBaseClass {
|
|
16
17
|
/**
|
|
17
18
|
* If present, the component does not create links in the rich text.
|
|
18
19
|
* @type {boolean}
|
|
@@ -57,6 +58,7 @@ export default class LightningFormattedRichText extends LightningElement {
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
connectedCallback() {
|
|
61
|
+
super.connectedCallback();
|
|
60
62
|
this.classList.add('slds-rich-text-editor__output');
|
|
61
63
|
this.connected = true;
|
|
62
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'lightning/sldsCommon'
|