lightning-base-components 1.19.7-alpha → 1.19.8-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 +78 -0
- package/package.json +5 -1
- package/scopedImports/@salesforce-label-LightningProgressRing.progressRing.js +1 -0
- package/src/lightning/baseCombobox/baseCombobox.css +8 -0
- package/src/lightning/baseCombobox/baseCombobox.js +1 -0
- package/src/lightning/datatable/README.md +2 -1
- package/src/lightning/datatable/columnResizer.js +22 -18
- package/src/lightning/datatable/columnWidthManager.js +30 -22
- package/src/lightning/datatable/errors.js +2 -2
- package/src/lightning/datatable/infiniteLoading.js +13 -14
- package/src/lightning/datatable/sort.js +15 -16
- package/src/lightning/datatable/tree.js +10 -6
- package/src/lightning/datatable/types.js +158 -129
- package/src/lightning/datatable/utils.js +26 -24
- package/src/lightning/datatable/wrapText.js +15 -8
- package/src/lightning/input/input.html +23 -2
- package/src/lightning/input/input.js +54 -2
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +74 -69
- package/src/lightning/primitiveDatatableStatusBar/primitiveDatatableStatusBar.js +8 -2
- package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +62 -87
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +3 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +3 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +3 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +3 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.html +3 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.js +3 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +3 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +3 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +6 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +7 -19
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +4 -1
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +3 -0
- package/src/lightning/progressRing/progressRing.html +9 -7
- package/src/lightning/progressRing/progressRing.js +15 -0
- package/src/lightning/tabBar/tabBar.html +5 -1
- package/src/lightning/tabBar/tabBar.js +25 -9
- package/src/lightning/utils/classSet.js +19 -19
- package/src/lightning/utilsPrivate/aria.js +11 -8
- package/src/lightning/utilsPrivate/classListMutation.js +5 -3
- package/src/lightning/utilsPrivate/classSet.js +11 -0
- package/src/lightning/utilsPrivate/eventEmitter.js +4 -4
- package/src/lightning/utilsPrivate/inert.js +6 -4
- package/src/lightning/utilsPrivate/utilsPrivate.js +40 -8
|
@@ -1,106 +1,143 @@
|
|
|
1
1
|
import { assert } from 'lightning/utilsPrivate';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
text
|
|
5
|
-
boolean
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const STANDARD_TYPE_NAME_ENTRIES = [
|
|
4
|
+
['text', ['linkify']],
|
|
5
|
+
['boolean', []],
|
|
6
|
+
[
|
|
7
|
+
'number',
|
|
8
|
+
[
|
|
9
|
+
'minimumIntegerDigits',
|
|
10
|
+
'minimumFractionDigits',
|
|
11
|
+
'maximumFractionDigits',
|
|
12
|
+
'minimumSignificantDigits',
|
|
13
|
+
'maximumSignificantDigits',
|
|
14
|
+
],
|
|
12
15
|
],
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
[
|
|
17
|
+
'currency',
|
|
18
|
+
[
|
|
19
|
+
'currencyCode',
|
|
20
|
+
'currencyDisplayAs',
|
|
21
|
+
'minimumIntegerDigits',
|
|
22
|
+
'minimumFractionDigits',
|
|
23
|
+
'maximumFractionDigits',
|
|
24
|
+
'minimumSignificantDigits',
|
|
25
|
+
'maximumSignificantDigits',
|
|
26
|
+
],
|
|
21
27
|
],
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
[
|
|
29
|
+
'percent',
|
|
30
|
+
[
|
|
31
|
+
'minimumIntegerDigits',
|
|
32
|
+
'minimumFractionDigits',
|
|
33
|
+
'maximumFractionDigits',
|
|
34
|
+
'minimumSignificantDigits',
|
|
35
|
+
'maximumSignificantDigits',
|
|
36
|
+
],
|
|
28
37
|
],
|
|
29
|
-
email
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
['email', []],
|
|
39
|
+
[
|
|
40
|
+
'date',
|
|
41
|
+
[
|
|
42
|
+
'day',
|
|
43
|
+
'era',
|
|
44
|
+
'hour',
|
|
45
|
+
'hour12',
|
|
46
|
+
'minute',
|
|
47
|
+
'month',
|
|
48
|
+
'second',
|
|
49
|
+
'timeZone',
|
|
50
|
+
'timeZoneName',
|
|
51
|
+
'weekday',
|
|
52
|
+
'year',
|
|
53
|
+
],
|
|
42
54
|
],
|
|
43
|
-
'date-local'
|
|
44
|
-
phone
|
|
45
|
-
url
|
|
46
|
-
location
|
|
47
|
-
reference
|
|
48
|
-
rowNumber
|
|
49
|
-
action
|
|
50
|
-
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
['date-local', ['day', 'month', 'year']],
|
|
56
|
+
['phone', []],
|
|
57
|
+
['url', ['label', 'target', 'tooltip']],
|
|
58
|
+
['location', []],
|
|
59
|
+
['reference', ['displayValue']],
|
|
60
|
+
['rowNumber', ['error']],
|
|
61
|
+
['action', ['menuAlignment', 'rowActions']],
|
|
62
|
+
[
|
|
63
|
+
'button',
|
|
64
|
+
[
|
|
65
|
+
'variant',
|
|
66
|
+
'label',
|
|
67
|
+
'iconName',
|
|
68
|
+
'iconPosition',
|
|
69
|
+
'disabled',
|
|
70
|
+
'name',
|
|
71
|
+
'class',
|
|
72
|
+
'title',
|
|
73
|
+
],
|
|
59
74
|
],
|
|
60
|
-
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
[
|
|
76
|
+
'button-icon',
|
|
77
|
+
[
|
|
78
|
+
'variant',
|
|
79
|
+
'alternativeText',
|
|
80
|
+
'iconName',
|
|
81
|
+
'iconClass',
|
|
82
|
+
'disabled',
|
|
83
|
+
'name',
|
|
84
|
+
'class',
|
|
85
|
+
'title',
|
|
86
|
+
],
|
|
69
87
|
],
|
|
70
|
-
|
|
71
|
-
'
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
[
|
|
89
|
+
'tree',
|
|
90
|
+
[
|
|
91
|
+
'hasChildren',
|
|
92
|
+
'isExpanded',
|
|
93
|
+
'level',
|
|
94
|
+
'setSize',
|
|
95
|
+
'posInSet',
|
|
96
|
+
'subType',
|
|
97
|
+
],
|
|
77
98
|
],
|
|
78
|
-
|
|
99
|
+
];
|
|
79
100
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
101
|
+
const STANDARD_TYPE_VALUE_ENTRIES = Array(STANDARD_TYPE_NAME_ENTRIES.length);
|
|
102
|
+
for (let i = 0, { length } = STANDARD_TYPE_NAME_ENTRIES; i < length; i += 1) {
|
|
103
|
+
const { 0: typeName, 1: typeAttributes } = STANDARD_TYPE_NAME_ENTRIES[i];
|
|
104
|
+
STANDARD_TYPE_VALUE_ENTRIES[i] = [
|
|
105
|
+
typeName,
|
|
106
|
+
{
|
|
107
|
+
typeAttributes,
|
|
108
|
+
type: 'standard',
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const STANDARD_TYPE_NAMES = new Map(STANDARD_TYPE_NAME_ENTRIES);
|
|
114
|
+
|
|
115
|
+
const STANDARD_TYPE_VALUES = new Map(STANDARD_TYPE_VALUE_ENTRIES);
|
|
91
116
|
|
|
92
|
-
const
|
|
93
|
-
text
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
'
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
const TREE_SUPPORTED_TYPES = new Set([
|
|
118
|
+
'text',
|
|
119
|
+
'url',
|
|
120
|
+
'date',
|
|
121
|
+
'number',
|
|
122
|
+
'currency',
|
|
123
|
+
'percent',
|
|
124
|
+
'button',
|
|
125
|
+
'button-icon',
|
|
126
|
+
'reference',
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
const EDITABLE_STANDARD_TYPES = new Set([
|
|
130
|
+
'text',
|
|
131
|
+
'percent',
|
|
132
|
+
'phone',
|
|
133
|
+
'email',
|
|
134
|
+
'url',
|
|
135
|
+
'currency',
|
|
136
|
+
'number',
|
|
137
|
+
'boolean',
|
|
138
|
+
'date-local',
|
|
139
|
+
'date',
|
|
140
|
+
]);
|
|
104
141
|
|
|
105
142
|
/**
|
|
106
143
|
* Determines if a supplied type is a valid datatable type.
|
|
@@ -109,7 +146,7 @@ const EDITABLE_STANDARD_TYPES = {
|
|
|
109
146
|
* @returns {Boolean} Whether the supplied type is valid
|
|
110
147
|
*/
|
|
111
148
|
export function isValidType(typeName) {
|
|
112
|
-
return
|
|
149
|
+
return STANDARD_TYPE_NAMES.has(typeName);
|
|
113
150
|
}
|
|
114
151
|
|
|
115
152
|
/**
|
|
@@ -129,7 +166,7 @@ export function isTreeType(typeName) {
|
|
|
129
166
|
* @returns {Boolean} Whether the supplied type is valid for a tree
|
|
130
167
|
*/
|
|
131
168
|
export function isValidTypeForTree(typeName) {
|
|
132
|
-
return
|
|
169
|
+
return TREE_SUPPORTED_TYPES.has(typeName);
|
|
133
170
|
}
|
|
134
171
|
|
|
135
172
|
/**
|
|
@@ -154,36 +191,36 @@ export function getAttributesNames(typeName) {
|
|
|
154
191
|
* @returns {Array} An array of attributes for the supplied type
|
|
155
192
|
*/
|
|
156
193
|
function getStandardTypeAttributesNames(typeName) {
|
|
157
|
-
return
|
|
158
|
-
? STANDARD_TYPES[typeName]
|
|
159
|
-
: [];
|
|
194
|
+
return STANDARD_TYPE_NAMES.get(typeName) || [];
|
|
160
195
|
}
|
|
161
196
|
|
|
162
197
|
/**
|
|
163
198
|
* A class for handling valid datatable types.
|
|
164
199
|
*/
|
|
165
200
|
export default class DatatableTypes {
|
|
166
|
-
privateCustomTypes =
|
|
201
|
+
privateCustomTypes = new Map();
|
|
167
202
|
isValidTypeForTree = isValidTypeForTree;
|
|
168
203
|
|
|
169
204
|
constructor(types) {
|
|
170
205
|
if (typeof types === 'object' && types !== null) {
|
|
171
|
-
|
|
206
|
+
const { privateCustomTypes } = this;
|
|
207
|
+
const keys = Object.keys(types);
|
|
208
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
209
|
+
const key = keys[i];
|
|
172
210
|
const {
|
|
173
211
|
template,
|
|
174
212
|
editTemplate,
|
|
175
213
|
typeAttributes = [],
|
|
176
214
|
standardCellLayout = false,
|
|
177
215
|
} = types[key];
|
|
178
|
-
|
|
216
|
+
privateCustomTypes.set(key, {
|
|
179
217
|
template,
|
|
180
218
|
editTemplate,
|
|
181
219
|
typeAttributes,
|
|
182
220
|
standardCellLayout: standardCellLayout === true,
|
|
183
221
|
type: 'custom',
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
}, this.privateCustomTypes);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
187
224
|
}
|
|
188
225
|
}
|
|
189
226
|
|
|
@@ -195,16 +232,10 @@ export default class DatatableTypes {
|
|
|
195
232
|
* @returns {Object | Undefined} The type metadata
|
|
196
233
|
*/
|
|
197
234
|
getType(typeName) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return {
|
|
203
|
-
typeAttributes: getStandardTypeAttributesNames(typeName),
|
|
204
|
-
type: 'standard',
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
return undefined;
|
|
235
|
+
return (
|
|
236
|
+
this.privateCustomTypes.get(typeName) ||
|
|
237
|
+
STANDARD_TYPE_VALUES.get(typeName)
|
|
238
|
+
);
|
|
208
239
|
}
|
|
209
240
|
|
|
210
241
|
/**
|
|
@@ -214,10 +245,8 @@ export default class DatatableTypes {
|
|
|
214
245
|
* @returns {Object | Undefined} The custom type's edit template
|
|
215
246
|
*/
|
|
216
247
|
getCustomTypeEditTemplate(typeName) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
return undefined;
|
|
248
|
+
const privateType = this.privateCustomTypes.get(typeName);
|
|
249
|
+
return privateType ? privateType.editTemplate : undefined;
|
|
221
250
|
}
|
|
222
251
|
|
|
223
252
|
/**
|
|
@@ -227,7 +256,10 @@ export default class DatatableTypes {
|
|
|
227
256
|
* @returns {Boolean} Whether the type is valid
|
|
228
257
|
*/
|
|
229
258
|
isValidType(typeName) {
|
|
230
|
-
return
|
|
259
|
+
return (
|
|
260
|
+
this.privateCustomTypes.has(typeName) ||
|
|
261
|
+
STANDARD_TYPE_NAMES.has(typeName)
|
|
262
|
+
);
|
|
231
263
|
}
|
|
232
264
|
|
|
233
265
|
/**
|
|
@@ -237,10 +269,11 @@ export default class DatatableTypes {
|
|
|
237
269
|
* @returns {Boolean} Whether the type is editable
|
|
238
270
|
*/
|
|
239
271
|
isEditableType(typeName) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
);
|
|
272
|
+
if (EDITABLE_STANDARD_TYPES.has(typeName)) {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
const privateType = this.privateCustomTypes.get(typeName);
|
|
276
|
+
return privateType ? privateType.standardCellLayout : false;
|
|
244
277
|
}
|
|
245
278
|
|
|
246
279
|
/**
|
|
@@ -250,9 +283,7 @@ export default class DatatableTypes {
|
|
|
250
283
|
* @returns {Boolean} Whether the type is a non-standard type
|
|
251
284
|
*/
|
|
252
285
|
isCustomType(typeName) {
|
|
253
|
-
return (
|
|
254
|
-
this.getType(typeName) && this.getType(typeName).type === 'custom'
|
|
255
|
-
);
|
|
286
|
+
return this.privateCustomTypes.has(typeName);
|
|
256
287
|
}
|
|
257
288
|
|
|
258
289
|
/**
|
|
@@ -262,9 +293,7 @@ export default class DatatableTypes {
|
|
|
262
293
|
* @returns {Boolean} Whether the custom type is using a standard cell layout
|
|
263
294
|
*/
|
|
264
295
|
isStandardCellLayoutForCustomType(typeName) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
this.getType(typeName).standardCellLayout
|
|
268
|
-
);
|
|
296
|
+
const privateType = this.privateCustomTypes.get(typeName);
|
|
297
|
+
return privateType ? privateType.standardCellLayout : false;
|
|
269
298
|
}
|
|
270
299
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { classSetToString } from 'lightning/utilsPrivate';
|
|
2
|
+
|
|
1
3
|
const CLASSSET_PROTOTYPE = {
|
|
2
4
|
add(className) {
|
|
3
5
|
if (typeof className === 'string') {
|
|
@@ -8,15 +10,15 @@ const CLASSSET_PROTOTYPE = {
|
|
|
8
10
|
return this;
|
|
9
11
|
},
|
|
10
12
|
invert() {
|
|
11
|
-
Object.keys(this)
|
|
13
|
+
const keys = Object.keys(this);
|
|
14
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
15
|
+
const key = keys[i];
|
|
12
16
|
this[key] = !this[key];
|
|
13
|
-
}
|
|
17
|
+
}
|
|
14
18
|
return this;
|
|
15
19
|
},
|
|
16
20
|
toString() {
|
|
17
|
-
return
|
|
18
|
-
.filter((key) => this[key])
|
|
19
|
-
.join(' ');
|
|
21
|
+
return classSetToString(this);
|
|
20
22
|
},
|
|
21
23
|
};
|
|
22
24
|
|
|
@@ -48,14 +50,11 @@ export const isObjectLike = function (value) {
|
|
|
48
50
|
* @param {String | Object} config The initial class configuration
|
|
49
51
|
* @returns An interface, as defined in the `proto` method.
|
|
50
52
|
*/
|
|
51
|
-
export
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
return Object.assign(Object.create(CLASSSET_PROTOTYPE), config);
|
|
58
|
-
};
|
|
53
|
+
export function classSet(config) {
|
|
54
|
+
return typeof config === 'string'
|
|
55
|
+
? { __proto__: CLASSSET_PROTOTYPE, [config]: true }
|
|
56
|
+
: Object.assign({ __proto__: CLASSSET_PROTOTYPE }, config);
|
|
57
|
+
}
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* Clamps a value between a minimum and maximum value
|
|
@@ -65,9 +64,9 @@ export const classSet = function (config) {
|
|
|
65
64
|
* @param {Number} max The maximum value the number can be
|
|
66
65
|
* @returns The clamped number
|
|
67
66
|
*/
|
|
68
|
-
export
|
|
67
|
+
export function clamp(num, min, max) {
|
|
69
68
|
return num <= min ? min : num >= max ? max : num;
|
|
70
|
-
}
|
|
69
|
+
}
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
72
|
* Tests if the value passed in is a value greater than 0.
|
|
@@ -75,9 +74,9 @@ export const clamp = function (num, min, max) {
|
|
|
75
74
|
* @param {Integer} value Value to test
|
|
76
75
|
* @returns {Boolean} Whether the value is greater than 0
|
|
77
76
|
*/
|
|
78
|
-
export
|
|
77
|
+
export function isPositiveInteger(value) {
|
|
79
78
|
return /^[0-9]*[1-9][0-9]*$/.test(value);
|
|
80
|
-
}
|
|
79
|
+
}
|
|
81
80
|
|
|
82
81
|
/**
|
|
83
82
|
* Tests if the value passed in is 0 or a number greater than 0.
|
|
@@ -85,9 +84,9 @@ export const isPositiveInteger = function (value) {
|
|
|
85
84
|
* @param {Integer} value Value to test
|
|
86
85
|
* @returns {Boolean} Whether the value is greater than or equal to 0
|
|
87
86
|
*/
|
|
88
|
-
export
|
|
87
|
+
export function isNonNegativeInteger(value) {
|
|
89
88
|
return /^\d+$/.test(value);
|
|
90
|
-
}
|
|
89
|
+
}
|
|
91
90
|
|
|
92
91
|
/**
|
|
93
92
|
* Accepts a value which may be an Integer or String and tests that value
|
|
@@ -152,10 +151,13 @@ export function getScrollOffsetFromTableEnd(el) {
|
|
|
152
151
|
* @returns {String} Representing array/object as a string
|
|
153
152
|
*/
|
|
154
153
|
export function styleToString(style) {
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
if (Array.isArray(style)) {
|
|
155
|
+
return style.join(';');
|
|
156
|
+
}
|
|
157
|
+
const entries = Object.keys(style);
|
|
158
|
+
for (let i = 0, { length } = entries; i < length; i += 1) {
|
|
159
|
+
const key = entries[i];
|
|
160
|
+
entries[i] = `${key}:${style[key]}`;
|
|
159
161
|
}
|
|
160
|
-
return
|
|
162
|
+
return entries.join(';');
|
|
161
163
|
}
|
|
@@ -80,13 +80,15 @@ export function setWrapTextMaxLines(state, value) {
|
|
|
80
80
|
* @param {String} colKeyValue The column key value to look up wrap text configuration
|
|
81
81
|
*/
|
|
82
82
|
function updateWrapTextAndMaxLinesValuesInCells(state, colIndex, colKeyValue) {
|
|
83
|
-
|
|
83
|
+
const { rows } = state;
|
|
84
|
+
for (let i = 0, { length } = rows; i < length; i += 1) {
|
|
85
|
+
const row = rows[i];
|
|
84
86
|
const cell = row.cells[colIndex];
|
|
85
87
|
cell.wrapText = state.wrapText[colKeyValue];
|
|
86
88
|
cell.wrapTextMaxLines = cell.wrapText
|
|
87
89
|
? state.wrapTextMaxLines
|
|
88
90
|
: undefined;
|
|
89
|
-
}
|
|
91
|
+
}
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
/************************** HEADER ACTIONS **************************/
|
|
@@ -159,18 +161,23 @@ export function handleTriggeredAction(state, action, colKeyValue) {
|
|
|
159
161
|
* @param {String} colKeyValue The column key.
|
|
160
162
|
*/
|
|
161
163
|
function updateSelectedOptionInHeaderActions(state, colKeyValue) {
|
|
162
|
-
const columns = getColumns(state);
|
|
163
164
|
const colIndex = getStateColumnIndex(state, colKeyValue);
|
|
165
|
+
if (colIndex === -1) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const columns = getColumns(state);
|
|
164
169
|
const colData = columns[colIndex];
|
|
170
|
+
const { internalActions } = colData.actions;
|
|
165
171
|
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
for (let i = 0, { length } = internalActions; i < length; i += 1) {
|
|
173
|
+
const action = internalActions[i];
|
|
174
|
+
const { name } = action;
|
|
175
|
+
if (name === 'wrapText') {
|
|
168
176
|
action.checked = state.wrapText[colKeyValue];
|
|
169
|
-
}
|
|
170
|
-
if (action.name === 'clipText') {
|
|
177
|
+
} else if (name === 'clipText') {
|
|
171
178
|
action.checked = !state.wrapText[colKeyValue];
|
|
172
179
|
}
|
|
173
|
-
}
|
|
180
|
+
}
|
|
174
181
|
|
|
175
182
|
updateWrapTextAndMaxLinesValuesInCells(state, colIndex, colKeyValue);
|
|
176
183
|
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
accesskey={accesskey}
|
|
6
6
|
aria-errormessage="help-message"
|
|
7
7
|
aria-haspopup={ariaHasPopup}
|
|
8
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
9
|
+
aria-disabled={ariaDisabled}
|
|
10
|
+
aria-roledescription={ariaRoleDescription}
|
|
8
11
|
aria-invalid={computedAriaInvalid}
|
|
9
12
|
aria-label={computedAriaLabel}
|
|
13
|
+
aria-expanded={ariaExpanded}
|
|
14
|
+
aria-autocomplete={ariaAutoComplete}
|
|
10
15
|
autocomplete={autocomplete}
|
|
11
16
|
computed-label-class={computedLabelClass}
|
|
12
17
|
disabled={disabled}
|
|
@@ -25,12 +30,13 @@
|
|
|
25
30
|
name={name}
|
|
26
31
|
onblur={handleBlur}
|
|
27
32
|
onfocus={handleFocus}
|
|
28
|
-
onchange={
|
|
33
|
+
onchange={handlePrimitiveInputChange}
|
|
29
34
|
oncommit={handleCommit}
|
|
30
35
|
pattern={pattern}
|
|
31
36
|
placeholder={placeholder}
|
|
32
37
|
readonly={readOnly}
|
|
33
38
|
required={required}
|
|
39
|
+
role={role}
|
|
34
40
|
step={step}
|
|
35
41
|
type={type}
|
|
36
42
|
timezone={timezone}
|
|
@@ -44,6 +50,9 @@
|
|
|
44
50
|
<lightning-primitive-input-toggle
|
|
45
51
|
accesskey={accesskey}
|
|
46
52
|
aria-label={computedAriaLabel}
|
|
53
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
54
|
+
aria-disabled={ariaDisabled}
|
|
55
|
+
aria-roledescription={ariaRoleDescription}
|
|
47
56
|
aria-invalid={computedAriaInvalid}
|
|
48
57
|
checked={checked}
|
|
49
58
|
disabled={disabled}
|
|
@@ -66,6 +75,9 @@
|
|
|
66
75
|
<lightning-primitive-input-checkbox
|
|
67
76
|
accesskey={accesskey}
|
|
68
77
|
aria-label={computedAriaLabel}
|
|
78
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
79
|
+
aria-disabled={ariaDisabled}
|
|
80
|
+
aria-roledescription={ariaRoleDescription}
|
|
69
81
|
aria-invalid={computedAriaInvalid}
|
|
70
82
|
checked={checked}
|
|
71
83
|
disabled={disabled}
|
|
@@ -88,6 +100,9 @@
|
|
|
88
100
|
<lightning-primitive-input-checkbox-button
|
|
89
101
|
label={label}
|
|
90
102
|
aria-label={ariaLabel}
|
|
103
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
104
|
+
aria-disabled={ariaDisabled}
|
|
105
|
+
aria-roledescription={ariaRoleDescription}
|
|
91
106
|
aria-invalid={computedAriaInvalid}
|
|
92
107
|
required={required}
|
|
93
108
|
accesskey={accesskey}
|
|
@@ -106,6 +121,9 @@
|
|
|
106
121
|
<lightning-primitive-input-radio
|
|
107
122
|
accesskey={accesskey}
|
|
108
123
|
aria-invalid={computedAriaInvalid}
|
|
124
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
125
|
+
aria-disabled={ariaDisabled}
|
|
126
|
+
aria-roledescription={ariaRoleDescription}
|
|
109
127
|
aria-label={ariaLabel}
|
|
110
128
|
disabled={disabled}
|
|
111
129
|
help-message={_helpMessage}
|
|
@@ -125,6 +143,9 @@
|
|
|
125
143
|
accept={accept}
|
|
126
144
|
accesskey={accesskey}
|
|
127
145
|
aria-invalid={computedAriaInvalid}
|
|
146
|
+
aria-keyshortcuts={ariaKeyShortcuts}
|
|
147
|
+
aria-disabled={ariaDisabled}
|
|
148
|
+
aria-roledescription={ariaRoleDescription}
|
|
128
149
|
aria-label={computedAriaLabel}
|
|
129
150
|
disabled={disabled}
|
|
130
151
|
help-message={_helpMessage}
|
|
@@ -150,7 +171,7 @@
|
|
|
150
171
|
onblur={handleBlur}
|
|
151
172
|
oncommit={handleCommit}
|
|
152
173
|
onfocus={handleFocus}
|
|
153
|
-
onchange={
|
|
174
|
+
onchange={handlePrimitiveInputChange}
|
|
154
175
|
has-external-label={hasExternalLabel}
|
|
155
176
|
required={required}
|
|
156
177
|
accesskey={accesskey}
|