lightning-base-components 1.17.7-alpha → 1.18.2-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 (214) hide show
  1. package/metadata/raptor.json +5 -0
  2. package/package.json +43 -1
  3. package/src/lightning/accordion/accordion.css +12 -0
  4. package/src/lightning/accordion/accordion.html +3 -1
  5. package/src/lightning/accordion/accordion.js +4 -2
  6. package/src/lightning/accordion/accordion.slds.css +671 -0
  7. package/src/lightning/accordionSection/accordion-section.slds.css +647 -0
  8. package/src/lightning/accordionSection/accordionSection.css +14 -0
  9. package/src/lightning/accordionSection/accordionSection.html +23 -19
  10. package/src/lightning/accordionSection/accordionSection.js +29 -2
  11. package/src/lightning/ariaObserver/__docs__/ariaObserver.md +21 -9
  12. package/src/lightning/ariaObserver/ariaObserver.js +185 -154
  13. package/src/lightning/ariaObserver/polyfill.js +639 -0
  14. package/src/lightning/avatar/avatar.css +2 -0
  15. package/src/lightning/avatar/avatar.html +2 -0
  16. package/src/lightning/avatar/avatar.js +18 -15
  17. package/src/lightning/avatar/avatar.slds.css +272 -0
  18. package/src/lightning/baseCombobox/base-combobox.slds.css +1585 -0
  19. package/src/lightning/baseCombobox/baseCombobox.css +11 -1
  20. package/src/lightning/baseCombobox/baseCombobox.html +154 -146
  21. package/src/lightning/baseCombobox/baseCombobox.js +82 -46
  22. package/src/lightning/baseCombobox/spinner.slds.css +438 -0
  23. package/src/lightning/baseComboboxItem/baseComboboxItem.js +4 -2
  24. package/src/lightning/baseComboboxItem/inline.css +2 -0
  25. package/src/lightning/breadcrumb/breadcrumb.css +2 -2
  26. package/src/lightning/breadcrumb/breadcrumb.js +4 -2
  27. package/src/lightning/breadcrumb/breadcrumb.slds.css +2 -7
  28. package/src/lightning/breadcrumbs/breadcrumbs.css +2 -2
  29. package/src/lightning/breadcrumbs/breadcrumbs.js +3 -2
  30. package/src/lightning/breadcrumbs/breadcrumbs.slds.css +7 -1
  31. package/src/lightning/button/__examples__/inverse/inverse.css +8 -0
  32. package/src/lightning/button/__examples__/inverse/inverse.html +3 -2
  33. package/src/lightning/button/button.css +2 -0
  34. package/src/lightning/button/button.html +4 -2
  35. package/src/lightning/button/button.js +21 -0
  36. package/src/lightning/button/button.slds.css +527 -0
  37. package/src/lightning/buttonGroup/buttonGroup.css +2 -2
  38. package/src/lightning/buttonGroup/buttonGroup.js +3 -2
  39. package/src/lightning/buttonIcon/button-icon.slds.css +215 -453
  40. package/src/lightning/buttonIcon/buttonIcon.css +2 -2
  41. package/src/lightning/buttonIcon/buttonIcon.js +4 -0
  42. package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +215 -453
  43. package/src/lightning/buttonIconStateful/buttonIconStateful.css +2 -2
  44. package/src/lightning/buttonMenu/{dropdown.slds.css → button-menu.slds.css} +853 -217
  45. package/src/lightning/buttonMenu/buttonMenu.css +2 -2
  46. package/src/lightning/buttonMenu/buttonMenu.html +2 -2
  47. package/src/lightning/buttonMenu/buttonMenu.js +10 -14
  48. package/src/lightning/buttonStateful/button-stateful.slds.css +225 -457
  49. package/src/lightning/buttonStateful/buttonStateful.css +2 -2
  50. package/src/lightning/buttonStateful/buttonStateful.js +3 -2
  51. package/src/lightning/calendar/__examples__/basic/basic.html +7 -0
  52. package/src/lightning/calendar/__examples__/basic/basic.js +3 -0
  53. package/src/lightning/calendar/calendar.css +3 -0
  54. package/src/lightning/calendar/calendar.html +12 -9
  55. package/src/lightning/calendar/calendar.js +15 -1
  56. package/src/lightning/calendar/calendar.slds.css +2048 -0
  57. package/src/lightning/card/card.css +2 -2
  58. package/src/lightning/card/card.js +3 -2
  59. package/src/lightning/card/card.slds.css +141 -88
  60. package/src/lightning/colorPickerCustom/colorPickerCustom.css +2 -2
  61. package/src/lightning/colorPickerCustom/colorPickerCustom.js +3 -2
  62. package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +11 -38
  63. package/src/lightning/colorPickerPanel/colorPickerPanel.css +3 -2
  64. package/src/lightning/colorPickerPanel/colorPickerPanel.js +4 -2
  65. package/src/lightning/colorPickerPanel/popover.slds.css +121 -0
  66. package/src/lightning/combobox/combobox.css +4 -0
  67. package/src/lightning/combobox/combobox.html +31 -29
  68. package/src/lightning/combobox/combobox.js +21 -4
  69. package/src/lightning/combobox/combobox.slds.css +13 -0
  70. package/src/lightning/combobox/form-element.slds.css +281 -0
  71. package/src/lightning/configProvider/defaultConfig.js +2 -1
  72. package/src/lightning/datepicker/datepicker.css +3 -0
  73. package/src/lightning/datepicker/datepicker.html +7 -4
  74. package/src/lightning/datepicker/datepicker.js +73 -19
  75. package/src/lightning/datepicker/form-element.slds.css +281 -0
  76. package/src/lightning/datepicker/input-text.slds.css +398 -0
  77. package/src/lightning/datetimepicker/datetimepicker.css +3 -0
  78. package/src/lightning/datetimepicker/datetimepicker.html +9 -3
  79. package/src/lightning/datetimepicker/datetimepicker.js +39 -35
  80. package/src/lightning/datetimepicker/form-element.slds.css +281 -0
  81. package/src/lightning/datetimepicker/input-text.slds.css +398 -0
  82. package/src/lightning/dualListbox/dualListbox.css +2 -2
  83. package/src/lightning/dualListbox/dualListbox.html +3 -3
  84. package/src/lightning/dualListbox/dualListbox.js +31 -6
  85. package/src/lightning/dualListbox/form-element.slds.css +83 -34
  86. package/src/lightning/dualListbox/keyboard.js +20 -1
  87. package/src/lightning/dynamicIcon/dynamicIcon.js +3 -2
  88. package/src/lightning/dynamicIcon/ellie.css +1 -1
  89. package/src/lightning/dynamicIcon/eq.css +1 -1
  90. package/src/lightning/dynamicIcon/score.css +1 -1
  91. package/src/lightning/dynamicIcon/strength.css +1 -1
  92. package/src/lightning/dynamicIcon/trend.css +1 -1
  93. package/src/lightning/dynamicIcon/waffle.css +1 -1
  94. package/src/lightning/formattedRichText/linkify.js +2 -2
  95. package/src/lightning/helptext/form-element.slds.css +83 -34
  96. package/src/lightning/helptext/help-text.slds.css +215 -453
  97. package/src/lightning/helptext/helptext.css +2 -2
  98. package/src/lightning/helptext/helptext.js +3 -2
  99. package/src/lightning/i18nCldrOptions/README.md +5 -0
  100. package/src/lightning/i18nService/README.md +5 -0
  101. package/src/lightning/icon/icon.css +2 -2
  102. package/src/lightning/icon/icon.js +16 -2
  103. package/src/lightning/icon/icon.slds.css +29 -17
  104. package/src/lightning/icon/iconColors.js +1 -0
  105. package/src/lightning/input/__examples__/text/text.html +0 -1
  106. package/src/lightning/input/form-element.slds.css +281 -0
  107. package/src/lightning/input/input-checkbox.slds.css +3 -12
  108. package/src/lightning/input/input-text.slds.css +239 -128
  109. package/src/lightning/input/input.css +2 -1
  110. package/src/lightning/input/input.html +8 -8
  111. package/src/lightning/input/input.js +107 -73
  112. package/src/lightning/internationalizationLibrary/README.md +24 -0
  113. package/src/lightning/internationalizationLibrary/utils.js +4 -1
  114. package/src/lightning/layout/__docs__/layout.md +1 -1
  115. package/src/lightning/layout/__examples__/simple/simple.css +1 -1
  116. package/src/lightning/layout/layout.css +5 -1
  117. package/src/lightning/layout/layout.js +4 -2
  118. package/src/lightning/layoutItem/__examples__/alignmentBump/alignmentBump.css +1 -1
  119. package/src/lightning/layoutItem/__examples__/sizePerDevice/sizePerDevice.css +0 -1
  120. package/src/lightning/layoutItem/layoutItem.css +5 -0
  121. package/src/lightning/layoutItem/layoutItem.js +4 -2
  122. package/src/lightning/menuDivider/menu-divider.slds.css +15 -0
  123. package/src/lightning/menuDivider/menuDivider.css +3 -0
  124. package/src/lightning/menuDivider/menuDivider.html +1 -1
  125. package/src/lightning/menuDivider/menuDivider.js +4 -2
  126. package/src/lightning/menuItem/menu-item.slds.css +140 -0
  127. package/src/lightning/menuItem/menuItem.css +3 -0
  128. package/src/lightning/menuItem/menuItem.html +43 -41
  129. package/src/lightning/menuItem/menuItem.js +4 -4
  130. package/src/lightning/menuSubheader/menu-subheader.slds.css +22 -0
  131. package/src/lightning/menuSubheader/menuSubheader.css +3 -0
  132. package/src/lightning/menuSubheader/menuSubheader.html +3 -1
  133. package/src/lightning/menuSubheader/menuSubheader.js +4 -6
  134. package/src/lightning/modal/__docs__/modal.md +3 -1
  135. package/src/lightning/modal/__modalUtils__/modalContainerTestConstants.js +267 -0
  136. package/src/lightning/modal/__modalUtils__/modalContainerTestMethods.js +1165 -0
  137. package/src/lightning/modal/__modalUtils__/modalContainerTestMockData.js +131 -0
  138. package/src/lightning/modal/modal.js +1 -1
  139. package/src/lightning/pill/avatar.slds.css +272 -0
  140. package/src/lightning/pill/link.css +3 -0
  141. package/src/lightning/pill/link.html +1 -1
  142. package/src/lightning/pill/pill.js +29 -9
  143. package/src/lightning/pill/pill.slds.css +168 -0
  144. package/src/lightning/pill/plain.css +3 -0
  145. package/src/lightning/pill/plain.html +1 -1
  146. package/src/lightning/pill/plainLink.css +3 -0
  147. package/src/lightning/pill/plainLink.html +1 -1
  148. package/src/lightning/pillContainer/barePillContainer.css +3 -0
  149. package/src/lightning/pillContainer/barePillContainer.html +1 -2
  150. package/src/lightning/pillContainer/listbox.slds.css +267 -0
  151. package/src/lightning/pillContainer/pill-container.slds.css +22 -0
  152. package/src/lightning/pillContainer/pill.slds.css +168 -0
  153. package/src/lightning/pillContainer/pillContainer.js +7 -3
  154. package/src/lightning/pillContainer/standardPillContainer.css +4 -0
  155. package/src/lightning/pillContainer/standardPillContainer.html +2 -2
  156. package/src/lightning/popup/popover.slds.css +119 -119
  157. package/src/lightning/popup/popup.css +1 -2
  158. package/src/lightning/popup/popup.js +3 -2
  159. package/src/lightning/positionLibrary/elementProxy.js +7 -2
  160. package/src/lightning/positionLibrary/util.js +8 -0
  161. package/src/lightning/primitiveBubble/primitiveBubble.css +2 -2
  162. package/src/lightning/primitiveBubble/primitiveBubble.js +4 -2
  163. package/src/lightning/primitiveButton/primitiveButton.js +5 -4
  164. package/src/lightning/primitiveCellFactory/cellWithStandardLayout.html +29 -21
  165. package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -0
  166. package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +31 -19
  167. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.css +2 -2
  168. package/src/lightning/primitiveColorpickerButton/primitiveColorpickerButton.js +5 -3
  169. package/src/lightning/primitiveIcon/icon.slds.css +209 -0
  170. package/src/lightning/primitiveIcon/primitiveIcon.css +2 -1
  171. package/src/lightning/primitiveIcon/primitiveIcon.html +1 -1
  172. package/src/lightning/primitiveIcon/primitiveIcon.js +18 -11
  173. package/src/lightning/progressStep/progressStep.js +10 -13
  174. package/src/lightning/radioGroup/radioGroup.css +2 -1
  175. package/src/lightning/radioGroup/radioGroup.js +4 -2
  176. package/src/lightning/select/form-element.slds.css +83 -34
  177. package/src/lightning/select/select.css +2 -2
  178. package/src/lightning/select/select.js +4 -2
  179. package/src/lightning/select/select.slds.css +86 -34
  180. package/src/lightning/sldsCommon/sldsCommon.css +135 -75
  181. package/src/lightning/spinner/spinner.css +2 -2
  182. package/src/lightning/spinner/spinner.js +4 -2
  183. package/src/lightning/tabBar/tab-bar.slds.css +334 -0
  184. package/src/lightning/tabBar/tabBar.css +2 -0
  185. package/src/lightning/tabBar/tabBar.html +4 -3
  186. package/src/lightning/tabBar/tabBar.js +30 -3
  187. package/src/lightning/tabset/tabset.html +5 -4
  188. package/src/lightning/tabset/tabset.js +29 -11
  189. package/src/lightning/timepicker/form-element.slds.css +281 -0
  190. package/src/lightning/timepicker/timepicker.css +3 -0
  191. package/src/lightning/timepicker/timepicker.html +5 -1
  192. package/src/lightning/timepicker/timepicker.js +18 -15
  193. package/src/lightning/timepicker/timepicker.slds.css +18 -0
  194. package/src/lightning/tooltipLibrary/tooltipLibrary.js +21 -19
  195. package/src/lightning/utilsPrivate/browser.js +5 -3
  196. package/src/lightning/utilsPrivate/os.js +6 -4
  197. package/src/lightning/utilsPrivate/ssr.js +4 -0
  198. package/src/lightning/utilsPrivate/utilsPrivate.js +2 -0
  199. package/src/lightning/verticalNavigation/verticalNavigation.css +2 -1
  200. package/src/lightning/verticalNavigation/verticalNavigation.js +3 -2
  201. package/src/lightning/verticalNavigationSection/verticalNavigationSection.css +2 -1
  202. package/src/lightning/verticalNavigationSection/verticalNavigationSection.js +3 -2
  203. package/src/lightning/accordion/__perf__DISABLED/accordion-perf-utils.js +0 -76
  204. package/src/lightning/accordion/__perf__DISABLED/accordion10Multiple25SectionEach.perf.js +0 -57
  205. package/src/lightning/accordion/__perf__DISABLED/accordion10Simple25SectionEach.perf.js +0 -37
  206. package/src/lightning/accordion/__perf__DISABLED/accordionMultiple50Section.perf.js +0 -45
  207. package/src/lightning/accordion/__perf__DISABLED/accordionSimple50Section.perf.js +0 -35
  208. package/src/lightning/accordion/__perf__DISABLED/container/container.html +0 -15
  209. package/src/lightning/accordion/__perf__DISABLED/container/container.js +0 -7
  210. package/src/lightning/positionLibrary/__component__/positionLibraryBounding.spec.js +0 -319
  211. package/src/lightning/positionLibrary/__component__/x/bounding/bounding.css +0 -16
  212. package/src/lightning/positionLibrary/__component__/x/bounding/bounding.html +0 -36
  213. package/src/lightning/positionLibrary/__component__/x/bounding/bounding.js +0 -122
  214. /package/src/lightning/{baseCombobox → baseComboboxItem}/listbox.slds.css +0 -0
@@ -13,7 +13,7 @@ import labelHelpTextAlternativeText from '@salesforce/label/LightningInput.helpt
13
13
  import userTimeZone from '@salesforce/i18n/timeZone';
14
14
  import formFactor from '@salesforce/client/formFactor';
15
15
 
16
- import { api, LightningElement, track } from 'lwc';
16
+ import { LightningElement, api, track } from 'lwc';
17
17
  import { classSet, formatLabel } from 'lightning/utils';
18
18
  import {
19
19
  assert,
@@ -109,23 +109,6 @@ const VALID_NUMBER_FORMATTERS = [
109
109
  const DEFAULT_COLOR = '#000000';
110
110
  const DEFAULT_FORMATTER = VALID_NUMBER_FORMATTERS[0];
111
111
 
112
- /**
113
- * Returns an aria string with all the non-autolinked values removed
114
- * @param {String} values space sperated list of ids
115
- * @returns {String} The aria values with the non-auto linked ones removed
116
- */
117
- function filterNonAutoLink(values) {
118
- const ariaValues = values && values.split(/\s+/);
119
- return (
120
- ariaValues &&
121
- ariaValues
122
- .filter((value) => {
123
- return !!value.match(/^auto-link/);
124
- })
125
- .join(' ')
126
- );
127
- }
128
-
129
112
  /**
130
113
  * Represents interactive controls that accept user input depending on the type attribute.
131
114
  */
@@ -382,6 +365,16 @@ export default class LightningInput extends LightningElement {
382
365
  );
383
366
  }
384
367
 
368
+ if (this.isConnected) {
369
+ this.ariaObserver.sync(this.isNativeShadow);
370
+
371
+ if (!this._rendered) {
372
+ this.connectAriaDescribedBy();
373
+ this.connectAriaLabelledBy();
374
+ this.connectAriaControls();
375
+ }
376
+ }
377
+
385
378
  if (!this._initialValueSet && this._inputElement) {
386
379
  this._rendered = true;
387
380
 
@@ -396,9 +389,6 @@ export default class LightningInput extends LightningElement {
396
389
  this._initialValueSet = true;
397
390
  }
398
391
 
399
- if (this.isConnected) {
400
- this.ariaObserver.sync();
401
- }
402
392
  this._synchronizeA11y();
403
393
  }
404
394
 
@@ -541,6 +531,9 @@ export default class LightningInput extends LightningElement {
541
531
 
542
532
  set ariaControls(references) {
543
533
  this._ariaControls = references;
534
+ if (this._rendered) {
535
+ this.connectAriaControls();
536
+ }
544
537
  reflectAttribute(this, ARIA_CONTROLS, references);
545
538
  }
546
539
 
@@ -550,21 +543,17 @@ export default class LightningInput extends LightningElement {
550
543
  */
551
544
  @api
552
545
  get ariaLabelledBy() {
553
- // native version returns the auto linked value
554
- if (this.isNative && this._rendered) {
555
- const ariaValues = this._inputElement.getAttribute(ARIA_LABELLEDBY);
556
- return filterNonAutoLink(ariaValues);
557
- }
558
- return this._ariaLabelledBy;
546
+ // native shadow version returns the mirrored values
547
+ return this._rendered && this.isNativeShadow
548
+ ? this._inputElement.getAttribute(ARIA_LABELLEDBY)
549
+ : this._ariaLabelledBy;
559
550
  }
560
551
 
561
552
  set ariaLabelledBy(references) {
562
553
  this._ariaLabelledBy = references;
563
- this.ariaObserver.connect({
564
- targetSelector: 'input',
565
- attribute: ARIA_LABELLEDBY,
566
- ids: references,
567
- });
554
+ if (this._rendered) {
555
+ this.connectAriaLabelledBy();
556
+ }
568
557
  }
569
558
 
570
559
  /**
@@ -573,26 +562,66 @@ export default class LightningInput extends LightningElement {
573
562
  */
574
563
  @api
575
564
  get ariaDescribedBy() {
576
- if (this.isNative) {
577
- // in native case return the linked value
578
- const ariaValues =
579
- this._inputElement.getAttribute(ARIA_DESCRIBEDBY);
580
- return filterNonAutoLink(ariaValues);
581
- }
582
- return this._ariaDescribedBy;
565
+ // native shadow version returns the mirrored values
566
+ return this._rendered && this.isNativeShadow
567
+ ? this._inputElement.getAttribute(ARIA_DESCRIBEDBY)
568
+ : this._ariaDescribedBy;
583
569
  }
584
570
 
585
571
  set ariaDescribedBy(references) {
586
572
  this._ariaDescribedBy = references;
587
- this.ariaObserver.connect({
588
- targetSelector: 'input',
589
- attribute: ARIA_DESCRIBEDBY,
590
- ids: references,
591
- });
573
+ if (this._rendered) {
574
+ this.connectAriaDescribedBy();
575
+ }
576
+ }
577
+
578
+ get isNativeShadow() {
579
+ return this._primitiveComponent?.isNativeShadow || this._isNativeShadow;
580
+ }
581
+
582
+ /**
583
+ * Connect aria-labelledby to the ariaObserver.
584
+ */
585
+ connectAriaLabelledBy() {
586
+ if (this._primitiveComponent) {
587
+ this.ariaObserver.connect({
588
+ attribute: ARIA_LABELLEDBY,
589
+ targetNode: this._inputElement,
590
+ relatedNodes: this._primitiveComponent.ariaLabelledByElements,
591
+ relatedNodeIds: this._ariaLabelledBy,
592
+ });
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Connect aria-describedby to the ariaObserver.
598
+ */
599
+ connectAriaDescribedBy() {
600
+ if (this._primitiveComponent) {
601
+ this.ariaObserver.connect({
602
+ attribute: ARIA_DESCRIBEDBY,
603
+ targetNode: this._inputElement,
604
+ relatedNodes: this._primitiveComponent.ariaDescribedByElements,
605
+ relatedNodeIds: this._ariaDescribedBy,
606
+ });
607
+ }
608
+ }
609
+
610
+ /**
611
+ * Connect aria-controls to the ariaObserver.
612
+ */
613
+ connectAriaControls() {
614
+ if (this._primitiveComponent) {
615
+ this.ariaObserver.connect({
616
+ attribute: ARIA_CONTROLS,
617
+ targetNode: this._inputElement,
618
+ relatedNodeIds: this._ariaControls,
619
+ });
620
+ }
592
621
  }
593
622
 
594
623
  /**
595
- * A boolean value that controls whether accessibility tools read empty required textboxes as invalid. Default value is false.
624
+ * A Boolean value for aria-invalid.
596
625
  * @type {boolean}
597
626
  */
598
627
  @api
@@ -659,10 +688,10 @@ export default class LightningInput extends LightningElement {
659
688
  // from text to 'checkbox', so we need to set the initial value again
660
689
  this._initialValueSet = false;
661
690
 
662
- if (this.isTypeNumber) {
663
- // If the type has changed, we need to re-parse the value as a number
664
- this._updateNumberValue(this._value);
665
- }
691
+ // Reconnect aria attributes as the parentSelector is based on the input type
692
+ this.connectAriaLabelledBy();
693
+ this.connectAriaDescribedBy();
694
+ this.connectAriaControls();
666
695
  }
667
696
 
668
697
  this._updateProxyInputAttributes([
@@ -1104,6 +1133,13 @@ export default class LightningInput extends LightningElement {
1104
1133
  @api
1105
1134
  reportValidity() {
1106
1135
  return this._constraint.reportValidity((message) => {
1136
+ if (this.isTypeDesktopTime) {
1137
+ reflectAttribute(
1138
+ this._inputElement.comboboxComponent,
1139
+ 'invalid',
1140
+ !this.checkValidity()
1141
+ );
1142
+ }
1107
1143
  if (this._rendered && !this.isNativeInput) {
1108
1144
  this._inputElement.showHelpMessage(message);
1109
1145
  } else {
@@ -1141,16 +1177,6 @@ export default class LightningInput extends LightningElement {
1141
1177
  }
1142
1178
  }
1143
1179
 
1144
- get isAutoCompleteSupported() {
1145
- return (
1146
- this.isTypeTelephone ||
1147
- this.isTypeUrl ||
1148
- this.isTypeSearch ||
1149
- this.isTypeEmail ||
1150
- this.isTypeText
1151
- );
1152
- }
1153
-
1154
1180
  get isNativeInput() {
1155
1181
  return !(
1156
1182
  this.isTypeDesktopDate ||
@@ -1334,12 +1360,6 @@ export default class LightningInput extends LightningElement {
1334
1360
  .toString();
1335
1361
  }
1336
1362
 
1337
- get computedHelpMessageClass() {
1338
- return classSet('slds-form-element__help')
1339
- .add({ 'slds-m-left_none': this.variant !== VARIANT.LABEL_INLINE })
1340
- .toString();
1341
- }
1342
-
1343
1363
  get normalizedMax() {
1344
1364
  return this._normalizeDateTimeString(this.max);
1345
1365
  }
@@ -1348,6 +1368,10 @@ export default class LightningInput extends LightningElement {
1348
1368
  return this._normalizeDateTimeString(this.min);
1349
1369
  }
1350
1370
 
1371
+ get isTypeNumber() {
1372
+ return this.type === 'number';
1373
+ }
1374
+
1351
1375
  get isTypeTelephone() {
1352
1376
  return this.type === 'tel';
1353
1377
  }
@@ -1356,10 +1380,6 @@ export default class LightningInput extends LightningElement {
1356
1380
  return this.type === 'url';
1357
1381
  }
1358
1382
 
1359
- get isTypeNumber() {
1360
- return this.type === 'number';
1361
- }
1362
-
1363
1383
  get isTypeEmail() {
1364
1384
  // To test against native change this to type="emails"
1365
1385
  return this.type === 'email';
@@ -1514,7 +1534,7 @@ export default class LightningInput extends LightningElement {
1514
1534
  // This will not affect the value dispatched by input via the change event, as it only dispatches a valid decimal number.
1515
1535
  // Due to the above, in integrations like input-field, the user's initial input of a symbol
1516
1536
  // like a minus sign will not be overwritten by an empty string value.
1517
- // See description in PR for more details: https://github.com/salesforce-experience-platform-emu/lightning-components/pull/3843
1537
+ // See description in PR for more details: https://github.com/salesforce-experience-platform/lightning-components/pull/3843
1518
1538
  if (
1519
1539
  this._inputElement.value.length === 1 &&
1520
1540
  hasValidNumberSymbol(this._inputElement.value)
@@ -1727,6 +1747,20 @@ export default class LightningInput extends LightningElement {
1727
1747
  return formatLabel(i18n.helpTextAlternativeText, this.label);
1728
1748
  }
1729
1749
 
1750
+ get isAutoCompleteSupported() {
1751
+ return (
1752
+ this.isTypeTelephone ||
1753
+ this.isTypeUrl ||
1754
+ this.isTypeSearch ||
1755
+ this.isTypeEmail ||
1756
+ this.isTypeText
1757
+ );
1758
+ }
1759
+
1760
+ get templateRootNode() {
1761
+ return this.template.host.getRootNode();
1762
+ }
1763
+
1730
1764
  handleFileClick() {
1731
1765
  this._setInputValue(null);
1732
1766
  this._updateValueAndValidityAttribute(null);
@@ -2105,9 +2139,9 @@ export default class LightningInput extends LightningElement {
2105
2139
 
2106
2140
  _updateDateOrTimePickerA11y(elem) {
2107
2141
  synchronizeAttrs(elem, {
2108
- ariaLabelledByElement: this.ariaLabelledBy,
2109
- ariaDescribedByElements: this.ariaDescribedBy,
2110
- ariaControlsElement: this.ariaControls,
2142
+ ariaLabelledByElement: this._ariaLabelledBy,
2143
+ ariaDescribedByElements: this._ariaDescribedBy,
2144
+ ariaControlsElement: this._ariaControls,
2111
2145
  [ARIA_LABEL]: this.computedAriaLabel,
2112
2146
  });
2113
2147
  }
@@ -0,0 +1,24 @@
1
+ # internationalizationLibrary
2
+
3
+ Currently, the code base contains logic that directs execution in two different paths, depending whether a component is being executed on the platform vs off. That logic, was intented to aid the migration off the current Aura's localization service, in favor of an unified and universal solution based on standards, that could be consumed on any enviroment.
4
+
5
+ Such logic can be detailed, on a high level as follows, at run time a path execution decides that:
6
+
7
+ if a component is run on the platform, it will make use of Aura's localization Service to format and parse dates/times.
8
+ if a component is run anywhere else, it will use the globalization i18n-service
9
+
10
+ ## When to use this utility
11
+
12
+ Because of our legacy support and backward compatiblity contracts, we use this utility as a facade, with the hope that once we are able to fully deprecate Aura's Localization service, this utility will help us to transition into [localizerjs](https://git.soma.salesforce.com/Globalization/localizerjs).
13
+
14
+ If you have an existing component that maps to any of the Aura's localization service methods, this module will aid with that.
15
+
16
+ ## Our recommmended approach
17
+
18
+ - For declarative usage, use our localization specific components, they will work both off/on platform.
19
+ - For low level, programatic usage, dealing with dates/times/numbers etc. use [localizerjs](https://git.soma.salesforce.com/Globalization/localizerjs). The next section covers more on usage and how these utiltiies are exposed.
20
+
21
+ ## Access/Exposure/Usage
22
+
23
+ 1. [internationalizationLibrary](https://github.com/salesforce-experience-platform-emu/lightning-components/tree/master/ui-lightning-components/src/main/modules/lightning/internationalizationLibrary) as a module is not exposed on the platform, but it's part of our NPM package.
24
+ 2. [localizerjs](https://git.soma.salesforce.com/Globalization/localizerjs) is maintained by the Globalization team, however, we expose it as part of Lightning. For example [i18nService](https://github.com/salesforce-experience-platform-emu/lightning-components/tree/master/ui-lightning-components/src/main/modules/lightning/i18nService). All usage of `localizerjs` should be consumed as `lightning/i18nService` and `lightning/i18nCldrOptions`. This is exposed on the platform internally and available as part of our NPM package.
@@ -1,9 +1,12 @@
1
+ import { isCSR } from 'lightning/utilsPrivate';
2
+
1
3
  /**
2
4
  * Used to determine if aura localization service is available
3
5
  * This should be true on-core and false off-core, and will
4
6
  * no longer be needed when we fully migrate off aura's service
5
7
  */
6
- export const isAuraL10NAvailable = window.$A && window.$A.localizationService;
8
+ export const isAuraL10NAvailable =
9
+ isCSR && window.$A && window.$A.localizationService;
7
10
 
8
11
  /**
9
12
  * Returns string to use when throwing an error message
@@ -121,7 +121,7 @@ To create columns with fixed widths, use the `size` attribute on `lightning-layo
121
121
  </lightning-layout>
122
122
  ```
123
123
 
124
- For more information, see the [SLDS grid utility classes](https://lightningdesignsystem.com/utilities/grid/).
124
+ For more information, see the [SLDS grid utility classes](https://lightningdesignsystem.com/utilities/grid/), and [SLDS sizing utility classes](https://www.lightningdesignsystem.com/utilities/sizing/).
125
125
 
126
126
  #### Usage Considerations
127
127
 
@@ -12,4 +12,4 @@
12
12
  line-height: 1.25;
13
13
  color: #54698d;
14
14
  margin-bottom: .25rem;
15
- }
15
+ }
@@ -1,4 +1,8 @@
1
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
1
+ @import 'lightning/sldsCommon';
2
+ @import 'lightning/sldsUtilsGrid';
3
+
4
+ @media all and (-ms-high-contrast: none),
5
+ (-ms-high-contrast: active) {
2
6
  .slds-slot {
3
7
  display: flex;
4
8
  }
@@ -1,4 +1,5 @@
1
- import { LightningElement, api, track } from 'lwc';
1
+ import { api, track } from 'lwc';
2
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
2
3
  import {
3
4
  normalizeParam,
4
5
  computeLayoutClass,
@@ -11,7 +12,7 @@ import { normalizeBoolean } from 'lightning/utilsPrivate';
11
12
  /**
12
13
  * Represents a responsive grid system for arranging containers on a page.
13
14
  */
14
- export default class LightningLayout extends LightningElement {
15
+ export default class LightningLayout extends LightningShadowBaseClass {
15
16
  /**
16
17
  * Determines how to spread the layout items horizontally.
17
18
  * The alignment options are center, space, spread, and end.
@@ -79,6 +80,7 @@ export default class LightningLayout extends LightningElement {
79
80
  _layoutClass = [];
80
81
 
81
82
  connectedCallback() {
83
+ super.connectedCallback();
82
84
  this.updateClassList();
83
85
  }
84
86
 
@@ -1,3 +1,3 @@
1
1
  .custom-box {
2
- background-color: #f4f6f9;
2
+ background-color: #f4f6f9;
3
3
  }
@@ -1,4 +1,3 @@
1
1
  .custom-box {
2
2
  background-color: #f4f6f9;
3
-
4
3
  }
@@ -0,0 +1,5 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import 'lightning/sldsUtilsBox';
3
+ @import 'lightning/sldsUtilsGrid';
4
+ @import 'lightning/sldsUtilsPadding';
5
+ @import 'lightning/sldsUtilsSizing';
@@ -1,4 +1,5 @@
1
- import { LightningElement, api, track } from 'lwc';
1
+ import { api, track } from 'lwc';
2
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
2
3
  import {
3
4
  normalizeFlexibility,
4
5
  normalizePadding,
@@ -13,7 +14,7 @@ import {
13
14
  * A layout item groups information together to define visual grids, spacing, and sections.
14
15
  * @slot default Placeholder for your content in lightning-layout-item.
15
16
  */
16
- export default class LightningLayoutItem extends LightningElement {
17
+ export default class LightningLayoutItem extends LightningShadowBaseClass {
17
18
  /**
18
19
  * Make the item fluid so that it absorbs any extra space in its
19
20
  * container or shrinks when there is less space. Allowed values are:
@@ -136,6 +137,7 @@ export default class LightningLayoutItem extends LightningElement {
136
137
  _layoutClass = [];
137
138
 
138
139
  connectedCallback() {
140
+ super.connectedCallback();
139
141
  this.updateClassList();
140
142
  }
141
143
 
@@ -0,0 +1,15 @@
1
+
2
+ /* Copyright (c) 2015-present, Salesforce, Inc. All rights reserved
3
+ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
4
+
5
+ @supports (--styling-hooks: '') {
6
+ :host([data-render-mode="shadow"]) .slds-has-divider_top {
7
+ border-top: var(--sds-g-sizing-border-1, 1px) solid var(--sds-g-color-neutral-base-90, #e5e5e5);
8
+ }
9
+
10
+ :host([data-render-mode="shadow"]) .slds-has-divider_top-space {
11
+ border-top: var(--sds-g-sizing-border-1, 1px) solid var(--sds-g-color-neutral-base-90, #e5e5e5);
12
+ margin-top: var(--sds-g-spacing-2, 0.5rem);
13
+ padding-top: var(--sds-g-spacing-2, 0.5rem);
14
+ }
15
+ }
@@ -1,3 +1,6 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import './menu-divider.slds.css';
3
+
1
4
  :host {
2
5
  display: block;
3
6
  }
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <div class={computedClass}></div>
2
+ <div class={computedClass} part="menu-divider"></div>
3
3
  </template>
@@ -1,14 +1,16 @@
1
- import { LightningElement, api, track } from 'lwc';
1
+ import { api, track } from 'lwc';
2
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
2
3
  import { classSet } from 'lightning/utils';
3
4
  import { normalizeString as normalize } from 'lightning/utilsPrivate';
4
5
 
5
6
  /**
6
7
  * Creates a divider in the list of items for lightning-button-menu.
7
8
  */
8
- export default class LightningMenuDivider extends LightningElement {
9
+ export default class LightningMenuDivider extends LightningShadowBaseClass {
9
10
  @track _variant = 'standard';
10
11
 
11
12
  connectedCallback() {
13
+ super.connectedCallback();
12
14
  this.setAttribute('role', 'separator');
13
15
  }
14
16
 
@@ -0,0 +1,140 @@
1
+
2
+ /* Copyright (c) 2015-present, Salesforce, Inc. All rights reserved
3
+ Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
4
+
5
+ @supports (--styling-hooks: '') {
6
+ /**
7
+ * Note: .slds-dropdown__item class used to be on the host element. Moved to
8
+ * new containing element to prevent duplicate styles in mixed-mode.
9
+ */
10
+
11
+ /**
12
+ * Menu Item
13
+ */
14
+ :host([data-render-mode="shadow"]) a {
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ gap: var(--sds-g-spacing-2, 0.5rem);
19
+ position: relative;
20
+ padding: var(--sds-g-spacing-2, 0.5rem) var(--sds-g-spacing-3, 0.75rem);
21
+ color: var(--sds-g-color-neutral-base-10, #181818);
22
+ line-height: var(--sds-g-font-lineheight-4, 1.5);
23
+ font-weight: var(--sds-g-font-weight-4, 400);
24
+ white-space: nowrap;
25
+ cursor: pointer;
26
+ }
27
+
28
+ :host([data-render-mode="shadow"]) a:hover,:host([data-render-mode="shadow"])
29
+ a:focus {
30
+ outline: 0;
31
+ text-decoration: none;
32
+ background-color: var(--sds-g-color-neutral-base-95, #f3f3f3);
33
+ }
34
+
35
+ :host([data-render-mode="shadow"]) a:active {
36
+ text-decoration: none;
37
+ background-color: var(--sds-g-color-neutral-base-95, #f3f3f3);
38
+ }
39
+
40
+ :host([data-render-mode="shadow"]) a[aria-disabled='true'] {
41
+ color: var(--sds-g-color-neutral-base-80, #c9c9c9);
42
+ cursor: default;
43
+
44
+ /* Reassignment - lightning-icon */
45
+ --slds-c-icon-color-foreground-default: var(--sds-g-color-neutral-base-80, #c9c9c9);
46
+ --slds-c-icon-boundary-spacing-inline-end: 25px;
47
+ }
48
+
49
+ /* TODO: bring in PostCSS fix and see if it fixes output CSS */
50
+ :host([data-render-mode="shadow"]) a[aria-disabled='true']:hover,:host([data-render-mode="shadow"])
51
+ a:host([data-render-mode="shadow"]) [aria-disabled='true']:focus {
52
+ background-color: transparent;
53
+ }
54
+
55
+ /**
56
+ * Note: these styles were originally on the "a" element above, but flex
57
+ * context was lost because the truncate span was added, so we hijack the
58
+ * span to get the layout control that we want. Display: flex on both the
59
+ * "a" and "span" is intended, add prefix and suffix icons to see the
60
+ * generated markup and it'll make sense.
61
+ */
62
+ :host([data-render-mode="shadow"]) .slds-truncate {
63
+ display: flex;
64
+ justify-content: space-between;
65
+ align-items: center;
66
+ gap: var(--sds-g-spacing-2, 0.5rem);
67
+ }
68
+
69
+ /**
70
+ * State - Error
71
+ *
72
+ * @TODO: currently not supported by LBC
73
+ */
74
+ :host([data-render-mode="shadow"].slds-has-error) a {
75
+ background: var(--sds-g-color-error-base-40, #ba0517);
76
+ }
77
+
78
+ /**
79
+ * State - Success
80
+ *
81
+ * @TODO: currently not supported by LBC
82
+ */
83
+ :host([data-render-mode="shadow"].slds-has-success) a {
84
+ background: var(--sds-g-color-success-base-70, #45c65a);
85
+ }
86
+
87
+ :host([data-render-mode="shadow"].slds-has-error) a,:host([data-render-mode="shadow"].slds-has-success) a {
88
+ color: var(--sds-g-color-neutral-base-100, #ffffff);
89
+ }
90
+
91
+ /**
92
+ * State - Warning
93
+ *
94
+ * @TODO: currently not supported by LBC
95
+ */
96
+ :host([data-render-mode="shadow"].slds-has-warning) a {
97
+ background: var(--sds-g-color-warning-base-70, #fe9339);
98
+ }
99
+
100
+ :host([data-render-mode="shadow"].slds-has-warning) .slds-indicator_unread {
101
+ background-color: currentColor;
102
+ }
103
+
104
+ :host([data-render-mode="shadow"].slds-has-warning) .slds-indicator_unsaved {
105
+ color: currentColor;
106
+ }
107
+
108
+ :host([data-render-mode="shadow"].slds-has-error) a:hover,:host([data-render-mode="shadow"].slds-has-error) a:focus,:host([data-render-mode="shadow"].slds-has-success) a:hover,:host([data-render-mode="shadow"].slds-has-success) a:focus,:host([data-render-mode="shadow"].slds-has-warning) a:hover,:host([data-render-mode="shadow"].slds-has-warning) a:focus {
109
+ text-decoration: underline;
110
+ }
111
+
112
+ /**
113
+ * State - Selected
114
+ *
115
+ * We scope to aria-checked so we don't accidentally toggle prefix icons
116
+ * which are a separate API.
117
+ */
118
+ :host([data-render-mode="shadow"]) [aria-checked='false'] lightning-primitive-icon::part(icon) {
119
+ opacity: 0;
120
+ }
121
+
122
+ :host([data-render-mode="shadow"]) [aria-checked='true'] lightning-primitive-icon::part(icon) {
123
+ opacity: 1;
124
+ }
125
+
126
+ /**
127
+ * Status Indicator
128
+ *
129
+ * @TODO: Look into viability of refactoring into utility
130
+ */
131
+ :host([data-render-mode="shadow"]) .slds-indicator_unsaved,:host([data-render-mode="shadow"])
132
+ .slds-indicator--unsaved {
133
+ color: var(--sds-g-color-brand-base-50, #0176d3);
134
+ align-self: center;
135
+ position: relative;
136
+
137
+ /* Unsaved indicator does not have gap spacing, everything else does */
138
+ margin-inline-end: calc(var(--sds-g-spacing-2, 0.5rem) * -1);
139
+ }
140
+ }
@@ -1,3 +1,6 @@
1
+ @import 'lightning/sldsCommon';
2
+ @import './menu-item.slds.css';
3
+
1
4
  :host {
2
5
  display: block;
3
6
  }