lightning-base-components 1.14.3-alpha → 1.15.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/metadata/raptor.json +37 -4
  2. package/package.json +11 -4
  3. package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
  4. package/scopedImports/@salesforce-label-LightningModalBase.cancelandclose.js +1 -0
  5. package/scopedImports/@salesforce-label-LightningProgressBar.progressBar.js +1 -0
  6. package/src/lightning/alert/__docs__/alert.md +101 -0
  7. package/src/lightning/alert/__examples__disabled/basic/basic.css +7 -0
  8. package/src/lightning/alert/__examples__disabled/basic/basic.html +8 -0
  9. package/src/lightning/alert/__examples__disabled/basic/basic.js +14 -0
  10. package/src/lightning/alert/alert.html +3 -0
  11. package/src/lightning/alert/alert.js +78 -0
  12. package/src/lightning/alert/alert.js-meta.xml +6 -0
  13. package/src/lightning/ariaObserver/__component__/ariaObserver.spec.js +9 -0
  14. package/src/lightning/ariaObserver/ariaObserver.js +24 -35
  15. package/src/lightning/baseFormattedText/baseFormattedText.html +6 -1
  16. package/src/lightning/baseFormattedText/baseFormattedText.js +5 -0
  17. package/src/lightning/button/__wdio__/utam/utam.html +3 -0
  18. package/src/lightning/button/__wdio__/utam/utam.js +3 -0
  19. package/src/lightning/button/__wdio__/utam/utam.spec.js +20 -0
  20. package/src/lightning/buttonMenu/buttonMenu.js +12 -0
  21. package/src/lightning/confirm/__docs__/confirm.md +100 -0
  22. package/src/lightning/confirm/__examples__disabled/basic/basic.css +7 -0
  23. package/src/lightning/confirm/__examples__disabled/basic/basic.html +8 -0
  24. package/src/lightning/confirm/__examples__disabled/basic/basic.js +14 -0
  25. package/src/lightning/confirm/confirm.html +3 -0
  26. package/src/lightning/confirm/confirm.js +80 -0
  27. package/src/lightning/confirm/confirm.js-meta.xml +6 -0
  28. package/src/lightning/datatable/__examples__/withInfiniteLoading/fetchDataHelper.js +21 -0
  29. package/src/lightning/datatable/__examples__/withInfiniteLoading/withInfiniteLoading.html +13 -0
  30. package/src/lightning/datatable/__examples__/withInfiniteLoading/withInfiniteLoading.js +42 -0
  31. package/src/lightning/datatable/__wdio__/utam/utam.html +17 -0
  32. package/src/lightning/datatable/__wdio__/utam/utam.js +91 -0
  33. package/src/lightning/datatable/__wdio__/utam/utam.spec.js +189 -0
  34. package/src/lightning/datatable/autoWidthStrategy.js +170 -61
  35. package/src/lightning/datatable/{resizer.js → columnResizer.js} +0 -0
  36. package/src/lightning/datatable/columnWidthManager.js +226 -44
  37. package/src/lightning/datatable/columns.js +166 -71
  38. package/src/lightning/datatable/datatable.js +136 -60
  39. package/src/lightning/datatable/fixedWidthStrategy.js +43 -8
  40. package/src/lightning/datatable/headerActions.js +2 -2
  41. package/src/lightning/datatable/infiniteLoading.js +100 -28
  42. package/src/lightning/datatable/inlineEdit.js +21 -30
  43. package/src/lightning/datatable/keyboard.js +166 -131
  44. package/src/lightning/datatable/renderManager.js +117 -122
  45. package/src/lightning/datatable/{datatableResizeObserver.js → resizeObserver.js} +46 -29
  46. package/src/lightning/datatable/resizeSensor.js +19 -3
  47. package/src/lightning/datatable/rowSelection.js +1 -1
  48. package/src/lightning/datatable/rowSelectionShared.js +33 -20
  49. package/src/lightning/datatable/rows.js +9 -8
  50. package/src/lightning/datatable/sort.js +8 -8
  51. package/src/lightning/datatable/state.js +14 -2
  52. package/src/lightning/datatable/templates/div/div.html +133 -119
  53. package/src/lightning/datatable/templates/table/table.html +10 -2
  54. package/src/lightning/datatable/tree.js +25 -0
  55. package/src/lightning/datatable/types.js +77 -9
  56. package/src/lightning/datatable/utils.js +51 -24
  57. package/src/lightning/datatable/virtualization.js +319 -0
  58. package/src/lightning/datatable/widthManagerShared.js +27 -3
  59. package/src/lightning/datatable/wrapText.js +115 -48
  60. package/src/lightning/datepicker/__perf__DISABLED/datepickerWithCalendarOpen.perf.js +55 -0
  61. package/src/lightning/formattedDateTime/__docs__/formattedDateTime.md +36 -3
  62. package/src/lightning/formattedDateTime/__examples__/datetime/datetime.html +2 -2
  63. package/src/lightning/formattedDateTime/__examples__/datetime/datetime.js +3 -1
  64. package/src/lightning/formattedDateTime/__examples__/time/time.html +1 -1
  65. package/src/lightning/formattedDateTime/__examples__/time/time.js +3 -1
  66. package/src/lightning/formattedDateTime/formattedDateTime.js +1 -0
  67. package/src/lightning/iconSvgTemplates/buildTemplates/standard/dashboard_component.html +7 -0
  68. package/src/lightning/iconSvgTemplates/buildTemplates/standard/slack.html +7 -0
  69. package/src/lightning/iconSvgTemplates/buildTemplates/standard/tableau.html +7 -0
  70. package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
  71. package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +8 -1
  72. package/src/lightning/iconSvgTemplates/buildTemplates/utility/data_model.html +7 -0
  73. package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product.html +1 -1
  74. package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product_transaction.html +2 -1
  75. package/src/lightning/iconSvgTemplates/buildTemplates/utility/slack.html +7 -0
  76. package/src/lightning/iconSvgTemplates/buildTemplates/utility/tableau.html +7 -0
  77. package/src/lightning/iconSvgTemplates/buildTemplates/utility/video_off.html +7 -0
  78. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/dashboard_component.html +7 -0
  79. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/slack.html +7 -0
  80. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tableau.html +7 -0
  81. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
  82. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +8 -1
  83. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/data_model.html +7 -0
  84. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product.html +1 -1
  85. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
  86. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/slack.html +7 -0
  87. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tableau.html +7 -0
  88. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/video_off.html +7 -0
  89. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/dashboard_component.html +7 -0
  90. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/slack.html +7 -0
  91. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tableau.html +7 -0
  92. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
  93. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +4 -1
  94. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/dashboard_component.html +7 -0
  95. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/slack.html +7 -0
  96. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tableau.html +7 -0
  97. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
  98. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +4 -1
  99. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +5 -1
  100. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/data_model.html +7 -0
  101. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product.html +1 -1
  102. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product_transaction.html +2 -1
  103. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/slack.html +7 -0
  104. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tableau.html +7 -0
  105. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/video_off.html +7 -0
  106. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +5 -1
  107. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/data_model.html +7 -0
  108. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product.html +1 -1
  109. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
  110. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/slack.html +7 -0
  111. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tableau.html +7 -0
  112. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/video_off.html +7 -0
  113. package/src/lightning/input/__docs__/input.md +2 -0
  114. package/src/lightning/input/input.html +2 -5
  115. package/src/lightning/interactiveDialogBase/interactiveDialogBase.css +494 -0
  116. package/src/lightning/interactiveDialogBase/interactiveDialogBase.html +63 -0
  117. package/src/lightning/interactiveDialogBase/interactiveDialogBase.js +200 -0
  118. package/src/lightning/menuItem/menuItem.js +4 -1
  119. package/src/lightning/modalBase/modalBase.css +20 -0
  120. package/src/lightning/modalBase/modalBase.html +54 -0
  121. package/src/lightning/modalBase/modalBase.js +1039 -0
  122. package/src/lightning/overlay/__docs__/overlay.md +90 -0
  123. package/src/lightning/overlay/__examples__/alert/alert.html +27 -0
  124. package/src/lightning/overlay/__examples__/alert/alert.js +33 -0
  125. package/src/lightning/overlay/__examples__/basic/basic.css +7 -0
  126. package/src/lightning/overlay/__examples__/basic/basic.html +18 -0
  127. package/src/lightning/overlay/__examples__/basic/basic.js +61 -0
  128. package/src/lightning/overlay/__examples__/demo/demo.html +29 -0
  129. package/src/lightning/overlay/__examples__/demo/demo.js +40 -0
  130. package/src/lightning/overlay/__examples__/panel/panel.html +17 -0
  131. package/src/lightning/overlay/__examples__/panel/panel.js +21 -0
  132. package/src/lightning/overlay/overlay.html +3 -0
  133. package/src/lightning/overlay/overlay.js +45 -0
  134. package/src/lightning/overlayContainer/__docs__/overlayContainer.md +0 -0
  135. package/src/lightning/overlayContainer/overlayContainer.html +3 -0
  136. package/src/lightning/overlayContainer/overlayContainer.js +138 -0
  137. package/src/lightning/overlayManager/overlayManager.js +54 -0
  138. package/src/lightning/overlayUtils/overlayUtils.js +17 -0
  139. package/src/lightning/progressBar/progressBar.html +2 -1
  140. package/src/lightning/progressBar/progressBar.js +18 -1
  141. package/src/lightning/prompt/__docs__/prompt.md +102 -0
  142. package/src/lightning/prompt/__examples__disabled/basic/basic.css +7 -0
  143. package/src/lightning/prompt/__examples__disabled/basic/basic.html +8 -0
  144. package/src/lightning/prompt/__examples__disabled/basic/basic.js +15 -0
  145. package/src/lightning/prompt/prompt.css +81 -0
  146. package/src/lightning/prompt/prompt.html +8 -0
  147. package/src/lightning/prompt/prompt.js +92 -0
  148. package/src/lightning/prompt/prompt.js-meta.xml +6 -0
  149. package/src/lightning/spinner/spinner.html +1 -1
  150. package/src/lightning/spinner/spinner.js +12 -0
  151. package/src/lightning/utilsPrivate/phonify.js +1 -1
  152. package/scopedImports/@salesforce-label-LightningModalBase.close.js +0 -1
@@ -0,0 +1,102 @@
1
+ The `lightning/prompt` module lets you create an prompt modal within your component. Use `LightningPrompt` on your components to ask the user to provide information before they continue.
2
+
3
+ `lightning/prompt` is not supported on mobile devices.
4
+
5
+ Use `LightningPrompt.open()` instead of the native `window.prompt()` for a more consistent user experience. They have similar functions, but `LightningPrompt.open()` works in cross-origin iframes, where the `.prompt()` method is no longer supported in Chrome and Safari. Unlike `window.prompt()`, `LightningPrompt.open()` doesn't halt execution on the page, it returns a Promise. Use `async`/`await` or `.then()` for any code you want to execute after the prompt has closed.
6
+
7
+ Import `LightningPrompt` from the `lightning/prompt` module in the component that will launch the prompt modal, and call `LightningPrompt.open()` with your desired attributes.
8
+
9
+ This example creates a prompt modal with a header, message, and two buttons. If you enter text and click **OK** in the prompt, the `.open()` function returns a promise that resolves to the input value. If you click **Cancel**, the function returns a promise that resolves to `null`.
10
+
11
+ ```html
12
+ <!-- c/myApp.html -->
13
+ <template>
14
+ <lightning-button onclick="{handlePromptClick}" label="Open Prompt Modal">
15
+ </lightning-button>
16
+ </template>
17
+ ```
18
+
19
+ ```javascript
20
+ import { LightningElement } from 'lwc';
21
+ import LightningPrompt from 'lightning/prompt';
22
+
23
+ export default class MyApp extends LightningElement {
24
+ handlePromptClick() {
25
+ LightningPrompt.open({
26
+ message: 'this is the prompt message',
27
+ //theme defaults to "default"
28
+ label: 'Please Respond', // this is the header text
29
+ defaultValue: 'initial input value', //this is optional
30
+ }).then((result) => {
31
+ //Prompt has been closed
32
+ //result is input text if OK clicked
33
+ //and null if cancel was clicked
34
+ });
35
+ }
36
+ }
37
+ ```
38
+
39
+ #### Component Styling
40
+
41
+ This component uses the Salesforce Lightning Design System (SLDS) [`prompt` blueprint](https://www.lightningdesignsystem.com/components/prompt/#site-main-content).
42
+
43
+ `LightningPrompt` supports the following attributes:
44
+
45
+ - `message`: Message text that displays in the prompt.
46
+ - `defaultValue`: Optional. Initial leading text for the input text box.
47
+ - `label`: Header text, also used as the `aria-label`. Default string is `Prompt`.
48
+ - `variant`: Two values, `header` and `headerless`. Default value is `header`.
49
+ - `theme`: Color theme for the header. The `theme` attribute supports the following [options](https://www.lightningdesignsystem.com/utilities/themes/#site-main-content) from SLDS:
50
+ - `default`: white
51
+ - `shade`: gray
52
+ - `inverse`: dark blue
53
+ - `alt-inverse`: darker blue
54
+ - `success`: green
55
+ - `info`: gray-ish blue
56
+ - `warning`: yellow
57
+ - `error`: red
58
+ - `offline`: ​black​
59
+
60
+ If an invalid value is provided, `LightningPrompt` uses the `default` theme.
61
+
62
+ #### Testing Your Component's Prompt
63
+
64
+ Code using `LightningPrompt` can be tested by mocking the `LightningPrompt.open()` method.
65
+
66
+ The example below uses a button to open a prompt dialog and sets the result in a template.
67
+
68
+ ```html
69
+ <button data-button onclick="{handleClick}">Open Prompt</button>
70
+ <div data-result>{result}</div>
71
+ ```
72
+
73
+ ```js
74
+ import LightningPrompt from 'lightning/prompt';
75
+ jest.mock('lightning/prompt');
76
+
77
+ test(() => {
78
+ // Create and appendChild(element)
79
+
80
+ const buttonEle = element.shadowRoot.querySelector('[data-button]');
81
+ const resultEle = element.shadowRoot.querySelector('[data-result]');
82
+
83
+ // Mock .open()
84
+ // Pass string representing input text if testing when user clicks "OK"
85
+ // Pass null if testing when user clicks "Cancel"
86
+ LightningPrompt.open = jest.fn().mockResolvedValue('test value');
87
+ // Initial value
88
+ expect(resultEle.textContent).toBe('unknown');
89
+ // Click modal open button
90
+ buttonEle.click();
91
+
92
+ // Click handler render cycle
93
+ await Promise.resolve();
94
+ // Render cycle triggered by tracked value {result}
95
+ await Promise.resolve();
96
+
97
+ // Verify result is set in the template
98
+ expect(resultEle.textContent).toBe('test value');
99
+ // Open triggered once
100
+ expect(LightningPrompt.open.mock.calls).toHaveLength(1);
101
+ })
102
+ ```
@@ -0,0 +1,7 @@
1
+ .example {
2
+ margin: 0.5rem;
3
+ border-radius: 0.5rem;
4
+ background: #FFF;
5
+ box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.2);
6
+ padding: 1rem;
7
+ }
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <div class="example">
3
+ <button
4
+ aria-haspopup="modal"
5
+ onclick={handlePromptModal}
6
+ >Open the Prompt Modal</button>
7
+ </div>
8
+ </template>
@@ -0,0 +1,15 @@
1
+ import { LightningElement } from 'lwc';
2
+ import LightningPrompt from 'lightning/prompt';
3
+
4
+ export default class PromptBasic extends LightningElement {
5
+ handlePromptModal() {
6
+ LightningPrompt.open({
7
+ message: 'this is the prompt message',
8
+ defaultValue: 'test',
9
+ label: 'Please Respond',
10
+ // use default theme
11
+ }).then((result) => {
12
+ console.log('prompt result', result);
13
+ });
14
+ }
15
+ }
@@ -0,0 +1,81 @@
1
+ .slds-form-element__label {
2
+ overflow-wrap: break-word;
3
+ word-wrap: break-word;
4
+ -webkit-hyphens: auto;
5
+ -ms-hyphens: auto;
6
+ hyphens: auto;
7
+ display: inline-block;
8
+ color: #444444;
9
+ font-size: 0.75rem;
10
+ padding-right: 0.5rem;
11
+ padding-top: 0.25rem;
12
+ margin-bottom: 0.125rem;
13
+ }
14
+ .slds-form-element__label:empty {
15
+ margin: 0;
16
+ }
17
+
18
+ .slds-no-flex {
19
+ -webkit-box-flex: 0;
20
+ -ms-flex: none;
21
+ flex: none;
22
+ }
23
+
24
+ .slds-form-element__control {
25
+ clear: left;
26
+ position: relative;
27
+ }
28
+
29
+ .slds-grow {
30
+ -webkit-box-flex: 1;
31
+ -ms-flex-positive: 1;
32
+ flex-grow: 1;
33
+ }
34
+
35
+ .slds-input {
36
+ padding-top: 0;
37
+ padding-right: var(--slds-c-input-spacing-horizontal-end, var(--sds-c-input-spacing-horizontal-end, 1rem));
38
+ padding-bottom: 0;
39
+ padding-left: var(--slds-c-input-spacing-horizontal-start, var(--sds-c-input-spacing-horizontal-start, 0.75rem));
40
+ width: 100%;
41
+ min-height: calc(1.875rem + (1px * 2));
42
+ line-height: 1.875rem;
43
+ border: 1px solid var(--slds-c-input-color-border, var(--sds-c-input-color-border, #c9c9c9));
44
+ border-radius: var(--slds-c-input-radius-border, var(--sds-c-input-radius-border, 0.25rem));
45
+ background-color: var(--slds-c-input-color-background, var(--sds-c-input-color-background, white));
46
+ color: var(--slds-c-input-text-color, var(--sds-c-input-text-color));
47
+ -webkit-box-shadow: var(--slds-c-input-shadow, var(--sds-c-input-shadow));
48
+ box-shadow: var(--slds-c-input-shadow, var(--sds-c-input-shadow));
49
+ -webkit-transition: border 0.1s linear, background-color 0.1s linear;
50
+ transition: border 0.1s linear, background-color 0.1s linear;
51
+ display: inline-block;
52
+ }
53
+ .slds-input:focus,
54
+ .slds-input:active {
55
+ /*! @css-var-fallback border-color */
56
+ border-color: var(--sds-c-input-color-border-focus, #1b96ff);
57
+ /*! @css-var-fallback background-color */
58
+ background-color: var(
59
+ --sds-c-input-color-background-focus,
60
+ var(--sds-c-input-color-background, white)
61
+ );
62
+ color: var(--sds-c-input-text-color-focus);
63
+ /*! @css-var-fallback box-shadow */
64
+ -webkit-box-shadow: var(--sds-c-input-shadow-focus, 0 0 3px #0176d3);
65
+ box-shadow: var(--sds-c-input-shadow-focus, 0 0 3px #0176d3);
66
+ outline: 0;
67
+ }
68
+
69
+ input {
70
+ line-height: normal;
71
+ color: inherit;
72
+ font: inherit;
73
+ margin: 0;
74
+ }
75
+
76
+ *,
77
+ *:before,
78
+ *:after {
79
+ -webkit-box-sizing: border-box;
80
+ box-sizing: border-box;
81
+ }
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <label class="slds-form-element__label slds-no-flex" for="input">
3
+ {message}
4
+ </label>
5
+ <div class="slds-form-element__control slds-grow">
6
+ <input class="slds-input" id="input" value={defaultValue}/>
7
+ </div>
8
+ </template>
@@ -0,0 +1,92 @@
1
+ import { api } from 'lwc';
2
+ import LightningInteractiveDialogBase from 'lightning/interactiveDialogBase';
3
+ import { parent, instanceName, secure } from 'lightning/overlayUtils';
4
+ import LightningOverlay from 'lightning/overlay';
5
+ import labelDefault from '@salesforce/label/LightningPrompt.defaultLabel';
6
+
7
+ /**
8
+ * Create a prompt modal within your component that asks the
9
+ * user to provide information before they continue.
10
+ */
11
+
12
+ export default class LightningPrompt extends LightningOverlay {
13
+ static [instanceName] = 'lightning-prompt';
14
+ static [parent] = LightningInteractiveDialogBase;
15
+
16
+ /**
17
+ * value to use for header text in "header" variant
18
+ * or aria-label in "headerless" variant
19
+ * @type {string}
20
+ * @default "Prompt" (translated accordingly)
21
+ */
22
+ @api label = labelDefault;
23
+
24
+ /**
25
+ * text to display in modal
26
+ */
27
+ @api message = '';
28
+
29
+ /**
30
+ * default value for input
31
+ */
32
+ @api defaultValue = '';
33
+
34
+ /**
35
+ * variant to use for alert; may be
36
+ * set to "header" or "headerless"
37
+ */
38
+ @api variant = 'header';
39
+
40
+ /**
41
+ * theme to use when variant is "header"
42
+ * valid values are based on SLDS themes and are
43
+ * listed in "themeOptions" of interactiveDialogBase.js
44
+ */
45
+ @api theme = 'default';
46
+
47
+ /**
48
+ * Dispatches privateclose event
49
+ * and closes dialog
50
+ */
51
+ close(result) {
52
+ const promise = new Promise((resolve) => {
53
+ this.dispatchEvent(
54
+ new CustomEvent('privateclose', {
55
+ detail: {
56
+ resolve,
57
+ [secure]: true,
58
+ },
59
+ bubbles: true,
60
+ })
61
+ );
62
+ });
63
+ super.close(result, promise);
64
+ }
65
+
66
+ /**
67
+ * Dispatches privatechildrender event
68
+ * with data parent needs to correctly render
69
+ */
70
+ renderedCallback() {
71
+ const evt = new CustomEvent('privatechildrender', {
72
+ bubbles: true,
73
+ detail: {
74
+ message: this.message,
75
+ label: this.label,
76
+ hideCancel: false,
77
+ showDescription: false,
78
+ getOkValue: this.getOkValue.bind(this),
79
+ getCancelValue: () => null,
80
+ role: 'dialog',
81
+ },
82
+ });
83
+ this.dispatchEvent(evt);
84
+ }
85
+
86
+ getOkValue() {
87
+ if (this.template.querySelector('input')) {
88
+ return this.template.querySelector('input').value;
89
+ }
90
+ return this.defaultValue;
91
+ }
92
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <isExposed>true</isExposed>
4
+ <minApiVersion>54.0</minApiVersion>
5
+ <support>GA</support>
6
+ </LightningComponentBundle>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div role="status" class={computedClass}>
3
- <span if:true={validAlternativeText} class="slds-assistive-text">{alternativeText}</span>
3
+ <span if:true={validAlternativeText} class="slds-assistive-text">{_altText}</span>
4
4
  <div class="slds-spinner__dot-a"></div>
5
5
  <div class="slds-spinner__dot-b"></div>
6
6
  </div>
@@ -27,12 +27,24 @@ export default class LightningSpinner extends LightningElement {
27
27
  */
28
28
  @api variant;
29
29
 
30
+ _altText = '';
31
+
30
32
  connectedCallback() {
31
33
  this.classList.add('slds-spinner_container');
32
34
  this.template.addEventListener('mousewheel', this.stopScrolling);
33
35
  this.template.addEventListener('touchmove', this.stopScrolling);
34
36
  }
35
37
 
38
+ renderedCallback() {
39
+ // [W-10320761] We set the _altText in the next tick because screen readers are not reading out
40
+ // the text when the text along the aria-live container is inserted into the DOM together.
41
+ // It is only working when only aria-live container is setup on load and later the content changes
42
+ // eslint-disable-next-line @lwc/lwc/no-async-operation
43
+ setTimeout(() => {
44
+ this._altText = this.alternativeText;
45
+ }, 0);
46
+ }
47
+
36
48
  get normalizedVariant() {
37
49
  return normalize(this.variant, {
38
50
  fallbackValue: 'base',
@@ -3,7 +3,7 @@ import locale from '@salesforce/i18n/locale';
3
3
  const NA_PHONE_NUMBER = '($1) $2-$3';
4
4
  const IS_TEN_DIGITS = /^\d{10}$/;
5
5
  const TEN_TO_NA = /(\d{3})(\d{3})(\d{4})/;
6
- const IS_ELEVEN_DIGITS = /^1\d{10}/;
6
+ const IS_ELEVEN_DIGITS = /^1\d{10}$/;
7
7
  const ELEVEN_TO_NA = /1(\d{3})(\d{3})(\d{4})$/;
8
8
 
9
9
  // The locale argument has been added for tests since there's currently no clean way of mocking the locale
@@ -1 +0,0 @@
1
- export default 'Close';