lightning-base-components 1.14.3-alpha → 1.14.7-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 +37 -4
- package/package.json +11 -4
- package/scopedImports/@salesforce-label-LightningModalBase.cancelandclose.js +1 -0
- package/scopedImports/@salesforce-label-LightningProgressBar.progressBar.js +1 -0
- package/src/lightning/alert/__docs__/alert.md +101 -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/ariaObserver/__component__/ariaObserver.spec.js +9 -0
- package/src/lightning/ariaObserver/ariaObserver.js +24 -35
- package/src/lightning/baseFormattedText/baseFormattedText.html +6 -1
- package/src/lightning/baseFormattedText/baseFormattedText.js +5 -0
- package/src/lightning/buttonMenu/buttonMenu.js +12 -0
- package/src/lightning/confirm/__docs__/confirm.md +100 -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/__examples__/withInfiniteLoading/fetchDataHelper.js +21 -0
- package/src/lightning/datatable/__examples__/withInfiniteLoading/withInfiniteLoading.html +13 -0
- package/src/lightning/datatable/__examples__/withInfiniteLoading/withInfiniteLoading.js +42 -0
- package/src/lightning/datatable/autoWidthStrategy.js +170 -61
- package/src/lightning/datatable/{resizer.js → columnResizer.js} +0 -0
- package/src/lightning/datatable/columnWidthManager.js +226 -44
- package/src/lightning/datatable/columns.js +166 -71
- package/src/lightning/datatable/datatable.js +132 -60
- package/src/lightning/datatable/fixedWidthStrategy.js +43 -8
- package/src/lightning/datatable/headerActions.js +2 -2
- package/src/lightning/datatable/infiniteLoading.js +100 -28
- package/src/lightning/datatable/inlineEdit.js +21 -30
- package/src/lightning/datatable/keyboard.js +166 -131
- package/src/lightning/datatable/renderManager.js +117 -122
- package/src/lightning/datatable/{datatableResizeObserver.js → resizeObserver.js} +46 -29
- package/src/lightning/datatable/resizeSensor.js +19 -3
- package/src/lightning/datatable/rowSelection.js +1 -1
- package/src/lightning/datatable/rowSelectionShared.js +33 -20
- package/src/lightning/datatable/rows.js +7 -8
- package/src/lightning/datatable/sort.js +8 -8
- package/src/lightning/datatable/state.js +14 -2
- package/src/lightning/datatable/templates/div/div.html +127 -117
- package/src/lightning/datatable/templates/table/table.html +5 -0
- 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/widthManagerShared.js +27 -3
- package/src/lightning/datatable/wrapText.js +115 -48
- package/src/lightning/formattedDateTime/__docs__/formattedDateTime.md +36 -3
- package/src/lightning/formattedDateTime/__examples__/datetime/datetime.html +2 -2
- package/src/lightning/formattedDateTime/__examples__/datetime/datetime.js +3 -1
- package/src/lightning/formattedDateTime/__examples__/time/time.html +1 -1
- package/src/lightning/formattedDateTime/__examples__/time/time.js +3 -1
- package/src/lightning/formattedDateTime/formattedDateTime.js +1 -0
- 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 +2 -5
- 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/progressBar/progressBar.html +2 -1
- package/src/lightning/progressBar/progressBar.js +18 -1
- package/src/lightning/prompt/__docs__/prompt.md +102 -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/spinner/spinner.html +1 -1
- package/src/lightning/spinner/spinner.js +12 -0
- package/src/lightning/utilsPrivate/phonify.js +1 -1
- package/scopedImports/@salesforce-label-LightningModalBase.close.js +0 -1
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
import { isRowNumberColumn, getRowNumberErrorColumnDef } from './rowNumber';
|
|
19
19
|
import { getRowError } from './errors';
|
|
20
20
|
import { getDirtyValueFromCell } from './inlineEditShared';
|
|
21
|
-
import { DEFAULT_ROW_HEIGHT } from './renderManager';
|
|
22
21
|
|
|
23
22
|
export function getData(state) {
|
|
24
23
|
return state.data;
|
|
@@ -77,8 +76,7 @@ export function resolveRowClassNames(row) {
|
|
|
77
76
|
* @param {object} state - data table state
|
|
78
77
|
* @param {string} rowKeyValue - computed id for the row
|
|
79
78
|
* @param {string} colKeyValue - computed id for the column
|
|
80
|
-
*
|
|
81
|
-
* @return {object} The user row that its related to the action.
|
|
79
|
+
* @returns {object} The user row that its related to the action.
|
|
82
80
|
*/
|
|
83
81
|
export function getUserRowByCellKeys(state, rowKeyValue, colKeyValue) {
|
|
84
82
|
const rowIndex = state.indexes[rowKeyValue][colKeyValue][0];
|
|
@@ -115,8 +113,8 @@ export function uniqueRowKeyGenerator(keyField) {
|
|
|
115
113
|
* @param {object} state - the current datatable state
|
|
116
114
|
*/
|
|
117
115
|
export function updateRowsAndCellIndexes() {
|
|
118
|
-
const { state, privateTypes: types
|
|
119
|
-
const { keyField, renderModeRoleBased } = state;
|
|
116
|
+
const { state, privateTypes: types } = this;
|
|
117
|
+
const { keyField, renderModeRoleBased, virtualize, rowHeight } = state;
|
|
120
118
|
const data = getData(state);
|
|
121
119
|
const columns = getColumns(state);
|
|
122
120
|
const computeUniqueRowKey = uniqueRowKeyGenerator(keyField);
|
|
@@ -135,6 +133,7 @@ export function updateRowsAndCellIndexes() {
|
|
|
135
133
|
|
|
136
134
|
state.indexes[row.key] = { rowIndex };
|
|
137
135
|
|
|
136
|
+
row.rowIndex = rowIndex;
|
|
138
137
|
row.inputType = getRowSelectionInputType(state);
|
|
139
138
|
row.isSelected = isSelectedRow(state, row.key);
|
|
140
139
|
row.ariaSelected = row.isSelected ? 'true' : false;
|
|
@@ -142,10 +141,10 @@ export function updateRowsAndCellIndexes() {
|
|
|
142
141
|
row.classnames = resolveRowClassNames(row);
|
|
143
142
|
Object.assign(row, getRowStateForTree(rowData, state));
|
|
144
143
|
row.tabIndex = -1;
|
|
145
|
-
if (
|
|
144
|
+
if (virtualize) {
|
|
146
145
|
row.style = styleToString({
|
|
147
146
|
position: 'absolute',
|
|
148
|
-
top: `${rowIndex *
|
|
147
|
+
top: `${rowIndex * rowHeight}px`,
|
|
149
148
|
});
|
|
150
149
|
}
|
|
151
150
|
|
|
@@ -402,7 +401,7 @@ function computeCellEditable(row, column) {
|
|
|
402
401
|
* @param {object} row - a row data object stored in datatable state. Must be truthy.
|
|
403
402
|
* @param {object} column - a column data object stored in datatable state. Must be truthy.
|
|
404
403
|
*/
|
|
405
|
-
function isCellEditable(row, column) {
|
|
404
|
+
export function isCellEditable(row, column) {
|
|
406
405
|
return !!resolveAttributeValue(column.editable, row);
|
|
407
406
|
}
|
|
408
407
|
|
|
@@ -10,8 +10,8 @@ const VALID_SORT_DIRECTIONS = {
|
|
|
10
10
|
* Determines if the supplied sort direction is valid.
|
|
11
11
|
* Refer to `VALID_SORT_DIRECTIONS` for valid solid directions.
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
14
|
-
* @
|
|
13
|
+
* @param {String} value The sort direction to validate
|
|
14
|
+
* @returns {Boolean} Whether the supplied sort direction is valid
|
|
15
15
|
*/
|
|
16
16
|
export function isValidSortDirection(value) {
|
|
17
17
|
return !!VALID_SORT_DIRECTIONS[value];
|
|
@@ -22,7 +22,7 @@ export function isValidSortDirection(value) {
|
|
|
22
22
|
* the default sort direction is applied first. Clicking again reverses it
|
|
23
23
|
*
|
|
24
24
|
* @param {Object} state The current datatable state
|
|
25
|
-
* @
|
|
25
|
+
* @returns {String} The default sort direction
|
|
26
26
|
*/
|
|
27
27
|
export function getDefaultSortDirection(state) {
|
|
28
28
|
return state.defaultSortDirection;
|
|
@@ -33,7 +33,7 @@ export function getDefaultSortDirection(state) {
|
|
|
33
33
|
* the default sort direction is applied first. Clicking again reverses it
|
|
34
34
|
*
|
|
35
35
|
* @param {Object} state The current datatable state
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {String} value The value to update the default sort direction to
|
|
37
37
|
*/
|
|
38
38
|
export function setDefaultSortDirection(state, value) {
|
|
39
39
|
assert(
|
|
@@ -51,7 +51,7 @@ export function setDefaultSortDirection(state, value) {
|
|
|
51
51
|
* Gets the current sort direction
|
|
52
52
|
*
|
|
53
53
|
* @param {Object} state The current datatable state
|
|
54
|
-
* @
|
|
54
|
+
* @returns {String} The current sort direction
|
|
55
55
|
*/
|
|
56
56
|
export function getSortedDirection(state) {
|
|
57
57
|
return state.sortedDirection;
|
|
@@ -64,7 +64,7 @@ export function getSortedDirection(state) {
|
|
|
64
64
|
* `sortedDirection` will be `undefined`
|
|
65
65
|
*
|
|
66
66
|
* @param {Object} state The current datatable state
|
|
67
|
-
* @param {
|
|
67
|
+
* @param {String} value The value to update the sort direction to
|
|
68
68
|
*/
|
|
69
69
|
export function setSortedDirection(state, value) {
|
|
70
70
|
assert(
|
|
@@ -81,7 +81,7 @@ export function setSortedDirection(state, value) {
|
|
|
81
81
|
* of a given column in the datatable
|
|
82
82
|
*
|
|
83
83
|
* @param {Object} state The current datatable state
|
|
84
|
-
* @
|
|
84
|
+
* @returns {String} The current sort value
|
|
85
85
|
*/
|
|
86
86
|
export function getSortedBy(state) {
|
|
87
87
|
return state.sortedBy;
|
|
@@ -94,7 +94,7 @@ export function getSortedBy(state) {
|
|
|
94
94
|
* to `undefined`
|
|
95
95
|
*
|
|
96
96
|
* @param {Object} state The current datatable state
|
|
97
|
-
* @param {
|
|
97
|
+
* @param {String} value The value to update the sort state to
|
|
98
98
|
*/
|
|
99
99
|
export function setSortedBy(state, value) {
|
|
100
100
|
if (typeof value === 'string') {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* The state object is further manipulated while it is passed around by datatable
|
|
4
4
|
*
|
|
5
5
|
* TODO: Check to see if there are other items that need to be added to the default state
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* @returns {Object} Intial state of the datatable
|
|
7
8
|
*/
|
|
8
9
|
export const getDefaultState = function () {
|
|
9
10
|
return {
|
|
@@ -55,8 +56,19 @@ export const getDefaultState = function () {
|
|
|
55
56
|
// table render mode
|
|
56
57
|
renderModeRoleBased: false,
|
|
57
58
|
|
|
58
|
-
// viewport rendering
|
|
59
|
+
// viewport rendering and virtualization
|
|
59
60
|
enableViewportRendering: undefined,
|
|
61
|
+
virtualize: '',
|
|
62
|
+
bufferSize: 5, // number of extra rows rendered on each side outside of viewport
|
|
63
|
+
rowHeight: 30.5,
|
|
64
|
+
renderedRowCount: 0,
|
|
65
|
+
firstVisibleIndex: 0, // first row that should be visible in viewport
|
|
66
|
+
fixedHeight: false, // by default, assume that not all rows are same height
|
|
67
|
+
heightCache: {}, // cache of row heights
|
|
68
|
+
offsets: [0],
|
|
69
|
+
offsetRanges: [],
|
|
70
|
+
firstRowOffset: 0, // how many pixels scrollTop is from top of first visible row
|
|
71
|
+
tableHeight: 0,
|
|
60
72
|
|
|
61
73
|
// inline edit
|
|
62
74
|
inlineEdit: {
|
|
@@ -41,13 +41,16 @@
|
|
|
41
41
|
</template>
|
|
42
42
|
<template if:true={hasValidKeyField}>
|
|
43
43
|
<!-- Corresponds to <thead> -->
|
|
44
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
data-rowgroup-header
|
|
46
|
+
role="rowgroup">
|
|
45
47
|
<!-- TODO: Fix aria-rowindex to not be hardcoded -->
|
|
46
48
|
<!-- TODO: might need to move the table-header class out or rename -->
|
|
47
49
|
<!-- Column Header Row -->
|
|
48
50
|
<div class="slds-line-height_reset table-header"
|
|
49
51
|
role="row"
|
|
50
52
|
aria-rowindex="1"
|
|
53
|
+
data-row-key-value="HEADER"
|
|
51
54
|
onprivateresizestart={handleResizeStart}
|
|
52
55
|
onprivateresizeend={handleResizeEnd}>
|
|
53
56
|
<template for:each={state.columns} for:item="def" for:index="colIndex">
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
tabindex={def.tabIndex}
|
|
59
62
|
aria-label={def.ariaLabel}
|
|
60
63
|
aria-sort={def.sortAriaLabel}
|
|
64
|
+
data-col-key-value={def.colKeyValue}
|
|
61
65
|
key={def.colKeyValue}>
|
|
62
66
|
|
|
63
67
|
<template if:true={def.fixedWidth}>
|
|
@@ -106,8 +110,11 @@
|
|
|
106
110
|
</div>
|
|
107
111
|
</div>
|
|
108
112
|
<!-- Corresponds to <tbody> -->
|
|
109
|
-
<div
|
|
110
|
-
|
|
113
|
+
<div
|
|
114
|
+
data-rowgroup-body
|
|
115
|
+
role="rowgroup"
|
|
116
|
+
style={computedTbodyStyle}>
|
|
117
|
+
<template for:each={renderedRows} for:item="row">
|
|
111
118
|
<!-- Data Rows -->
|
|
112
119
|
<div class={row.classnames}
|
|
113
120
|
role="row"
|
|
@@ -122,125 +129,128 @@
|
|
|
122
129
|
aria-rowindex={row.ariaRowIndex}
|
|
123
130
|
style={row.style}
|
|
124
131
|
tabindex={row.tabIndex}>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
data-label={cell.dataLabel}
|
|
133
|
-
key={cell.colKeyValue}>
|
|
134
|
-
<lightning-primitive-cell-checkbox
|
|
135
|
-
dt-context-id={_datatableId}
|
|
136
|
-
has-focus={cell.hasFocus}
|
|
132
|
+
<template for:each={row.cells} for:item="cell">
|
|
133
|
+
<template if:true={cell.isCheckbox}>
|
|
134
|
+
<!-- Checkbox Cell -->
|
|
135
|
+
<div class={cell.class}
|
|
136
|
+
style={cell.style}
|
|
137
|
+
role="gridcell"
|
|
138
|
+
tabindex={cell.tabIndex}
|
|
137
139
|
data-label={cell.dataLabel}
|
|
138
|
-
key={cell.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
types={privateTypes}
|
|
140
|
+
data-col-key-value={cell.colKeyValue}
|
|
141
|
+
key={cell.colKeyValue}>
|
|
142
|
+
<lightning-primitive-cell-checkbox
|
|
143
|
+
dt-context-id={_datatableId}
|
|
144
|
+
has-focus={cell.hasFocus}
|
|
145
|
+
data-label={cell.dataLabel}
|
|
146
|
+
key={cell.key}
|
|
147
|
+
row-key-value={row.key}
|
|
148
|
+
col-key-value={cell.colKeyValue}
|
|
149
|
+
row-index={row.rowIndex}
|
|
150
|
+
type={row.inputType}
|
|
151
|
+
is-selected={row.isSelected}
|
|
152
|
+
is-disabled={row.isDisabled}
|
|
153
|
+
column-header-id={computedCheckboxColumnHeaderId}>
|
|
154
|
+
</lightning-primitive-cell-checkbox>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
<template if:true={cell.isDataTypeScope}>
|
|
158
|
+
<!-- Row Header Cell -->
|
|
159
|
+
<div class={cell.class}
|
|
160
|
+
role="rowheader"
|
|
161
|
+
style={cell.style}
|
|
161
162
|
aria-selected={cell.ariaSelected}
|
|
163
|
+
aria-readonly={cell.ariaReadOnly}
|
|
164
|
+
tabindex={cell.tabIndex}
|
|
162
165
|
data-label={cell.dataLabel}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
types={privateTypes}
|
|
166
|
+
data-col-key-value={cell.colKeyValue}
|
|
167
|
+
key={cell.colKeyValue}>
|
|
168
|
+
<lightning-primitive-cell-factory
|
|
169
|
+
types={privateTypes}
|
|
170
|
+
aria-selected={cell.ariaSelected}
|
|
171
|
+
data-label={cell.dataLabel}
|
|
172
|
+
alignment={cell.alignment}
|
|
173
|
+
has-error={cell.hasError}
|
|
174
|
+
has-focus={cell.hasFocus}
|
|
175
|
+
column-label={cell.dataLabel}
|
|
176
|
+
column-type={cell.columnType}
|
|
177
|
+
column-sub-type={cell.columnSubType}
|
|
178
|
+
wrap-text={cell.wrapText}
|
|
179
|
+
wrap-text-max-lines={cell.wrapTextMaxLines}
|
|
180
|
+
key={cell.columnType}
|
|
181
|
+
row-key-value={row.key}
|
|
182
|
+
col-key-value={cell.colKeyValue}
|
|
183
|
+
value={cell.value}
|
|
184
|
+
icon-name={cell.iconName}
|
|
185
|
+
icon-label={cell.iconLabel}
|
|
186
|
+
icon-position={cell.iconPosition}
|
|
187
|
+
icon-alternative-text={cell.iconAlternativeText}
|
|
188
|
+
editable={cell.editable}
|
|
189
|
+
display-read-only-icon={cell.displayReadOnlyIcon}
|
|
190
|
+
type-attribute-0={cell.typeAttribute0}
|
|
191
|
+
type-attribute-1={cell.typeAttribute1}
|
|
192
|
+
type-attribute-2={cell.typeAttribute2}
|
|
193
|
+
type-attribute-3={cell.typeAttribute3}
|
|
194
|
+
type-attribute-4={cell.typeAttribute4}
|
|
195
|
+
type-attribute-5={cell.typeAttribute5}
|
|
196
|
+
type-attribute-6={cell.typeAttribute6}
|
|
197
|
+
type-attribute-7={cell.typeAttribute7}
|
|
198
|
+
type-attribute-8={cell.typeAttribute8}
|
|
199
|
+
type-attribute-9={cell.typeAttribute9}
|
|
200
|
+
type-attribute-10={cell.typeAttribute10}
|
|
201
|
+
type-attribute-21={cell.typeAttribute21}
|
|
202
|
+
type-attribute-22={cell.typeAttribute22}>
|
|
203
|
+
</lightning-primitive-cell-factory>
|
|
204
|
+
</div>
|
|
205
|
+
</template>
|
|
206
|
+
<template if:true={cell.isDataType}>
|
|
207
|
+
<!-- Non-Header Cells (Regular Data Cells) -->
|
|
208
|
+
<div class={cell.class}
|
|
209
|
+
role="gridcell"
|
|
210
|
+
style={cell.style}
|
|
209
211
|
aria-selected={cell.ariaSelected}
|
|
212
|
+
aria-readonly={cell.ariaReadOnly}
|
|
213
|
+
tabindex={cell.tabIndex}
|
|
210
214
|
data-label={cell.dataLabel}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
215
|
+
data-col-key-value={cell.colKeyValue}
|
|
216
|
+
key={cell.colKeyValue}>
|
|
217
|
+
<lightning-primitive-cell-factory
|
|
218
|
+
types={privateTypes}
|
|
219
|
+
aria-selected={cell.ariaSelected}
|
|
220
|
+
data-label={cell.dataLabel}
|
|
221
|
+
alignment={cell.alignment}
|
|
222
|
+
has-focus={cell.hasFocus}
|
|
223
|
+
has-error={cell.hasError}
|
|
224
|
+
column-label={cell.dataLabel}
|
|
225
|
+
column-type={cell.columnType}
|
|
226
|
+
column-sub-type={cell.columnSubType}
|
|
227
|
+
wrap-text={cell.wrapText}
|
|
228
|
+
wrap-text-max-lines={cell.wrapTextMaxLines}
|
|
229
|
+
key={cell.columnType}
|
|
230
|
+
row-key-value={row.key}
|
|
231
|
+
col-key-value={cell.colKeyValue}
|
|
232
|
+
value={cell.value}
|
|
233
|
+
icon-name={cell.iconName}
|
|
234
|
+
icon-label={cell.iconLabel}
|
|
235
|
+
icon-position={cell.iconPosition}
|
|
236
|
+
icon-alternative-text={cell.iconAlternativeText}
|
|
237
|
+
editable={cell.editable}
|
|
238
|
+
display-read-only-icon={cell.displayReadOnlyIcon}
|
|
239
|
+
type-attribute-0={cell.typeAttribute0}
|
|
240
|
+
type-attribute-1={cell.typeAttribute1}
|
|
241
|
+
type-attribute-2={cell.typeAttribute2}
|
|
242
|
+
type-attribute-3={cell.typeAttribute3}
|
|
243
|
+
type-attribute-4={cell.typeAttribute4}
|
|
244
|
+
type-attribute-5={cell.typeAttribute5}
|
|
245
|
+
type-attribute-6={cell.typeAttribute6}
|
|
246
|
+
type-attribute-7={cell.typeAttribute7}
|
|
247
|
+
type-attribute-8={cell.typeAttribute8}
|
|
248
|
+
type-attribute-9={cell.typeAttribute9}
|
|
249
|
+
type-attribute-10={cell.typeAttribute10}
|
|
250
|
+
type-attribute-21={cell.typeAttribute21}
|
|
251
|
+
type-attribute-22={cell.typeAttribute22}>
|
|
252
|
+
</lightning-primitive-cell-factory>
|
|
253
|
+
</div>
|
|
244
254
|
</template>
|
|
245
255
|
</template>
|
|
246
256
|
</div>
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
<thead>
|
|
42
42
|
<!-- Column Header Row -->
|
|
43
43
|
<tr class="slds-line-height_reset"
|
|
44
|
+
data-row-key-value="HEADER"
|
|
44
45
|
onprivateresizestart={handleResizeStart}
|
|
45
46
|
onprivateresizeend={handleResizeEnd}>
|
|
46
47
|
<template for:each={state.columns} for:item="def" for:index="colIndex">
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
tabindex={def.tabIndex}
|
|
51
52
|
aria-label={def.ariaLabel}
|
|
52
53
|
aria-sort={def.sortAriaLabel}
|
|
54
|
+
data-col-key-value={def.colKeyValue}
|
|
53
55
|
key={def.colKeyValue}>
|
|
54
56
|
|
|
55
57
|
<template if:true={def.fixedWidth}>
|
|
@@ -117,6 +119,7 @@
|
|
|
117
119
|
role="gridcell"
|
|
118
120
|
tabindex={cell.tabIndex}
|
|
119
121
|
data-label={cell.dataLabel}
|
|
122
|
+
data-col-key-value={cell.colKeyValue}
|
|
120
123
|
key={cell.colKeyValue}>
|
|
121
124
|
<lightning-primitive-cell-checkbox
|
|
122
125
|
dt-context-id={_datatableId}
|
|
@@ -142,6 +145,7 @@
|
|
|
142
145
|
scope="row"
|
|
143
146
|
tabindex={cell.tabIndex}
|
|
144
147
|
data-label={cell.dataLabel}
|
|
148
|
+
data-col-key-value={cell.colKeyValue}
|
|
145
149
|
key={cell.colKeyValue}>
|
|
146
150
|
<lightning-primitive-cell-factory
|
|
147
151
|
types={privateTypes}
|
|
@@ -190,6 +194,7 @@
|
|
|
190
194
|
aria-readonly={cell.ariaReadOnly}
|
|
191
195
|
tabindex={cell.tabIndex}
|
|
192
196
|
data-label={cell.dataLabel}
|
|
197
|
+
data-col-key-value={cell.colKeyValue}
|
|
193
198
|
key={cell.colKeyValue}>
|
|
194
199
|
<lightning-primitive-cell-factory
|
|
195
200
|
types={privateTypes}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { getColumns } from './columns';
|
|
2
2
|
import { isTreeType } from './types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the default values for the tree state indicator field names.
|
|
6
|
+
* These values are used to make logic decisions later and may be updated
|
|
7
|
+
* during normal operation.
|
|
8
|
+
*
|
|
9
|
+
* @returns {Object} The default tree state indicator field names
|
|
10
|
+
*/
|
|
4
11
|
export function getTreeStateIndicatorFieldNames() {
|
|
5
12
|
return {
|
|
6
13
|
children: 'hasChildren',
|
|
@@ -11,6 +18,12 @@ export function getTreeStateIndicatorFieldNames() {
|
|
|
11
18
|
};
|
|
12
19
|
}
|
|
13
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Determines if any of the columns in the datatable are of a tree-type.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} state The datatable state
|
|
25
|
+
* @returns {Boolean} Whether any of the columns are of a tree-type
|
|
26
|
+
*/
|
|
14
27
|
export function hasTreeDataType(state) {
|
|
15
28
|
const columns = getColumns(state);
|
|
16
29
|
return columns.some((column) => {
|
|
@@ -18,6 +31,12 @@ export function hasTreeDataType(state) {
|
|
|
18
31
|
});
|
|
19
32
|
}
|
|
20
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the first tree-type column from the state.
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} state The datatable state
|
|
38
|
+
* @returns {Object} The first tree-type column, else `null`
|
|
39
|
+
*/
|
|
21
40
|
export function getStateTreeColumn(state) {
|
|
22
41
|
const columns = getColumns(state);
|
|
23
42
|
for (let i = 0; i < columns.length; i++) {
|
|
@@ -28,6 +47,12 @@ export function getStateTreeColumn(state) {
|
|
|
28
47
|
return null;
|
|
29
48
|
}
|
|
30
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Dispatches an event when a row is toggled to be expanded or collapsed.
|
|
52
|
+
*
|
|
53
|
+
* @param {String} rowKeyValue The row key being acted upon
|
|
54
|
+
* @param {Boolean} expanded The current expand/collapse state of the row
|
|
55
|
+
*/
|
|
31
56
|
export function fireRowToggleEvent(rowKeyValue, expanded) {
|
|
32
57
|
const customEvent = new CustomEvent('privatetogglecell', {
|
|
33
58
|
bubbles: true,
|