lightning-base-components 1.18.2-alpha → 1.18.3-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 (105) 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/radioGroup/__docs__/radioGroup.md +4 -4
  60. package/src/lightning/select/__docs__/select.md +2 -2
  61. package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +1 -1
  62. package/src/lightning/sldsCommon/sldsCommon.css +144 -42
  63. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +10 -0
  64. package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.js-meta.xml +4 -0
  65. package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.css +18 -0
  66. package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.js-meta.xml +4 -0
  67. package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +24 -0
  68. package/src/lightning/sldsUtilsBox/sldsUtilsBox.js-meta.xml +4 -0
  69. package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.css +20 -0
  70. package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.js-meta.xml +4 -0
  71. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +259 -0
  72. package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.js-meta.xml +4 -0
  73. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +8 -0
  74. package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.js-meta.xml +4 -0
  75. package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.css +57 -0
  76. package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.js-meta.xml +4 -0
  77. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +313 -0
  78. package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.js-meta.xml +4 -0
  79. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +308 -0
  80. package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.js-meta.xml +4 -0
  81. package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +18 -0
  82. package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.js-meta.xml +4 -0
  83. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +1408 -0
  84. package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.js-meta.xml +4 -0
  85. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +295 -0
  86. package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.js-meta.xml +4 -0
  87. package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.css +14 -0
  88. package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.js-meta.xml +4 -0
  89. package/src/lightning/slider/__docs__/slider.md +2 -2
  90. package/src/lightning/tabset/__docs__/tabset.md +2 -2
  91. package/src/lightning/textarea/__docs__/textarea.md +2 -2
  92. package/src/lightning/timepicker/timepicker.js +4 -2
  93. package/src/lightning/toast/toast.js-meta.xml +2 -0
  94. package/src/lightning/toastContainer/__docs__/toastContainer.md +14 -34
  95. package/src/lightning/toastContainer/toastContainer.js +10 -15
  96. package/src/lightning/tooltipLibrary/tooltipLibrary.js +12 -5
  97. package/src/lightning/iconUtils/isIframeInEdge.js +0 -7
  98. package/src/lightning/iconUtils/supportsSvg.js +0 -16
  99. package/src/lightning/input/input-checkbox.slds.css +0 -395
  100. package/src/lightning/input/input-text.slds.css +0 -398
  101. package/src/lightning/input/normalize.js +0 -6
  102. package/src/lightning/input/selection.js +0 -131
  103. /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.html +0 -0
  104. /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.js +0 -0
  105. /package/src/lightning/{input/emailUtil.js → inputUtils/email.js} +0 -0
@@ -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
  normalizeBoolean,
4
5
  parseToFormattedLinkifiedParts,
@@ -8,7 +9,7 @@ import {
8
9
  /**
9
10
  * Displays text, replaces newlines with line breaks, and linkifies if requested.
10
11
  */
11
- export default class FormattedText extends LightningElement {
12
+ export default class FormattedText extends LightningShadowBaseClass {
12
13
  /**
13
14
  * Sets the text to display.
14
15
  * @type {string}
@@ -73,9 +73,9 @@ some text that appears before the tooltip icon here
73
73
 
74
74
  To apply custom styling, use the `:host` selector or define a custom class using the `class` attribute.
75
75
 
76
- `lightning-helptext` contains the same customizable elements as `lightning-button-icon` for the button icon, which supports `--sds-c-button-*` custom properties. See the [`lightning-button-icon` documentation](bundle/lightning-button-icon/documentation).
76
+ `lightning-helptext` contains the same customizable elements as `lightning-button-icon` for the button icon, which supports `--slds-c-button-*` custom properties. See the [`lightning-button-icon` documentation](bundle/lightning-button-icon/documentation).
77
77
 
78
- Customizing the tooltip content using the `--sds-c-tooltip-*` custom properties isn't supported. `lightning-helptext` renders the tooltip as the child of the body element outside of the scoped container.
78
+ Customizing the tooltip content using the `--slds-c-tooltip-*` custom properties isn't supported. `lightning-helptext` renders the tooltip as the child of the body element outside of the scoped container.
79
79
 
80
80
  #### Accessibility
81
81
 
@@ -83,12 +83,12 @@ To change the fill and background color of a utility icon, define a custom class
83
83
  </lightning-icon>
84
84
  ```
85
85
 
86
- Specify the fill and background colors on the utility icon using the `--sds-c-icon-color-*` custom properties.
86
+ Specify the fill and background colors on the utility icon using the `--slds-c-icon-color-*` custom properties.
87
87
 
88
88
  ```css
89
89
  .my-icon {
90
- --sds-c-icon-color-foreground-default: orange;
91
- --sds-c-icon-color-background: gray;
90
+ --slds-c-icon-color-foreground-default: orange;
91
+ --slds-c-icon-color-background: gray;
92
92
  }
93
93
  ```
94
94
 
@@ -96,8 +96,8 @@ To change the fill and background colors of a non-utility icon, such as an [acti
96
96
 
97
97
  ```css
98
98
  .my-icon {
99
- --sds-c-icon-color-foreground: orange;
100
- --sds-c-icon-color-background: gray;
99
+ --slds-c-icon-color-foreground: orange;
100
+ --slds-c-icon-color-background: gray;
101
101
  }
102
102
  ```
103
103
 
@@ -18,6 +18,8 @@ import { normalizeVariant } from './util';
18
18
  * Represents a visual element that provides context and enhances usability.
19
19
  */
20
20
  export default class LightningIcon extends LightningShadowBaseClass {
21
+ static validationOptOut = ['class'];
22
+
21
23
  _src;
22
24
  _privateIconName;
23
25
  _iconName;
@@ -174,7 +176,10 @@ export default class LightningIcon extends LightningShadowBaseClass {
174
176
  const name = getName(iconName);
175
177
  const color = iconColors[category] && iconColors[category][name];
176
178
  if (color) {
177
- this.template.host.style = `--sds-c-icon-color-background: var(--slds-c-icon-color-background, ${color});`;
179
+ this.setAttribute(
180
+ 'style',
181
+ `--sds-c-icon-color-background: var(--slds-c-icon-color-background, ${color})`
182
+ );
178
183
  }
179
184
  }
180
185
  }
@@ -1,5 +1,4 @@
1
1
  import { getPathPrefix, getToken } from 'lightning/configProvider';
2
- import isIframeInEdge from './isIframeInEdge';
3
2
 
4
3
  const validNameRe = /^([a-zA-Z]+):([a-zA-Z]\w*)$/;
5
4
  const underscoreRe = /_/g;
@@ -65,17 +64,6 @@ export const getIconPath = (iconName, direction = 'ltr') => {
65
64
  if (isValidName(iconName)) {
66
65
  const baseIconPath = getBaseIconPath(getCategory(iconName), direction);
67
66
  if (baseIconPath) {
68
- // This check was introduced the following MS-Edge issue:
69
- // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9655192/
70
- // If and when this get fixed, we can safely remove this block of code.
71
- if (isIframeInEdge) {
72
- // protocol => 'https:' or 'http:'
73
- // host => hostname + port
74
- const origin = `${window.location.protocol}//${window.location.host}`;
75
- return `${origin}${pathPrefix}${baseIconPath}#${getName(
76
- iconName
77
- )}`;
78
- }
79
67
  return `${pathPrefix}${baseIconPath}#${getName(iconName)}`;
80
68
  }
81
69
  }
@@ -1,93 +1,8 @@
1
1
  /**
2
- This polyfill injects SVG sprites into the document for clients that don't
3
- fully support SVG. We do this globally at the document level for performance
4
- reasons. This causes us to lose namespacing of IDs across sprites. For example,
5
- if both #image from utility sprite and #image from doctype sprite need to be
6
- rendered on the page, both end up as #image from the doctype sprite (last one
7
- wins). SLDS cannot change their image IDs due to backwards-compatibility
8
- reasons so we take care of this issue at runtime by adding namespacing as we
9
- polyfill SVG elements.
10
-
11
- For example, given "/assets/icons/action-sprite/svg/symbols.svg#approval", we
12
- replace the "#approval" id with "#${namespace}-approval" and a similar
13
- operation is done on the corresponding symbol element.
2
+ This polyfill is no longer needed, since we no longer
3
+ support IE or the non-Chromium versions of Edge
4
+ However, since it's exported to customers we can't
5
+ remove it from our repo entirely
14
6
  **/
15
7
 
16
- import fetchSvg from './fetchSvg';
17
- import supportsSvg from './supportsSvg';
18
-
19
- const svgTagName = /svg/i;
20
- const isSvgElement = (el) => el && svgTagName.test(el.nodeName);
21
-
22
- const requestCache = {};
23
- const symbolEls = {};
24
- const svgFragments = {};
25
-
26
- const spritesContainerId = 'slds-svg-sprites';
27
- let spritesEl;
28
-
29
- export function polyfill(el) {
30
- if (!supportsSvg && isSvgElement(el)) {
31
- if (!spritesEl) {
32
- spritesEl = document.createElement('svg');
33
- spritesEl.xmlns = 'http://www.w3.org/2000/svg';
34
- spritesEl['xmlns:xlink'] = 'http://www.w3.org/1999/xlink';
35
- spritesEl.style.display = 'none';
36
- spritesEl.id = spritesContainerId;
37
-
38
- document.body.insertBefore(spritesEl, document.body.childNodes[0]);
39
- }
40
-
41
- Array.from(el.getElementsByTagName('use')).forEach((use) => {
42
- // We access the href differently in raptor and in aura, probably
43
- // due to difference in the way the svg is constructed.
44
- const src =
45
- use.getAttribute('xlink:href') || use.getAttribute('href');
46
-
47
- if (src) {
48
- // "/assets/icons/action-sprite/svg/symbols.svg#approval" =>
49
- // ["/assets/icons/action-sprite/svg/symbols.svg", "approval"]
50
- const parts = src.split('#');
51
- const url = parts[0];
52
- const id = parts[1];
53
- const namespace = url.replace(/[^\w]/g, '-');
54
- const href = `#${namespace}-${id}`;
55
-
56
- if (url.length) {
57
- // set the HREF value to no longer be an external reference
58
- if (use.getAttribute('xlink:href')) {
59
- use.setAttribute('xlink:href', href);
60
- } else {
61
- use.setAttribute('href', href);
62
- }
63
-
64
- // only insert SVG content if it hasn't already been retrieved
65
- if (!requestCache[url]) {
66
- requestCache[url] = fetchSvg(url);
67
- }
68
-
69
- requestCache[url].then((svgContent) => {
70
- // create a document fragment from the svgContent returned (is parsed by HTML parser)
71
- if (!svgFragments[url]) {
72
- const svgFragment = document
73
- .createRange()
74
- .createContextualFragment(svgContent);
75
-
76
- svgFragments[url] = svgFragment;
77
- }
78
- if (!symbolEls[href]) {
79
- const svgFragment = svgFragments[url];
80
- const symbolEl = svgFragment.querySelector(
81
- `#${id}`
82
- );
83
-
84
- symbolEls[href] = true;
85
- symbolEl.id = `${namespace}-${id}`;
86
- spritesEl.appendChild(symbolEl);
87
- }
88
- });
89
- }
90
- }
91
- });
92
- }
93
- }
8
+ export function polyfill() {}
@@ -120,8 +120,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
120
120
 
121
121
  ```css
122
122
  :host {
123
- --sds-c-checkbox-color-background-checked: green;
124
- --sds-c-checkbox-mark-color-foreground: yellow;
123
+ --slds-c-checkbox-color-background-checked: green;
124
+ --slds-c-checkbox-mark-color-foreground: yellow;
125
125
  }
126
126
  ```
127
127
 
@@ -555,7 +555,7 @@ to select a time.
555
555
 
556
556
  On mobile devices, this component uses the native time picker, which ignores the `time-style` attribute. The native time picker uses the user's device settings for the input time format.
557
557
 
558
- On desktop, this component uses a time picker styled with the Lightning Design System. This picker uses the user's Salesforce locale setting for the time format, either 12-hr time with AM/PM or 24-hr time format. The entered date and time are validated against the user's Salesforce locale format during the `blur` event.
558
+ On desktop, this component uses a time picker styled with the Lightning Design System. This picker uses the user's Salesforce locale setting for the time format, either 12-hr time with AM/PM or 24-hr time format. The entered date and time are validated against the user's Salesforce locale format during the `blur` event.
559
559
 
560
560
  The component uses the attribute `time-style="short"` by default, so the time picker
561
561
  displays time without seconds. To display time including seconds, set `time-style="medium"`.
@@ -596,8 +596,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
596
596
 
597
597
  ```css
598
598
  :host {
599
- --sds-c-checkbox-toggle-switch-color-background: orange;
600
- --sds-c-checkbox-toggle-color-background-checked: green;
599
+ --slds-c-checkbox-toggle-switch-color-background: orange;
600
+ --slds-c-checkbox-toggle-color-background-checked: green;
601
601
  }
602
602
  ```
603
603
 
@@ -1033,11 +1033,11 @@ This example creates two fields using `lightning-input` in a compound row simila
1033
1033
  </fieldset>
1034
1034
  ```
1035
1035
 
1036
- To apply custom styling, use the `:host` selector. Use SLDS styling hooks to customize the component's styles. For example, change the background color of the input fields using the `--sds-c-input-color-background` custom property.
1036
+ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to customize the component's styles. For example, change the background color of the input fields using the `--slds-c-input-color-background` custom property.
1037
1037
 
1038
1038
  ```css
1039
1039
  :host {
1040
- --sds-c-input-color-background: orange;
1040
+ --slds-c-input-color-background: orange;
1041
1041
  }
1042
1042
  ```
1043
1043
 
@@ -0,0 +1,6 @@
1
+ .slds-box {
2
+ padding: 1rem;
3
+ margin: 0;
4
+ border-radius: .25rem;
5
+ border: 1px solid lightgrey;
6
+ }
@@ -3,6 +3,7 @@
3
3
  <h2 class="header">Input Checkbox Button</h2>
4
4
  <lightning-input type="checkbox-button" label="Input One" name="input1"></lightning-input>
5
5
  <lightning-input type="checkbox-button" label="Input Two" name="input2" checked required></lightning-input>
6
- <lightning-input type="checkbox-button" label="Input Three" name="input3" checked disabled></lightning-input>
6
+ <lightning-input type="checkbox-button" label="Input Three" name="input3" disabled></lightning-input>
7
+ <lightning-input type="checkbox-button" label="Input Four" name="input3" checked disabled></lightning-input>
7
8
  </div>
8
9
  </template>
@@ -1,3 +1,3 @@
1
1
  import { LightningElement } from 'lwc';
2
2
 
3
- export default class InputCheckboxBasic extends LightningElement {}
3
+ export default class InputCheckboxButton extends LightningElement {}
@@ -19,11 +19,6 @@
19
19
  <lightning-input type="number" name="input8" required value="5" label="Required number field with a maximum value of 99" max="99"></lightning-input>
20
20
  </div>
21
21
 
22
- <div>
23
- <h2>Input Counter</h2>
24
- <lightning-input type="counter" value="123" label="Input with a Counter"></lightning-input>
25
- </div>
26
-
27
22
  <div>
28
23
  <h2>Live Input Number</h2>
29
24
  <lightning-input type="number" name="seven" value={amount} onchange={handleAmountChange} placeholder="type the number of items..." label="Enter a number" ></lightning-input>
@@ -1,7 +1,5 @@
1
- /* @import 'lightning/sldsCommon';
2
- @import './input-text.slds.css';
3
- @import './input-checkbox.slds.css';
4
- @import './form-element.slds.css'; */
1
+ @import 'lightning/sldsCommon';
2
+ @import './form-element.slds.css';
5
3
 
6
4
  :host {
7
5
  display: block;