lightning-base-components 1.13.9-alpha → 1.14.1-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.
Files changed (41) hide show
  1. package/package.json +5 -1
  2. package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
  3. package/scopedImports/@salesforce-label-LightningLookup.recentItems.js +1 -0
  4. package/src/lightning/baseCombobox/baseCombobox.html +1 -0
  5. package/src/lightning/baseCombobox/baseCombobox.js +14 -1
  6. package/src/lightning/combobox/combobox.css +12 -0
  7. package/src/lightning/combobox/combobox.html +1 -0
  8. package/src/lightning/datatable/columnWidthManager.js +7 -3
  9. package/src/lightning/datatable/datatable.js +27 -18
  10. package/src/lightning/datatable/inlineEdit.js +15 -3
  11. package/src/lightning/datatable/keyboard.js +1077 -933
  12. package/src/lightning/datatable/resizer.js +91 -108
  13. package/src/lightning/datatable/state.js +0 -9
  14. package/src/lightning/datatable/templates/div/div.css +19 -0
  15. package/src/lightning/datatable/templates/div/div.html +5 -5
  16. package/src/lightning/datatable/templates/table/table.html +4 -4
  17. package/src/lightning/datatable/widthManagerShared.js +1 -1
  18. package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +2 -1
  19. package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_alt.html +1 -2
  20. package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_doc.html +8 -0
  21. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +2 -1
  22. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_alt.html +1 -2
  23. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_doc.html +8 -0
  24. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +2 -1
  25. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_alt.html +1 -2
  26. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_doc.html +8 -0
  27. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +2 -1
  28. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_alt.html +1 -2
  29. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_doc.html +8 -0
  30. package/src/lightning/input/input.html +0 -1
  31. package/src/lightning/input/input.js +21 -25
  32. package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.js +20 -0
  33. package/src/lightning/primitiveDatatableIeditTypeFactory/primitiveDatatableIeditTypeFactory.js +10 -0
  34. package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +5 -4
  35. package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +46 -46
  36. package/src/lightning/primitiveHeaderFactory/selectableHeader.html +25 -23
  37. package/src/lightning/primitiveHeaderFactory/sortableHeader.html +13 -9
  38. package/src/lightning/progressIndicator/progressIndicator.js +3 -5
  39. package/src/lightning/progressStep/progressStep.js +2 -1
  40. package/src/lightning/utilsPrivate/utilsPrivate.js +11 -1
  41. package/src/lightning/utilsPrivate/contentMutation.js +0 -295
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.13.9-alpha",
3
+ "version": "1.14.1-alpha",
4
4
  "engines": {
5
5
  "node": ">=12.18.3"
6
6
  },
@@ -793,6 +793,10 @@
793
793
  "name": "@salesforce/label/LightningLookup.recentObject",
794
794
  "path": "scopedImports/@salesforce-label-LightningLookup.recentObject.js"
795
795
  },
796
+ {
797
+ "name": "@salesforce/label/LightningLookup.recentItems",
798
+ "path": "scopedImports/@salesforce-label-LightningLookup.recentItems.js"
799
+ },
796
800
  {
797
801
  "name": "@salesforce/label/LightningLookup.resultsListHeaderMobile",
798
802
  "path": "scopedImports/@salesforce-label-LightningLookup.resultsListHeaderMobile.js"
@@ -1 +1 @@
1
- export default '234';
1
+ export default '236';
@@ -0,0 +1 @@
1
+ export default 'Recent Items';
@@ -46,6 +46,7 @@
46
46
  name={name}
47
47
  data-value={computedInputValue}
48
48
  disabled={disabled}
49
+ aria-label={computedButtonTriggerAriaLabel}
49
50
  onfocus={handleFocus}
50
51
  onkeydown={handleInputKeyDown}
51
52
  onblur={handleBlur}>
@@ -328,7 +328,9 @@ export default class LightningBaseCombobox extends LightningElement {
328
328
  [ARIA_DESCRIBEDBY]: this.computedAriaDescribedBy,
329
329
  [ARIA_ACTIVEDESCENDANT]: this._activeElementDomId,
330
330
  [ARIA_CONTROLS]: this.computedInputControls,
331
- [ARIA_LABEL]: this.inputLabel,
331
+ [ARIA_LABEL]: this.isUserInputDisabled
332
+ ? this.computedButtonTriggerAriaLabel
333
+ : this.inputLabel,
332
334
  });
333
335
  }
334
336
 
@@ -441,6 +443,17 @@ export default class LightningBaseCombobox extends LightningElement {
441
443
  return this.hasInputPill ? this.inputPill.label : this.inputText;
442
444
  }
443
445
 
446
+ get computedButtonTriggerAriaLabel() {
447
+ const label = this.inputLabel;
448
+ const value = this.computedInputValue || this.computedPlaceholder;
449
+
450
+ if (!label) {
451
+ return value;
452
+ }
453
+
454
+ return `${label}, ${value}`;
455
+ }
456
+
444
457
  handleListboxScroll(event) {
445
458
  // We don't want this to bubble up to the modal which due to event retargeting wouldn't be able
446
459
  // to know what is actually being scrolled and thus may lead to the scrolling of the modal
@@ -1,3 +1,15 @@
1
1
  :host {
2
2
  display: block;
3
3
  }
4
+
5
+ /**
6
+ This is adding the red border around the combobox input when there's an error
7
+ Should be removed once SLDS has added support for this (@W-9240038)
8
+ */
9
+ :host.slds-has-error {
10
+ --slds-c-input-color-border:#ea001e;
11
+ --slds-c-input-shadow:#ea001e 0 0 0 1px inset;
12
+ --slds-c-input-color-background:var(--slds-c-input-color-background, var(--sds-c-input-color-background, white));
13
+ --slds-c-input-text-color:var(--slds-c-input-text-color, var(--sds-c-input-text-color), #74747);
14
+ }
15
+
@@ -15,6 +15,7 @@
15
15
  placeholder={placeholder}
16
16
  items={_items}
17
17
  input-text={_selectedLabel}
18
+ input-label={label}
18
19
  input-icon-size="xx-small"
19
20
  input-icon-name="utility:down"
20
21
  show-dropdown-activity-indicator={spinnerActive}
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  getColumnWidthFromDef,
15
15
  getDomWidth,
16
- getWidthStyle,
16
+ buildCSSWidthStyle,
17
17
  } from './widthManagerShared';
18
18
  import { isRTL } from 'lightning/utilsPrivate';
19
19
 
@@ -35,7 +35,7 @@ export function computeColumnWidths(adjustedWidths, columnDefs, widthsData) {
35
35
  const newWidth = columnWidths[index];
36
36
  widthsData.columnWidths[index] = newWidth;
37
37
  columnDef.columnWidth = newWidth;
38
- columnDef.style = getWidthStyle(newWidth);
38
+ columnDef.style = buildCSSWidthStyle(newWidth);
39
39
 
40
40
  // In RTL, we need to explicitly position the column headers.
41
41
  // We do this by providing the offset (in pixels) from the start of the table.
@@ -312,7 +312,11 @@ export class ColumnWidthManager {
312
312
  return [];
313
313
  },
314
314
  getTableElementWidth() {
315
- const tableElement = root.querySelector(TABLE_SEL);
315
+ // TODO: Figure out a clean way to retrieve and use the correct selectors
316
+ // Currently outside scope of this work. Should be addressed in W-8540110
317
+ const tableElement =
318
+ root.querySelector(TABLE_SEL) ||
319
+ root.querySelector('[role="grid"]');
316
320
  return getDomWidth(tableElement);
317
321
  },
318
322
  };
@@ -35,7 +35,7 @@ import {
35
35
  getColumnsWidths,
36
36
  resizeColumnWithDelta,
37
37
  getCustomerColumnWidths,
38
- getTableWidthStyle,
38
+ getCSSWidthStyleOfTable,
39
39
  updateColumnWidthsMetadata,
40
40
  getResizerDefaultState,
41
41
  } from './resizer';
@@ -56,7 +56,7 @@ import {
56
56
  } from './selector';
57
57
  import {
58
58
  syncActiveCell,
59
- handleCellKeydown,
59
+ handleKeydownOnCell,
60
60
  updateActiveCell,
61
61
  setBlurActiveCell,
62
62
  setFocusActiveCell,
@@ -67,7 +67,7 @@ import {
67
67
  updateTabIndexActiveRow,
68
68
  unsetRowNavigationMode,
69
69
  updateRowNavigationMode,
70
- handleDatatableLosedFocus,
70
+ handleDatatableFocusOut,
71
71
  handleDatatableFocusIn,
72
72
  updateTabIndexRow,
73
73
  getIndexesActiveCell,
@@ -77,7 +77,7 @@ import {
77
77
  resetCellToFocusFromPrev,
78
78
  datatableHasFocus,
79
79
  setCellClickedForFocus,
80
- handleKeyDown,
80
+ handleKeydownOnTable,
81
81
  addFocusStylesToActiveCell,
82
82
  refocusCellElement,
83
83
  } from './keyboard';
@@ -448,7 +448,7 @@ export default class LightningDatatable extends LightningElement {
448
448
 
449
449
  set maxColumnWidth(value) {
450
450
  const { state, widthsData } = this;
451
- setMaxColumnWidth(state, widthsData, value);
451
+ setMaxColumnWidth(getColumns(state), widthsData, value);
452
452
  this._columnWidthManager.maxColumnWidth = this.maxColumnWidth;
453
453
  }
454
454
 
@@ -484,7 +484,7 @@ export default class LightningDatatable extends LightningElement {
484
484
 
485
485
  set minColumnWidth(value) {
486
486
  const { state, widthsData } = this;
487
- setMinColumnWidth(state, widthsData, value);
487
+ setMinColumnWidth(getColumns(state), widthsData, value);
488
488
  this._columnWidthManager.minColumnWidth = this.minColumnWidth;
489
489
  }
490
490
 
@@ -761,9 +761,10 @@ export default class LightningDatatable extends LightningElement {
761
761
  if (this._columnWidthManager.isAutoResizingUpdateQueued()) {
762
762
  return ['table-layout:auto'].join(';');
763
763
  }
764
- return ['table-layout:fixed', getTableWidthStyle(this.widthsData)].join(
765
- ';'
766
- );
764
+ return [
765
+ 'table-layout:fixed',
766
+ getCSSWidthStyleOfTable(this.widthsData),
767
+ ].join(';');
767
768
  }
768
769
 
769
770
  get computedTbodyStyle() {
@@ -795,7 +796,7 @@ export default class LightningDatatable extends LightningElement {
795
796
  if (this._columnWidthManager.isAutoResizingUpdateQueued()) {
796
797
  return `${minHeight}overflow-x:auto`;
797
798
  }
798
- return `${minHeight}${getTableWidthStyle(this.widthsData)}`;
799
+ return `${minHeight}${getCSSWidthStyleOfTable(this.widthsData)}`;
799
800
  }
800
801
 
801
802
  get scrollerXStyles() {
@@ -987,7 +988,7 @@ export default class LightningDatatable extends LightningElement {
987
988
  // Cell Interaction
988
989
  this.template.addEventListener(
989
990
  'privatecellkeydown',
990
- handleCellKeydown.bind(this)
991
+ handleKeydownOnCell.bind(this)
991
992
  );
992
993
 
993
994
  this.template.addEventListener(
@@ -1126,15 +1127,15 @@ export default class LightningDatatable extends LightningElement {
1126
1127
  * @param {KeyboardEvent} event - `keydown`
1127
1128
  */
1128
1129
  handleTableKeydown(event) {
1129
- handleKeyDown.call(this, event);
1130
+ handleKeydownOnTable.call(this, event);
1130
1131
  }
1131
1132
 
1132
1133
  /**
1133
- * Handles the `keydown` event on <tr> (table-based) and div[role="row"] (role-based)
1134
+ * Handles the `keydown` event on data row <tr> (table-based) and div[role="row"] (role-based)
1134
1135
  *
1135
1136
  * @param {KeyboardEvent} event - `keydown`
1136
1137
  */
1137
- handleTrRowKeyDown(event) {
1138
+ handleKeydownOnDataRow(event) {
1138
1139
  // we probably should not be doing this unless we actually are interested in it
1139
1140
  if (
1140
1141
  this.state.keyboardMode === 'NAVIGATION' &&
@@ -1248,7 +1249,12 @@ export default class LightningDatatable extends LightningElement {
1248
1249
  const { state, widthsData } = this;
1249
1250
  const { colIndex, widthDelta } = event.detail;
1250
1251
  if (widthDelta !== 0) {
1251
- resizeColumnWithDelta(state, widthsData, colIndex, widthDelta);
1252
+ resizeColumnWithDelta(
1253
+ getColumns(state),
1254
+ widthsData,
1255
+ colIndex,
1256
+ widthDelta
1257
+ );
1252
1258
  this.fireOnResize(true);
1253
1259
  this.safariHeaderFix();
1254
1260
  }
@@ -1349,7 +1355,7 @@ export default class LightningDatatable extends LightningElement {
1349
1355
  * @param {FocusEvent} event - `focusout`
1350
1356
  */
1351
1357
  handleTableFocusOut(event) {
1352
- handleDatatableLosedFocus.call(this, event);
1358
+ handleDatatableFocusOut.call(this, event);
1353
1359
  }
1354
1360
 
1355
1361
  /**
@@ -1439,7 +1445,10 @@ export default class LightningDatatable extends LightningElement {
1439
1445
  const { state, widthsData } = this;
1440
1446
  const event = new CustomEvent('resize', {
1441
1447
  detail: {
1442
- columnWidths: getCustomerColumnWidths(state, widthsData),
1448
+ columnWidths: getCustomerColumnWidths(
1449
+ getColumns(state),
1450
+ widthsData
1451
+ ),
1443
1452
  isUserTriggered: !!isUserTriggered,
1444
1453
  },
1445
1454
  });
@@ -1501,7 +1510,7 @@ export default class LightningDatatable extends LightningElement {
1501
1510
  this.updateRowsAndCellIndexes(state);
1502
1511
  updateSelectionState(state);
1503
1512
  this._columnWidthManager.handleRowNumberOffsetChange(state, widthsData);
1504
- updateColumnWidthsMetadata(state, widthsData);
1513
+ updateColumnWidthsMetadata(getColumns(state), widthsData);
1505
1514
  // set the celltofocus next to null if the column still exists after indexes calculation
1506
1515
  updateCellToFocusFromPrev(state);
1507
1516
 
@@ -233,9 +233,21 @@ function openInlineEdit(dt, target) {
233
233
 
234
234
  // eslint-disable-next-line @lwc/lwc/no-async-operation
235
235
  setTimeout(() => {
236
- template
237
- .querySelector('lightning-primitive-datatable-iedit-panel')
238
- .focus();
236
+ const panel = template.querySelector(
237
+ 'lightning-primitive-datatable-iedit-panel'
238
+ );
239
+ if (!panel.isEditableValid) {
240
+ // if panel can't be edited, cancel edit process
241
+ processInlineEditFinish(
242
+ dt,
243
+ 'edit-canceled',
244
+ inlineEdit.rowKeyValue,
245
+ inlineEdit.colKeyValue
246
+ );
247
+ } else {
248
+ // if panel can be edited, focus
249
+ panel.focus();
250
+ }
239
251
  }, 0);
240
252
  }
241
253