lightning-base-components 1.21.0-alpha → 1.21.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.21.0-alpha",
3
+ "version": "1.21.1-alpha",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "external",
@@ -454,6 +454,14 @@
454
454
  "name": "@salesforce/label/LightningDualListbox.movedOptionsPlural",
455
455
  "path": "scopedImports/@salesforce-label-LightningDualListbox.movedOptionsPlural.js"
456
456
  },
457
+ {
458
+ "name": "@salesforce/label/LightningDualListbox.verticallyMovedOptions",
459
+ "path": "scopedImports/@salesforce-label-LightningDualListbox.verticallyMovedOptions.js"
460
+ },
461
+ {
462
+ "name": "@salesforce/label/LightningDualListbox.moveToAssistiveText",
463
+ "path": "scopedImports/@salesforce-label-LightningDualListbox.moveToAssistiveText.js"
464
+ },
457
465
  {
458
466
  "name": "@salesforce/label/LightningProgressIndicator.stageComplete",
459
467
  "path": "scopedImports/@salesforce-label-LightningProgressIndicator.stageComplete.js"
@@ -1 +1 @@
1
- export default 'Current Selection:';
1
+ export default '{0} - Current selection: {1}';
@@ -0,0 +1 @@
1
+ export default 'Move to {0}';
@@ -0,0 +1 @@
1
+ export default '{0} moved to position {1}';
@@ -3,10 +3,11 @@ import labelDeselectOptionKeyboard from '@salesforce/label/LightningCombobox.des
3
3
  import labelLoadingText from '@salesforce/label/LightningCombobox.loadingText';
4
4
  import labelPillCloseButtonAlternativeText from '@salesforce/label/LightningCombobox.pillCloseButtonAlternativeText';
5
5
  import labelPlaceholder from '@salesforce/label/LightningCombobox.placeholder';
6
+ import labelCurrentSelection from '@salesforce/label/LightningCombobox.currentSelection';
6
7
  import { api, track, LightningElement } from 'lwc';
7
8
  import { handleKeyDownOnInput } from './keyboard';
8
9
  import { BaseComboboxEvents } from './baseComboboxEvents';
9
- import { classSet } from 'lightning/utils';
10
+ import { classSet, formatLabel } from 'lightning/utils';
10
11
  import {
11
12
  assert,
12
13
  computeAriaInvalid,
@@ -580,7 +581,7 @@ export default class LightningBaseCombobox extends LightningElement {
580
581
  return value;
581
582
  }
582
583
 
583
- return `${label} - Current selection: ${value}`;
584
+ return formatLabel(labelCurrentSelection, label, value);
584
585
  }
585
586
 
586
587
  handleListboxScroll(event) {
@@ -34,10 +34,10 @@
34
34
  </div>
35
35
  <div class="slds-dueling-list__column">
36
36
  <lightning-button-icon icon-name="utility:right" variant="container" onclick={handleRightButtonClick} disabled={moveButtonsDisabled}
37
- title={addButtonLabel} alternative-text={addButtonLabel}>
37
+ title={addButtonLabel} alternative-text={addButtonLabel} tooltip={addButtonDescription}>
38
38
  </lightning-button-icon>
39
39
  <lightning-button-icon icon-name="utility:left" variant="container" onclick={handleLeftButtonClick} disabled={moveButtonsDisabled}
40
- title={removeButtonLabel} alternative-text={removeButtonLabel}>
40
+ title={removeButtonLabel} alternative-text={removeButtonLabel} tooltip={removeButtonDescription}>
41
41
  </lightning-button-icon>
42
42
  </div>
43
43
  <div class="slds-dueling-list__column slds-dueling-list__column_responsive">
@@ -13,9 +13,11 @@ import labelRequiredError from '@salesforce/label/LightningDualListbox.requiredE
13
13
  import labelRequiredOptionError from '@salesforce/label/LightningDualListbox.requiredOptionError';
14
14
  import labelUpButtonAssistiveText from '@salesforce/label/LightningDualListbox.upButtonAssistiveText';
15
15
  import labelMoveSelectionToAssistiveText from '@salesforce/label/LightningDualListbox.moveSelectionToAssistiveText';
16
+ import labelMoveToAssistiveText from '@salesforce/label/LightningDualListbox.moveToAssistiveText';
16
17
  import labelLoadingText from '@salesforce/label/LightningCombobox.loadingText';
17
18
  import labelMovedOptionsSingular from '@salesforce/label/LightningDualListbox.movedOptionsSingular';
18
19
  import labelMovedOptionsPlural from '@salesforce/label/LightningDualListbox.movedOptionsPlural';
20
+ import labelVerticallyMovedOptionsText from '@salesforce/label/LightningDualListbox.verticallyMovedOptions';
19
21
  import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helptextAlternativeText';
20
22
  import { LightningElement, api, track } from 'lwc';
21
23
  import { handleKeyDownOnOption } from './keyboard';
@@ -50,10 +52,12 @@ const i18n = {
50
52
  requiredOptionError: labelRequiredOptionError,
51
53
  upButtonAssistiveText: labelUpButtonAssistiveText,
52
54
  moveSelectionToAssistiveText: labelMoveSelectionToAssistiveText,
55
+ moveToAssistiveText: labelMoveToAssistiveText,
53
56
  loadingText: labelLoadingText,
54
57
  movedOptionsSingular: labelMovedOptionsSingular,
55
58
  movedOptionsPlural: labelMovedOptionsPlural,
56
59
  helpTextAlternativeText: labelHelpTextAlternativeText,
60
+ verticallyMovedOptionsText: labelVerticallyMovedOptionsText,
57
61
  };
58
62
 
59
63
  /**
@@ -584,12 +588,25 @@ export default class LightningDualListbox extends LightningElement {
584
588
  * @type {string}
585
589
  * @default Move selection to {selectedLabel}
586
590
  */
591
+ get addButtonDescription() {
592
+ return this.getRightButtonAssistiveText();
593
+ }
594
+
595
+ getRightButtonAssistiveLabel() {
596
+ return formatLabel(i18n.moveToAssistiveText, this.selectedLabel);
597
+ }
598
+
599
+ /**
600
+ * Label for add button.
601
+ * @type {string}
602
+ * @default Move to {selectedLabel}
603
+ */
587
604
  @api
588
605
  get addButtonLabel() {
589
606
  if (this._addButtonLabel) {
590
607
  return this._addButtonLabel;
591
608
  }
592
- return this.getRightButtonAssistiveText();
609
+ return this.getRightButtonAssistiveLabel();
593
610
  }
594
611
 
595
612
  set addButtonLabel(value) {
@@ -600,6 +617,19 @@ export default class LightningDualListbox extends LightningElement {
600
617
  return formatLabel(i18n.moveSelectionToAssistiveText, this.sourceLabel);
601
618
  }
602
619
 
620
+ /**
621
+ * Label for remove button.
622
+ * @type {string}
623
+ * @default "Move Selection to {sourceLabel}"
624
+ */
625
+ get removeButtonDescription() {
626
+ return this.getLeftButtonAssistiveText();
627
+ }
628
+
629
+ getLeftButtonAssistiveLabel() {
630
+ return formatLabel(i18n.moveToAssistiveText, this.sourceLabel);
631
+ }
632
+
603
633
  /**
604
634
  * Label for remove button.
605
635
  * @type {string}
@@ -610,7 +640,7 @@ export default class LightningDualListbox extends LightningElement {
610
640
  if (this._removeButtonLabel) {
611
641
  return this._removeButtonLabel;
612
642
  }
613
- return this.getLeftButtonAssistiveText();
643
+ return this.getLeftButtonAssistiveLabel();
614
644
  }
615
645
 
616
646
  set removeButtonLabel(value) {
@@ -817,6 +847,7 @@ export default class LightningDualListbox extends LightningElement {
817
847
  this.updateFocusableOption(this.selectedList, toMove[0]);
818
848
  this.optionToFocus = null;
819
849
  this.dispatchChangeEvent(values);
850
+ this.selectedUpDownMovedOptions();
820
851
  }
821
852
 
822
853
  selectAllFromLastSelectedToOption(option, all) {
@@ -1098,4 +1129,27 @@ export default class LightningDualListbox extends LightningElement {
1098
1129
  get helptextAlternativeText() {
1099
1130
  return formatLabel(i18n.helpTextAlternativeText, this.label);
1100
1131
  }
1132
+
1133
+ selectedUpDownMovedOptions() {
1134
+ let strMessage = [];
1135
+ for (let i = 0; i < this.computedSelectedList.length; i++) {
1136
+ const highlightedOption = this.highlightedOptions.indexOf(
1137
+ this.computedSelectedList[i].value
1138
+ );
1139
+ if (highlightedOption !== -1) {
1140
+ strMessage.push(
1141
+ formatLabel(
1142
+ i18n.verticallyMovedOptionsText,
1143
+ this.computedSelectedList[i].label,
1144
+ i + 1
1145
+ )
1146
+ );
1147
+ }
1148
+ }
1149
+ if (strMessage.length === 0) {
1150
+ this._messageToDisplay = '';
1151
+ } else {
1152
+ this._messageToDisplay = strMessage.join(', ');
1153
+ }
1154
+ }
1101
1155
  }
@@ -10,6 +10,7 @@ export default class LightningMenuDivider extends LightningElement {
10
10
 
11
11
  connectedCallback() {
12
12
  this.setAttribute('role', 'separator');
13
+ this.setAttribute('aria-hidden', 'true');
13
14
  }
14
15
 
15
16
  /**