lightning-base-components 1.18.2-alpha → 1.18.4-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 (137) hide show
  1. package/metadata/raptor.json +4 -0
  2. package/package.json +15 -1
  3. package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
  4. package/src/lightning/accordion/__docs__/accordion.md +2 -2
  5. package/src/lightning/avatar/__docs__/avatar.md +7 -7
  6. package/src/lightning/badge/__docs__/badge.md +2 -2
  7. package/src/lightning/baseCombobox/baseCombobox.js +62 -22
  8. package/src/lightning/breadcrumbs/__docs__/breadcrumbs.md +3 -3
  9. package/src/lightning/button/__docs__/button.md +15 -15
  10. package/src/lightning/buttonIcon/__docs__/buttonIcon.md +9 -9
  11. package/src/lightning/buttonIconStateful/__docs__/buttonIconStateful.md +9 -9
  12. package/src/lightning/buttonMenu/__docs__/buttonMenu.md +8 -8
  13. package/src/lightning/buttonStateful/__docs__/buttonStateful.md +12 -12
  14. package/src/lightning/calendar/calendar.css +2 -2
  15. package/src/lightning/calendar/calendar.js +4 -2
  16. package/src/lightning/card/__docs__/card.md +3 -3
  17. package/src/lightning/checkboxGroup/__docs__/checkboxGroup.md +2 -2
  18. package/src/lightning/datatable/__docs__/datatable.md +45 -35
  19. package/src/lightning/datatable/autoWidthStrategy.js +3 -0
  20. package/src/lightning/datatable/columnWidthManager.js +1 -1
  21. package/src/lightning/datatable/datatable.js +8 -7
  22. package/src/lightning/datatable/rowSelection.js +7 -4
  23. package/src/lightning/datatable/templates/table/table.html +1 -0
  24. package/src/lightning/datepicker/datepicker.css +2 -2
  25. package/src/lightning/datepicker/datepicker.js +4 -2
  26. package/src/lightning/datetimepicker/datetimepicker.css +2 -2
  27. package/src/lightning/datetimepicker/datetimepicker.js +4 -2
  28. package/src/lightning/dualListbox/dualListbox.js +16 -7
  29. package/src/lightning/formattedRichText/formatted-rich-text.slds.css +230 -0
  30. package/src/lightning/formattedRichText/formattedRichText.css +2 -0
  31. package/src/lightning/formattedRichText/formattedRichText.js +4 -2
  32. package/src/lightning/formattedText/formattedText.css +1 -0
  33. package/src/lightning/formattedText/formattedText.js +3 -2
  34. package/src/lightning/helptext/__docs__/helptext.md +2 -2
  35. package/src/lightning/icon/__docs__/icon.md +5 -5
  36. package/src/lightning/icon/icon.js +6 -1
  37. package/src/lightning/iconUtils/iconUtils.js +0 -12
  38. package/src/lightning/iconUtils/polyfill.js +5 -90
  39. package/src/lightning/input/__docs__/input.md +7 -7
  40. package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.css +6 -0
  41. package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.html +2 -1
  42. package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.js +1 -1
  43. package/src/lightning/input/__examples__/number/number.html +0 -5
  44. package/src/lightning/input/input.css +2 -4
  45. package/src/lightning/input/input.html +149 -239
  46. package/src/lightning/input/input.js +209 -532
  47. package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -3
  48. package/src/lightning/inputUtils/inputUtils.js +15 -20
  49. package/src/lightning/inputUtils/normalize.js +7 -0
  50. package/src/lightning/{input/numberUtil.js → inputUtils/number.js} +1 -1
  51. package/src/lightning/inputUtils/utils.js +18 -0
  52. package/src/lightning/modalBody/__docs__/modalBody.md +9 -9
  53. package/src/lightning/modalFooter/__docs__/modalFooter.md +9 -9
  54. package/src/lightning/modalHeader/__docs__/modalHeader.md +9 -9
  55. package/src/lightning/overlayContainer/overlayContainer.js +4 -2
  56. package/src/lightning/pill/__docs__/pill.md +3 -3
  57. package/src/lightning/pillContainer/__docs__/pillContainer.md +14 -14
  58. package/src/lightning/primitiveIcon/primitiveIcon.js +8 -5
  59. package/src/lightning/primitiveInputCheckbox/form-element.slds.css +281 -0
  60. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.css +3 -0
  61. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +48 -0
  62. package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +139 -0
  63. package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +281 -0
  64. package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +126 -0
  65. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.css +6 -0
  66. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +24 -0
  67. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +176 -0
  68. package/src/lightning/primitiveInputColor/form-element.slds.css +281 -0
  69. package/src/lightning/primitiveInputColor/input-color.slds.css +35 -0
  70. package/src/lightning/primitiveInputColor/primitiveInputColor.css +4 -0
  71. package/src/lightning/primitiveInputColor/primitiveInputColor.html +50 -0
  72. package/src/lightning/primitiveInputColor/primitiveInputColor.js +184 -0
  73. package/src/lightning/primitiveInputFile/button.slds.css +527 -0
  74. package/src/lightning/primitiveInputFile/form-element.slds.css +281 -0
  75. package/src/lightning/primitiveInputFile/input-file.slds.css +62 -0
  76. package/src/lightning/primitiveInputFile/primitiveInputFile.css +5 -0
  77. package/src/lightning/primitiveInputFile/primitiveInputFile.html +45 -0
  78. package/src/lightning/primitiveInputFile/primitiveInputFile.js +111 -0
  79. package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +24 -0
  80. package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +103 -0
  81. package/src/lightning/primitiveInputSimple/form-element.slds.css +281 -0
  82. package/src/lightning/primitiveInputSimple/input-text.slds.css +398 -0
  83. package/src/lightning/primitiveInputSimple/primitiveInputSimple.css +9 -0
  84. package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +65 -0
  85. package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +585 -0
  86. package/src/lightning/primitiveInputToggle/form-element.slds.css +281 -0
  87. package/src/lightning/primitiveInputToggle/input-toggle.slds.css +170 -0
  88. package/src/lightning/primitiveInputToggle/primitiveInputToggle.css +3 -0
  89. package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +34 -0
  90. package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +164 -0
  91. package/src/lightning/radioGroup/__docs__/radioGroup.md +4 -4
  92. package/src/lightning/select/__docs__/select.md +2 -2
  93. package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +1 -1
  94. package/src/lightning/sldsCommon/sldsCommon.css +144 -42
  95. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +10 -0
  96. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.js-meta.xml +4 -0
  97. package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.css +18 -0
  98. package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.js-meta.xml +4 -0
  99. package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +24 -0
  100. package/src/lightning/sldsUtilsBox/sldsUtilsBox.js-meta.xml +4 -0
  101. package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.css +20 -0
  102. package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.js-meta.xml +4 -0
  103. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +259 -0
  104. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.js-meta.xml +4 -0
  105. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +8 -0
  106. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.js-meta.xml +4 -0
  107. package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.css +57 -0
  108. package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.js-meta.xml +4 -0
  109. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +313 -0
  110. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.js-meta.xml +4 -0
  111. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +308 -0
  112. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.js-meta.xml +4 -0
  113. package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +18 -0
  114. package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.js-meta.xml +4 -0
  115. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +1408 -0
  116. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.js-meta.xml +4 -0
  117. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +295 -0
  118. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.js-meta.xml +4 -0
  119. package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.css +14 -0
  120. package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.js-meta.xml +4 -0
  121. package/src/lightning/slider/__docs__/slider.md +2 -2
  122. package/src/lightning/tabset/__docs__/tabset.md +2 -2
  123. package/src/lightning/textarea/__docs__/textarea.md +2 -2
  124. package/src/lightning/timepicker/timepicker.js +4 -2
  125. package/src/lightning/toast/toast.js-meta.xml +2 -0
  126. package/src/lightning/toastContainer/__docs__/toastContainer.md +14 -34
  127. package/src/lightning/toastContainer/toastContainer.js +10 -15
  128. package/src/lightning/tooltipLibrary/tooltipLibrary.js +12 -5
  129. package/src/lightning/iconUtils/isIframeInEdge.js +0 -7
  130. package/src/lightning/iconUtils/supportsSvg.js +0 -16
  131. /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.html +0 -0
  132. /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.js +0 -0
  133. /package/src/lightning/{input/emailUtil.js → inputUtils/email.js} +0 -0
  134. /package/src/lightning/{input → primitiveInputCheckbox}/input-checkbox.slds.css +0 -0
  135. /package/src/lightning/{input → primitiveInputColor}/input-text.slds.css +0 -0
  136. /package/src/lightning/{input → primitiveInputSimple}/normalize.js +0 -0
  137. /package/src/lightning/{input → primitiveInputSimple}/selection.js +0 -0
@@ -3151,6 +3151,9 @@
3151
3151
  "minVersion": "59.0",
3152
3152
  "slotNames": [],
3153
3153
  "properties": [
3154
+ {
3155
+ "name": "displayInfo"
3156
+ },
3154
3157
  {
3155
3158
  "name": "filter"
3156
3159
  },
@@ -3667,6 +3670,7 @@
3667
3670
  ]
3668
3671
  },
3669
3672
  "toast": {
3673
+ "minVersion": "59.0",
3670
3674
  "slotNames": [
3671
3675
  "",
3672
3676
  "message"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.18.2-alpha",
3
+ "version": "1.18.4-alpha",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "external",
@@ -1271,18 +1271,25 @@
1271
1271
  "lightning-button-menu",
1272
1272
  "lightning-button-stateful",
1273
1273
  "lightning-card",
1274
+ "lightning-calendar",
1274
1275
  "lightning-color-picker-custom",
1275
1276
  "lightning-color-picker-panel",
1276
1277
  "lightning-combobox",
1278
+ "lightning-datepicker",
1279
+ "lightning-datetimepicker",
1277
1280
  "lightning-dual-listbox",
1278
1281
  "lightning-dynamic-icon",
1282
+ "lightning-formatted-rich-text",
1283
+ "lightning-formatted-text",
1279
1284
  "lightning-helptext",
1280
1285
  "lightning-icon",
1286
+ "lightning-input",
1281
1287
  "lightning-layout",
1282
1288
  "lightning-layout-item",
1283
1289
  "lightning-menu-divider",
1284
1290
  "lightning-menu-item",
1285
1291
  "lightning-menu-subheader",
1292
+ "lightning-overlay-container",
1286
1293
  "lightning-pill",
1287
1294
  "lightning-pill-container",
1288
1295
  "lightning-popup",
@@ -1290,10 +1297,17 @@
1290
1297
  "lightning-primitive-bubble",
1291
1298
  "lightning-primitive-color-picker-button",
1292
1299
  "lightning-primitive-icon",
1300
+ "lightning-primitive-input-checkbox",
1301
+ "lightning-primitive-input-checkbox-button",
1302
+ "lightning-primitive-input-color",
1303
+ "lightning-primitive-input-file",
1304
+ "lightning-primitive-input-simple",
1305
+ "lightning-primitive-input-toggle",
1293
1306
  "lightning-radio-group",
1294
1307
  "lightning-select",
1295
1308
  "lightning-spinner",
1296
1309
  "lightning-tab-bar",
1310
+ "lightning-timepicker",
1297
1311
  "lightning-vertical-navigation",
1298
1312
  "lightning-vertical-navigation-section"
1299
1313
  ],
@@ -1 +1 @@
1
- export default '242';
1
+ export default '244';
@@ -231,11 +231,11 @@ To apply custom styling, use the `:host` selector or define a custom class using
231
231
  </lightning-accordion>
232
232
  ```
233
233
 
234
- Use SLDS styling hooks to customize the component's styles. For example, specify the border color using the `--sds-c-accordion-color-border` custom property.
234
+ Use SLDS styling hooks to customize the component's styles. For example, specify the border color using the `--slds-c-accordion-color-border` custom property.
235
235
 
236
236
  ```css
237
237
  .example-accordion {
238
- --sds-c-accordion-color-border: orange;
238
+ --slds-c-accordion-color-border: orange;
239
239
  }
240
240
  ```
241
241
 
@@ -127,22 +127,22 @@ The fallback icon is displayed if the image path is invalid. To apply custom sty
127
127
  </lightning-avatar>
128
128
  ```
129
129
 
130
- Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the fallback icon using the `--sds-c-icon-color-background` custom property.
130
+ Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the fallback icon using the `--slds-c-icon-color-background` custom property.
131
131
 
132
132
  ```css
133
133
  .my-fallback-color {
134
- --sds-c-icon-color-background: orange;
134
+ --slds-c-icon-color-background: orange;
135
135
  }
136
136
  ```
137
137
 
138
- `lightning-avatar` contains the same customizable elements as `lightning-icon`, which supports the `--sds-c-icon-*` custom properties. Consider the following guidelines when working with SLDS styling hooks.
138
+ `lightning-avatar` contains the same customizable elements as `lightning-icon`, which supports the `--slds-c-icon-*` custom properties. Consider the following guidelines when working with SLDS styling hooks.
139
139
 
140
140
  | CSS Custom Property | `lightning-avatar` Guideline |
141
141
  | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
142
- | `--sds-c-avatar-text-color` | Use with the `initials` attribute and when you specify the `fallback-icon-name` with a standard, utility, doctype, or action icon only. |
143
- | `--sds-c-avatar-radius-border` | Adds a rounded border. Alternatively, to create an avatar on a circular background, use the `circle` variant. |
144
- | `--sds-c-icon-color-background` | Use with the `fallback-icon-name` attribute. |
145
- | `--sds-c-icon-color-foreground` | Use with the `fallback-icon-name` attribute for standard, custom, and action icons only. |
142
+ | `--slds-c-avatar-text-color` | Use with the `initials` attribute and when you specify the `fallback-icon-name` with a standard, utility, doctype, or action icon only. |
143
+ | `--slds-c-avatar-radius-border` | Adds a rounded border. Alternatively, to create an avatar on a circular background, use the `circle` variant. |
144
+ | `--slds-c-icon-color-background` | Use with the `fallback-icon-name` attribute. |
145
+ | `--slds-c-icon-color-foreground` | Use with the `fallback-icon-name` attribute for standard, custom, and action icons only. |
146
146
 
147
147
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/avatar/#Styling-Hooks-Overview) for a list of CSS custom properties.
148
148
 
@@ -80,11 +80,11 @@ Alternatively, to apply custom styling, use the `:host` selector or define a cus
80
80
  <lightning-badge label="Pending" class="pending-badge"> </lightning-badge>
81
81
  ```
82
82
 
83
- Use SLDS styling hooks to customize the component's styles. For example, specify the badge color using the `--sds-c-badge-color-background` custom property.
83
+ Use SLDS styling hooks to customize the component's styles. For example, specify the badge color using the `--slds-c-badge-color-background` custom property.
84
84
 
85
85
  ```css
86
86
  .pending-badge {
87
- --sds-c-badge-color-background: orange;
87
+ --slds-c-badge-color-background: orange;
88
88
  }
89
89
  ```
90
90
 
@@ -33,6 +33,8 @@ const i18n = {
33
33
  const SMALL_MIN_HEIGHT = '2.25rem';
34
34
  const MEDIUM_MIN_HEIGHT = '6.75rem';
35
35
  const INPUT_ELEMENT_SELECTOR = '.slds-combobox__input';
36
+ const INPUT_PART_ELEMENT_SELECTOR = '[part~="input-text"]';
37
+ const FAUX_INPUT_BUTTON_ELEMENT_SELECTOR = `${INPUT_ELEMENT_SELECTOR}.slds-input_faux`;
36
38
 
37
39
  /**
38
40
  * Breakpoint when viewport height doesn't fit 10 items in the dropdown
@@ -99,11 +101,13 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
99
101
  originDisableDefaultHighlight;
100
102
  privateDisableDefaultHighlight;
101
103
  _editingMode = false;
104
+ _connected = false;
105
+ ariaObserver = null;
102
106
 
103
107
  constructor() {
104
108
  super();
105
109
  this._events = new BaseComboboxEvents(this);
106
- this.ariaObserver = new AriaObserver(this);
110
+ this.setupAriaObserverIfAbsent();
107
111
  }
108
112
 
109
113
  renderedCallback() {
@@ -115,19 +119,13 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
115
119
  },
116
120
  })
117
121
  );
118
-
119
- if (this.isConnected) {
120
- this.ariaObserver.sync();
121
- }
122
-
122
+ this.syncAriaObserver();
123
123
  this.synchronizeA11y();
124
124
  }
125
125
 
126
126
  connectedCallback() {
127
127
  super.connectedCallback();
128
- if (!this.ariaObserver) {
129
- this.ariaObserver = new AriaObserver(this);
130
- }
128
+ this.setupAriaObserverIfAbsent();
131
129
  this.overrideDropdownAlignment();
132
130
  this.classList.add('slds-combobox_container');
133
131
  this._connected = true;
@@ -137,9 +135,19 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
137
135
  disconnectedCallback() {
138
136
  this._connected = false;
139
137
  this._listBoxElementCache = undefined;
140
- if (this.ariaObserver) {
138
+ this.removeAriaObserver();
139
+ }
140
+
141
+ setupAriaObserverIfAbsent() {
142
+ if (!this.ariaObserver) {
143
+ this.ariaObserver = new AriaObserver(this);
144
+ }
145
+ }
146
+
147
+ removeAriaObserver() {
148
+ if (this.ariaObserver && this.ariaObserver.disconnect) {
141
149
  this.ariaObserver.disconnect();
142
- this.ariaObserver = undefined;
150
+ this.ariaObserver = null;
143
151
  }
144
152
  }
145
153
 
@@ -162,6 +170,15 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
162
170
  this.connectAriaControls();
163
171
  }
164
172
 
173
+ syncAriaObserver() {
174
+ this.setupAriaObserverIfAbsent();
175
+ const ariaObserverSyncExists =
176
+ this.ariaObserver && this.ariaObserver.sync;
177
+ if (this.isConnected && ariaObserverSyncExists) {
178
+ this.ariaObserver.sync();
179
+ }
180
+ }
181
+
165
182
  connectAriaControls() {
166
183
  this.connectAriaAttribute({
167
184
  attribute: ARIA_CONTROLS,
@@ -171,15 +188,18 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
171
188
  }
172
189
 
173
190
  connectAriaAttribute(params) {
174
- const relatedNodeIds = Array.isArray(params.relatedNodeIds)
175
- ? params.relatedNodeIds.map((el) => getRealDOMId(el)).join(' ')
176
- : getRealDOMId(params.relatedNodeIds);
177
-
178
- this.ariaObserver.connect({
179
- ...params,
180
- targetSelector: INPUT_ELEMENT_SELECTOR,
181
- relatedNodeIds,
182
- });
191
+ this.setupAriaObserverIfAbsent();
192
+ if (this.ariaObserver && this.ariaObserver.connect) {
193
+ const relatedNodeIds = Array.isArray(params.relatedNodeIds)
194
+ ? params.relatedNodeIds.map((el) => getRealDOMId(el)).join(' ')
195
+ : getRealDOMId(params.relatedNodeIds);
196
+
197
+ this.ariaObserver.connect({
198
+ ...params,
199
+ targetSelector: INPUT_ELEMENT_SELECTOR,
200
+ relatedNodeIds,
201
+ });
202
+ }
183
203
  }
184
204
 
185
205
  @api
@@ -230,7 +250,10 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
230
250
  }
231
251
 
232
252
  set rootAriaNode(root) {
233
- this.ariaObserver.root = root;
253
+ this.setupAriaObserverIfAbsent();
254
+ if (this.ariaObserver) {
255
+ this.ariaObserver.root = root;
256
+ }
234
257
  }
235
258
 
236
259
  get inputId() {
@@ -932,8 +955,25 @@ export default class LightningBaseCombobox extends LightningShadowBaseClass {
932
955
  this._autoPosition = new AutoPosition(this);
933
956
  }
934
957
 
958
+ // when using dropdown-alignment='auto' positioning and standard variant lighting-combobox
959
+ // the selector for 'target' is determined by this.isUserInputDisabled
960
+ // when TRUE the target is a BUTTON element acting as a faux / fake INPUT element
961
+ // when FALSE the target is an INPUT element
962
+ // NOTE: isUserInputDisabled is NOT determined by combobox.disabled
963
+ // instead isUserInputDisabled is determined by
964
+ // this.isStandardVariant && !this.isAutocompleteEnabled (which is an internal variable)
965
+ // this means that the INPUT is often NOT present, and instead a BUTTON is
966
+ // this selector for .start({ target }) is used to
967
+ // position the element from so this.isUserInputDisabled
968
+ // must be taken into account so the proper selector can be used
969
+ // the 'element' below is always the same without IF/ELSE, so there
970
+ // is not a need to switch between selectors
971
+ const selectorToUse = this.isUserInputDisabled
972
+ ? FAUX_INPUT_BUTTON_ELEMENT_SELECTOR
973
+ : INPUT_PART_ELEMENT_SELECTOR;
974
+
935
975
  this._autoPosition.start({
936
- target: () => this.template.querySelector("[part~='input-text']"),
976
+ target: () => this.template.querySelector(selectorToUse),
937
977
  element: () => this.template.querySelector('div.slds-dropdown'),
938
978
  align: {
939
979
  horizontal: Direction.Left,
@@ -39,12 +39,12 @@ This example adds a margin around the breadcrumbs using an SLDS class.
39
39
  </lightning-breadcrumbs>
40
40
  ```
41
41
 
42
- Use SLDS styling hooks to customize the component's styles. For example, adjust the spacing before and after the greater-than sign using the `--sds-c-breadcrumbs-*` custom properties.
42
+ Use SLDS styling hooks to customize the component's styles. For example, adjust the spacing before and after the greater-than sign using the `--slds-c-breadcrumbs-*` custom properties.
43
43
 
44
44
  ```css
45
45
  .my-breadcrumbs {
46
- --sds-c-breadcrumbs-spacing-inline-end: 20px;
47
- --sds-c-breadcrumbs-spacing-inline-start: 30px;
46
+ --slds-c-breadcrumbs-spacing-inline-end: 20px;
47
+ --slds-c-breadcrumbs-spacing-inline-start: 30px;
48
48
  }
49
49
  ```
50
50
 
@@ -145,11 +145,11 @@ To apply custom styling, use the `:host` selector or define a custom class using
145
145
  </lightning-button>
146
146
  ```
147
147
 
148
- Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the button with `brand` variant using the `--sds-c-button-brand-color-background` custom property.
148
+ Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the button with `brand` variant using the `--slds-c-button-brand-color-background` custom property.
149
149
 
150
150
  ```css
151
151
  .my-brand {
152
- --sds-c-button-brand-color-background: purple;
152
+ --slds-c-button-brand-color-background: purple;
153
153
  }
154
154
  ```
155
155
 
@@ -157,16 +157,16 @@ Custom properties for buttons work only with particular `lightning-button` varia
157
157
 
158
158
  | CSS Custom Property | `lightning-button` Variants |
159
159
  | ----------------------------------- | ------------------------------------------------ |
160
- | `--sds-c-button-*` | all |
161
- | `--sds-c-button-color-*` | `base` |
162
- | `--sds-c-button-text-color-*` | `neutral` (default), `base`, and `brand-outline` |
163
- | `--sds-c-button-neutral-*` | `neutral` (default) |
164
- | `--sds-c-button-brand-*` | `brand` |
165
- | `--sds-c-button-outline-brand-*` | `brand-outline` |
166
- | `--sds-c-button-destructive-*` | `destructive` |
167
- | `--sds-c-button-text-destructive-*` | `destructive-text` |
168
- | `--sds-c-button-inverse-*` | `inverse` |
169
- | `--sds-c-button-success-*` | `success` |
160
+ | `--slds-c-button-*` | all |
161
+ | `--slds-c-button-color-*` | `base` |
162
+ | `--slds-c-button-text-color-*` | `neutral` (default), `base`, and `brand-outline` |
163
+ | `--slds-c-button-neutral-*` | `neutral` (default) |
164
+ | `--slds-c-button-brand-*` | `brand` |
165
+ | `--slds-c-button-outline-brand-*` | `brand-outline` |
166
+ | `--slds-c-button-destructive-*` | `destructive` |
167
+ | `--slds-c-button-text-destructive-*` | `destructive-text` |
168
+ | `--slds-c-button-inverse-*` | `inverse` |
169
+ | `--slds-c-button-success-*` | `success` |
170
170
 
171
171
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/buttons/#Styling-Hooks-Overview) for a list of CSS custom properties.
172
172
 
@@ -186,9 +186,9 @@ We don't support changing the label alignment on the button. To adjust the paddi
186
186
 
187
187
  To address text wrapping in long labels when the browser viewport is reduced, customize the line height and block spacing of the button label using SLDS styling hooks.
188
188
 
189
- - `--sds-c-button-line-height`
190
- - `--sds-c-button-spacing-block-start`
191
- - `--sds-c-button-spacing-block-end`
189
+ - `--slds-c-button-line-height`
190
+ - `--slds-c-button-spacing-block-start`
191
+ - `--slds-c-button-spacing-block-end`
192
192
 
193
193
  On mobile screens, we recommend setting the button size to
194
194
  44x44 px. If you have more than one target on a screen that performs the same action, only one of the targets need to meet the target size of 44x44 px. For more information, see [Follow Accessible Mobile Design Guidelines
@@ -128,26 +128,26 @@ To apply custom styling, use the `:host` selector or define a custom class using
128
128
  ></lightning-button-icon>
129
129
  ```
130
130
 
131
- Use SLDS styling hooks to customize the component's styles. For example, specify the border radius using the `--sds-c-button-radius-border` custom property.
131
+ Use SLDS styling hooks to customize the component's styles. For example, specify the border radius using the `--slds-c-button-radius-border` custom property.
132
132
 
133
133
  ```css
134
134
  .my-round-button {
135
- --sds-c-button-radius-border: 20px;
135
+ --slds-c-button-radius-border: 20px;
136
136
  }
137
137
  ```
138
138
 
139
- `lightning-button-icon` contains the same customizable elements as `lightning-button`, which supports `--sds-c-button-*` custom properties.
139
+ `lightning-button-icon` contains the same customizable elements as `lightning-button`, which supports `--slds-c-button-*` custom properties.
140
140
 
141
141
  Custom properties for button icons work only with particular `lightning-button` variants.
142
142
 
143
143
  | CSS Custom Property | `lightning-button-icon` Variants |
144
144
  | --------------------------------- | ------------------------------------------------------------ |
145
- | `--sds-c-button-color-background` | `border` (default), `bare`, `bare-inverse`, and `container` |
146
- | `--sds-c-button-color-border` | `bare`, `bare-inverse`, and `container` |
147
- | `--sds-c-button-text-color` | N/A |
148
- | `--sds-c-button-text-color-*` | `border` (default), `bare`, `container`, and `border-filled` |
149
- | `--sds-c-button-radius-border` | all |
150
- | `--sds-c-button-sizing-border` | `bare`, `bare-inverse`, `border-inverse` and `container` |
145
+ | `--slds-c-button-color-background` | `border` (default), `bare`, `bare-inverse`, and `container` |
146
+ | `--slds-c-button-color-border` | `bare`, `bare-inverse`, and `container` |
147
+ | `--slds-c-button-text-color` | N/A |
148
+ | `--slds-c-button-text-color-*` | `border` (default), `bare`, `container`, and `border-filled` |
149
+ | `--slds-c-button-radius-border` | all |
150
+ | `--slds-c-button-sizing-border` | `bare`, `bare-inverse`, `border-inverse` and `container` |
151
151
 
152
152
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/buttons/#Styling-Hooks-Overview) for a list of CSS custom properties.
153
153
 
@@ -119,26 +119,26 @@ To apply custom styling, use the `:host` selector or define a custom class using
119
119
  ></lightning-button-icon-stateful>
120
120
  ```
121
121
 
122
- Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the button using the `--sds-c-button-color-background` custom property.
122
+ Use SLDS styling hooks to customize the component's styles. For example, specify the background color on the button using the `--slds-c-button-color-background` custom property.
123
123
 
124
124
  ```css
125
125
  .my-brand {
126
- --sds-c-button-color-background: purple;
126
+ --slds-c-button-color-background: purple;
127
127
  }
128
128
  ```
129
129
 
130
- `lightning-button-icon-stateful` contains the same customizable elements as `lightning-button`, which supports `--sds-c-button-*` custom properties.
130
+ `lightning-button-icon-stateful` contains the same customizable elements as `lightning-button`, which supports `--slds-c-button-*` custom properties.
131
131
 
132
132
  Custom properties for stateful button icons work only with particular `lightning-button-icon-stateful` variants.
133
133
 
134
134
  | CSS Custom Property | `lightning-button-icon-stateful` Variants |
135
135
  | --------------------------------- | ----------------------------------------- |
136
- | `--sds-c-button-color-background` | `border` (default) and `border-inverse` |
137
- | `--sds-c-button-color-border` | N/A |
138
- | `--sds-c-button-text-color` | N/A |
139
- | `--sds-c-button-text-color-*` | `border` (default) and `border-filled` |
140
- | `--sds-c-button-radius-border` | all |
141
- | `--sds-c-button-sizing-border` | N/A |
136
+ | `--slds-c-button-color-background` | `border` (default) and `border-inverse` |
137
+ | `--slds-c-button-color-border` | N/A |
138
+ | `--slds-c-button-text-color` | N/A |
139
+ | `--slds-c-button-text-color-*` | `border` (default) and `border-filled` |
140
+ | `--slds-c-button-radius-border` | all |
141
+ | `--slds-c-button-sizing-border` | N/A |
142
142
 
143
143
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/buttons/#Styling-Hooks-Overview) for a list of CSS custom properties.
144
144
 
@@ -202,22 +202,22 @@ Use SLDS styling hooks to customize the component's styles. For example, specify
202
202
 
203
203
  ```css
204
204
  .my-button-menu {
205
- --sds-c-button-color-background: orange;
205
+ --slds-c-button-color-background: orange;
206
206
  }
207
207
  ```
208
208
 
209
- `lightning-button-menu` contains the same customizable elements as `lightning-button`, which supports `--sds-c-button-*` custom properties.
209
+ `lightning-button-menu` contains the same customizable elements as `lightning-button`, which supports `--slds-c-button-*` custom properties.
210
210
 
211
211
  Custom properties for button menus work only with particular `lightning-button-menu` variants.
212
212
 
213
213
  | CSS Custom Property | `lightning-button-menu` Variants |
214
214
  | --------------------------------- | ----------------------------------------------------------------------------------------------------------- |
215
- | `--sds-c-button-color-background` | `border` (default), `bare`, `bare-inverse`, and `container` |
216
- | `--sds-c-button-color-border` | `bare`, `bare-inverse`, and `container` |
217
- | `--sds-c-button-text-color` | `border` (default), `bare`, `bare-inverse`,`container`, and `border-filled`; use with the `label` attribute |
218
- | `--sds-c-button-text-color-*` | `border` (default), `bare`, `container`, and `border-filled` |
219
- | `--sds-c-button-radius-border` | all |
220
- | `--sds-c-button-sizing-border` | `bare`, `bare-inverse`, `border-inverse` and `container` |
215
+ | `--slds-c-button-color-background` | `border` (default), `bare`, `bare-inverse`, and `container` |
216
+ | `--slds-c-button-color-border` | `bare`, `bare-inverse`, and `container` |
217
+ | `--slds-c-button-text-color` | `border` (default), `bare`, `bare-inverse`,`container`, and `border-filled`; use with the `label` attribute |
218
+ | `--slds-c-button-text-color-*` | `border` (default), `bare`, `container`, and `border-filled` |
219
+ | `--slds-c-button-radius-border` | all |
220
+ | `--slds-c-button-sizing-border` | `bare`, `bare-inverse`, `border-inverse` and `container` |
221
221
 
222
222
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/buttons/#Styling-Hooks-Overview) for a list of CSS custom properties.
223
223
 
@@ -123,29 +123,29 @@ To apply custom styling, use the `:host` selector or define a custom class using
123
123
  </lightning-button-stateful>
124
124
  ```
125
125
 
126
- Use SLDS styling hooks to customize the component's styles. For example, specify the background and text color on the button using the `--sds-c-button-*` custom properties.
126
+ Use SLDS styling hooks to customize the component's styles. For example, specify the background and text color on the button using the `--slds-c-button-*` custom properties.
127
127
 
128
128
  ```css
129
129
  .my-button {
130
- --sds-c-button-neutral-color-background: orange;
131
- --sds-c-button-text-color: white;
130
+ --slds-c-button-neutral-color-background: orange;
131
+ --slds-c-button-text-color: white;
132
132
  }
133
133
  ```
134
134
 
135
- `lightning-button-stateful` contains the same customizable elements as `lightning-button`, which supports `--sds-c-button-*` custom properties.
135
+ `lightning-button-stateful` contains the same customizable elements as `lightning-button`, which supports `--slds-c-button-*` custom properties.
136
136
 
137
137
  Custom properties for stateful buttons work only with particular `lightning-button-stateful` variants.
138
138
 
139
139
  | CSS Custom Property | `lightning-button-stateful` Variants |
140
140
  | ------------------------------ | ------------------------------------ |
141
- | `--sds-c-button-*` | all |
142
- | `--sds-c-button-color-*` | `base` |
143
- | `--sds-c-button-text-color-*` | `neutral` (default) and `text` |
144
- | `--sds-c-button-neutral-*` | `neutral` (default) |
145
- | `--sds-c-button-brand-*` | `brand` |
146
- | `--sds-c-button-destructive-*` | `destructive` |
147
- | `--sds-c-button-inverse-*` | `inverse` |
148
- | `--sds-c-button-success-*` | `success` |
141
+ | `--slds-c-button-*` | all |
142
+ | `--slds-c-button-color-*` | `base` |
143
+ | `--slds-c-button-text-color-*` | `neutral` (default) and `text` |
144
+ | `--slds-c-button-neutral-*` | `neutral` (default) |
145
+ | `--slds-c-button-brand-*` | `brand` |
146
+ | `--slds-c-button-destructive-*` | `destructive` |
147
+ | `--slds-c-button-inverse-*` | `inverse` |
148
+ | `--slds-c-button-success-*` | `success` |
149
149
 
150
150
  See [Styling Hooks Overview](https://www.lightningdesignsystem.com/components/buttons/#Styling-Hooks-Overview) for a list of CSS custom properties.
151
151
 
@@ -1,5 +1,5 @@
1
- /* @import 'lightning/sldsCommon';
2
- @import './calendar.slds.css'; */
1
+ @import 'lightning/sldsCommon';
2
+ @import './calendar.slds.css';
3
3
 
4
4
  /**
5
5
  * For RTL languages, slds-dropdown_left will have left: 0 swapped with right: 0 which is why we
@@ -3,7 +3,8 @@ import labelNextMonth from '@salesforce/label/LightningDateTimePicker.nextMonth'
3
3
  import labelPreviousMonth from '@salesforce/label/LightningDateTimePicker.previousMonth';
4
4
  import labelToday from '@salesforce/label/LightningDateTimePicker.today';
5
5
  import labelYearSelector from '@salesforce/label/LightningDateTimePicker.yearSelector';
6
- import { LightningElement, api, track } from 'lwc';
6
+ import { api, track } from 'lwc';
7
+ import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
7
8
  import { classSet } from 'lightning/utils';
8
9
  import { generateUniqueId } from 'lightning/inputUtils';
9
10
  import firstDayOfWeek from '@salesforce/i18n/firstDayOfWeek';
@@ -45,7 +46,7 @@ const JAPANESE_CALENDAR_YEARS = [
45
46
  { key: 'M', year: 1868, label: '\u660e\u6cbb' }, // Meiji: 1/1/1868
46
47
  ];
47
48
 
48
- export default class LightningCalendar extends LightningElement {
49
+ export default class LightningCalendar extends LightningShadowBaseClass {
49
50
  @track calendarYear = null;
50
51
  @track calendarMonth = null;
51
52
 
@@ -93,6 +94,7 @@ export default class LightningCalendar extends LightningElement {
93
94
  }
94
95
 
95
96
  connectedCallback() {
97
+ super.connectedCallback();
96
98
  this._connected = true;
97
99
 
98
100
  this.todayDate = getCurrentDateString();
@@ -90,8 +90,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
90
90
 
91
91
  ```css
92
92
  :host {
93
- --sds-c-card-heading-font-weight: 500px;
94
- --sds-c-card-body-spacing-inline-start: 20px;
93
+ --slds-c-card-heading-font-weight: 500px;
94
+ --slds-c-card-body-spacing-inline-start: 20px;
95
95
  }
96
96
  ```
97
97
 
@@ -111,4 +111,4 @@ This component has usage differences from its Aura counterpart. See [Base Compon
111
111
 
112
112
  #### Source Code
113
113
 
114
- `lightning-card` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
114
+ `lightning-card` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -175,8 +175,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
175
175
 
176
176
  ```css
177
177
  :host {
178
- --sds-c-checkbox-color-background-checked: green;
179
- --sds-c-checkbox-mark-color-foreground: yellow;
178
+ --slds-c-checkbox-color-background-checked: green;
179
+ --slds-c-checkbox-mark-color-foreground: yellow;
180
180
  }
181
181
  ```
182
182