lightning-base-components 1.17.3-alpha → 1.17.6-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 (249) hide show
  1. package/metadata/raptor.json +125 -2
  2. package/package.json +17 -1
  3. package/scopedImports/@salesforce-label-LightningInput.mailingAddressFieldsUpdateText.js +1 -0
  4. package/scopedImports/@salesforce-label-LightningToast.genericNavigationAssistiveText.js +1 -0
  5. package/scopedImports/@salesforce-label-LightningToast.macNavigationAssistiveText.js +1 -0
  6. package/src/lightning/ariaObserver/__examples__/connect/connect.html +19 -0
  7. package/src/lightning/ariaObserver/__examples__/connect/connect.js +9 -0
  8. package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.html +3 -0
  9. package/src/lightning/ariaObserver/__examples__/connectChild/connectChild.js +43 -0
  10. package/src/lightning/ariaObserver/ariaObserver.js +16 -2
  11. package/src/lightning/baseCombobox/baseCombobox.js +11 -3
  12. package/src/lightning/baseCombobox/keyboard.js +3 -0
  13. package/src/lightning/breadcrumb/breadcrumb.css +3 -0
  14. package/src/lightning/breadcrumb/breadcrumb.html +1 -1
  15. package/src/lightning/breadcrumb/breadcrumb.slds.css +25 -0
  16. package/src/lightning/breadcrumbs/breadcrumbs.css +3 -0
  17. package/src/lightning/breadcrumbs/breadcrumbs.html +1 -1
  18. package/src/lightning/breadcrumbs/breadcrumbs.slds.css +33 -0
  19. package/src/lightning/button/button.html +2 -1
  20. package/src/lightning/button/button.js +9 -0
  21. package/src/lightning/buttonIcon/button-icon.slds.css +5 -1
  22. package/src/lightning/buttonIcon/buttonIcon.html +2 -1
  23. package/src/lightning/buttonIcon/buttonIcon.js +10 -1
  24. package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +5 -1
  25. package/src/lightning/dualListbox/dual-listbox.slds.css +200 -0
  26. package/src/lightning/dualListbox/dualListbox.css +3 -1
  27. package/src/lightning/dualListbox/dualListbox.html +2 -2
  28. package/src/lightning/dualListbox/dualListbox.js +2 -0
  29. package/src/lightning/dualListbox/form-element.slds.css +232 -0
  30. package/src/lightning/dynamicIcon/dynamic-icon-ellie.slds.css +180 -0
  31. package/src/lightning/dynamicIcon/dynamic-icon-eq.slds.css +63 -0
  32. package/src/lightning/dynamicIcon/dynamic-icon-score.slds.css +46 -0
  33. package/src/lightning/dynamicIcon/dynamic-icon-strength.slds.css +122 -0
  34. package/src/lightning/dynamicIcon/dynamic-icon-trend.slds.css +117 -0
  35. package/src/lightning/dynamicIcon/dynamic-icon-waffle.slds.css +177 -0
  36. package/src/lightning/dynamicIcon/ellie.css +1 -0
  37. package/src/lightning/dynamicIcon/eq.css +1 -0
  38. package/src/lightning/dynamicIcon/score.css +1 -0
  39. package/src/lightning/dynamicIcon/strength.css +1 -0
  40. package/src/lightning/dynamicIcon/trend.css +1 -0
  41. package/src/lightning/dynamicIcon/waffle.css +1 -0
  42. package/src/lightning/f6Controller/f6Controller.js +382 -0
  43. package/src/lightning/f6Controller/f6Controller.js-meta.xml +4 -0
  44. package/src/lightning/formattedRichText/formattedRichText.js +4 -3
  45. package/src/lightning/helptext/form-element.slds.css +232 -0
  46. package/src/lightning/helptext/help-text.slds.css +5 -1
  47. package/src/lightning/helptext/helptext.css +2 -1
  48. package/src/lightning/helptext/helptext.html +1 -0
  49. package/src/lightning/helptext/helptext.js +9 -0
  50. package/src/lightning/iconSvgTemplates/buildTemplates/standard/bill_of_materials.html +7 -0
  51. package/src/lightning/iconSvgTemplates/buildTemplates/standard/buyer_group_qualifier.html +8 -0
  52. package/src/lightning/iconSvgTemplates/buildTemplates/standard/datashare_target.html +9 -0
  53. package/src/lightning/iconSvgTemplates/buildTemplates/standard/datashares.html +7 -0
  54. package/src/lightning/iconSvgTemplates/buildTemplates/standard/disclosure_and_compliance.html +8 -0
  55. package/src/lightning/iconSvgTemplates/buildTemplates/standard/document_preview.html +7 -0
  56. package/src/lightning/iconSvgTemplates/buildTemplates/standard/facility_bed.html +7 -0
  57. package/src/lightning/iconSvgTemplates/buildTemplates/standard/market.html +8 -0
  58. package/src/lightning/iconSvgTemplates/buildTemplates/standard/mulesoft.html +8 -0
  59. package/src/lightning/iconSvgTemplates/buildTemplates/standard/price_sheet.html +7 -0
  60. package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
  61. package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +34 -1
  62. package/src/lightning/iconSvgTemplates/buildTemplates/utility/add_source.html +7 -0
  63. package/src/lightning/iconSvgTemplates/buildTemplates/utility/app_web_messaging.html +7 -0
  64. package/src/lightning/iconSvgTemplates/buildTemplates/utility/bookmark_stroke.html +7 -0
  65. package/src/lightning/iconSvgTemplates/buildTemplates/utility/buyer_group_qualifier.html +8 -0
  66. package/src/lightning/iconSvgTemplates/buildTemplates/utility/document_preview.html +7 -0
  67. package/src/lightning/iconSvgTemplates/buildTemplates/utility/expired.html +7 -0
  68. package/src/lightning/iconSvgTemplates/buildTemplates/utility/favorite_alt.html +7 -0
  69. package/src/lightning/iconSvgTemplates/buildTemplates/utility/heart.html +7 -0
  70. package/src/lightning/iconSvgTemplates/buildTemplates/utility/hourglass.html +7 -0
  71. package/src/lightning/iconSvgTemplates/buildTemplates/utility/integration.html +8 -0
  72. package/src/lightning/iconSvgTemplates/buildTemplates/utility/market.html +8 -0
  73. package/src/lightning/iconSvgTemplates/buildTemplates/utility/more.html +7 -0
  74. package/src/lightning/iconSvgTemplates/buildTemplates/utility/mulesoft.html +8 -0
  75. package/src/lightning/iconSvgTemplates/buildTemplates/utility/notification_off.html +7 -0
  76. package/src/lightning/iconSvgTemplates/buildTemplates/utility/notification_snoozed.html +9 -0
  77. package/src/lightning/iconSvgTemplates/buildTemplates/utility/profile_alt.html +7 -0
  78. package/src/lightning/iconSvgTemplates/buildTemplates/utility/promotion_tiers.html +10 -0
  79. package/src/lightning/iconSvgTemplates/buildTemplates/utility/sender_email.html +7 -0
  80. package/src/lightning/iconSvgTemplates/buildTemplates/utility/service_appointment.html +13 -0
  81. package/src/lightning/iconSvgTemplates/buildTemplates/utility/service_report.html +8 -0
  82. package/src/lightning/iconSvgTemplates/buildTemplates/utility/toggle_off.html +7 -0
  83. package/src/lightning/iconSvgTemplates/buildTemplates/utility/toggle_on.html +7 -0
  84. package/src/lightning/iconSvgTemplates/buildTemplates/utility/your_account.html +10 -0
  85. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/bill_of_materials.html +7 -0
  86. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/buyer_group_qualifier.html +8 -0
  87. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/datashare_target.html +9 -0
  88. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/datashares.html +7 -0
  89. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/disclosure_and_compliance.html +8 -0
  90. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/document_preview.html +7 -0
  91. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/facility_bed.html +7 -0
  92. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/market.html +8 -0
  93. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/mulesoft.html +8 -0
  94. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/price_sheet.html +7 -0
  95. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
  96. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +34 -1
  97. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/add_source.html +7 -0
  98. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/app_web_messaging.html +7 -0
  99. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/bookmark_stroke.html +7 -0
  100. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/buyer_group_qualifier.html +8 -0
  101. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/document_preview.html +7 -0
  102. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/expired.html +7 -0
  103. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/favorite_alt.html +7 -0
  104. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/heart.html +7 -0
  105. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/hourglass.html +7 -0
  106. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/integration.html +8 -0
  107. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/market.html +8 -0
  108. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/more.html +7 -0
  109. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/mulesoft.html +8 -0
  110. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/notification_off.html +7 -0
  111. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/notification_snoozed.html +9 -0
  112. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/profile_alt.html +7 -0
  113. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/promotion_tiers.html +10 -0
  114. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/sender_email.html +7 -0
  115. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/service_appointment.html +13 -0
  116. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/service_report.html +8 -0
  117. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/toggle_off.html +7 -0
  118. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/toggle_on.html +7 -0
  119. package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/your_account.html +10 -0
  120. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/bill_of_materials.html +7 -0
  121. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/buyer_group_qualifier.html +8 -0
  122. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/datashare_target.html +9 -0
  123. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/datashares.html +7 -0
  124. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/disclosure_and_compliance.html +8 -0
  125. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/document_preview.html +7 -0
  126. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/facility_bed.html +7 -0
  127. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/market.html +8 -0
  128. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/mulesoft.html +8 -0
  129. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/price_sheet.html +7 -0
  130. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
  131. package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +11 -1
  132. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/bill_of_materials.html +7 -0
  133. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/buyer_group_qualifier.html +8 -0
  134. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/datashare_target.html +9 -0
  135. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/datashares.html +7 -0
  136. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/disclosure_and_compliance.html +8 -0
  137. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/document_preview.html +7 -0
  138. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/facility_bed.html +7 -0
  139. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/market.html +8 -0
  140. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/mulesoft.html +8 -0
  141. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/price_sheet.html +7 -0
  142. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
  143. package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +11 -1
  144. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +24 -1
  145. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/add_source.html +7 -0
  146. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/app_web_messaging.html +7 -0
  147. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/bookmark_stroke.html +7 -0
  148. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/buyer_group_qualifier.html +8 -0
  149. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/document_preview.html +7 -0
  150. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/expired.html +7 -0
  151. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/favorite_alt.html +7 -0
  152. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/heart.html +7 -0
  153. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/hourglass.html +7 -0
  154. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/integration.html +8 -0
  155. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/market.html +8 -0
  156. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/more.html +7 -0
  157. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/mulesoft.html +8 -0
  158. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/notification_off.html +7 -0
  159. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/notification_snoozed.html +9 -0
  160. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/profile_alt.html +7 -0
  161. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/promotion_tiers.html +10 -0
  162. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/sender_email.html +7 -0
  163. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/service_appointment.html +13 -0
  164. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/service_report.html +8 -0
  165. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/toggle_off.html +7 -0
  166. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/toggle_on.html +7 -0
  167. package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/your_account.html +10 -0
  168. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +24 -1
  169. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/add_source.html +7 -0
  170. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/app_web_messaging.html +7 -0
  171. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/bookmark_stroke.html +7 -0
  172. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/buyer_group_qualifier.html +8 -0
  173. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/document_preview.html +7 -0
  174. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/expired.html +7 -0
  175. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/favorite_alt.html +7 -0
  176. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/heart.html +7 -0
  177. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/hourglass.html +7 -0
  178. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/integration.html +8 -0
  179. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/market.html +8 -0
  180. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/more.html +7 -0
  181. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/mulesoft.html +8 -0
  182. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/notification_off.html +7 -0
  183. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/notification_snoozed.html +9 -0
  184. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/profile_alt.html +7 -0
  185. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/promotion_tiers.html +10 -0
  186. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/sender_email.html +7 -0
  187. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/service_appointment.html +13 -0
  188. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/service_report.html +8 -0
  189. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/toggle_off.html +7 -0
  190. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/toggle_on.html +7 -0
  191. package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/your_account.html +10 -0
  192. package/src/lightning/input/input-text.slds.css +1 -1
  193. package/src/lightning/input/input.html +3 -3
  194. package/src/lightning/input/input.js +38 -2
  195. package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -0
  196. package/src/lightning/inputAddress/inputAddress.html +1 -0
  197. package/src/lightning/inputAddress/inputAddress.js +6 -0
  198. package/src/lightning/modal/__examples__disabled/allform/allform.html +1 -1
  199. package/src/lightning/modal/__examples__disabled/allform/allform.js +1 -1
  200. package/src/lightning/modal/__examples__disabled/allformfull/allformfull.css +7 -0
  201. package/src/lightning/modal/__examples__disabled/allformfull/allformfull.html +9 -0
  202. package/src/lightning/modal/__examples__disabled/allformfull/allformfull.js +49 -0
  203. package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.css +3 -0
  204. package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.html +146 -0
  205. package/src/lightning/modal/__examples__disabled/demoallformfull/demoallformfull.js +240 -0
  206. package/src/lightning/modalBase/modalBase.css +1 -1
  207. package/src/lightning/modalBase/modalBase.html +2 -2
  208. package/src/lightning/modalBase/modalBase.js +199 -45
  209. package/src/lightning/modalBody/modalBody.js +133 -18
  210. package/src/lightning/modalFooter/modalFooter.js +57 -1
  211. package/src/lightning/navigation/__docs__/navigation.md +1 -1
  212. package/src/lightning/popup/popover.slds.css +121 -0
  213. package/src/lightning/popup/popup.css +3 -0
  214. package/src/lightning/positionLibrary/direction.js +10 -17
  215. package/src/lightning/primitiveBubble/primitiveBubble.js +16 -1
  216. package/src/lightning/select/__docs__/select.md +9 -0
  217. package/src/lightning/select/__examples__/disabled/disabled.html +10 -0
  218. package/src/lightning/select/__examples__/disabled/disabled.js +27 -0
  219. package/src/lightning/select/__examples__/hidden/hidden.html +10 -0
  220. package/src/lightning/select/__examples__/hidden/hidden.js +27 -0
  221. package/src/lightning/select/__examples__/inline/inline.html +10 -0
  222. package/src/lightning/select/__examples__/inline/inline.js +27 -0
  223. package/src/lightning/select/form-element.slds.css +232 -0
  224. package/src/lightning/select/select.css +3 -0
  225. package/src/lightning/select/select.html +2 -2
  226. package/src/lightning/select/select.js +3 -0
  227. package/src/lightning/select/select.slds.css +398 -0
  228. package/src/lightning/showToastEvent/showToastEvent.js +21 -0
  229. package/src/lightning/showToastEvent/showToastEvent.js-meta.xml +4 -0
  230. package/src/lightning/sldsCommon/sldsCommon.css +21 -4
  231. package/src/lightning/toast/__docs__/toast.md +103 -0
  232. package/src/lightning/toast/toast.css +52 -0
  233. package/src/lightning/toast/toast.html +70 -0
  234. package/src/lightning/toast/toast.js +608 -0
  235. package/src/lightning/toast/toast.js-meta.xml +4 -0
  236. package/src/lightning/toastContainer/__docs__/toastContainer.md +59 -0
  237. package/src/lightning/toastContainer/toastContainer.css +32 -0
  238. package/src/lightning/toastContainer/toastContainer.html +9 -0
  239. package/src/lightning/toastContainer/toastContainer.js +471 -0
  240. package/src/lightning/toastContainer/toastContainer.js-meta.xml +6 -0
  241. package/src/lightning/tooltipLibrary/tooltipLibrary.js +82 -19
  242. package/src/lightning/treeGrid/__docs__/treeGrid.md +4 -3
  243. package/src/lightning/utilsPrivate/url.js +2 -1
  244. package/src/lightning/verticalNavigation/vertical-navigation.slds.css +4 -0
  245. package/src/lightning/verticalNavigation/verticalNavigation.css +1 -0
  246. package/src/lightning/verticalNavigation/verticalNavigation.html +1 -1
  247. package/src/lightning/verticalNavigationSection/vertical-navigation-section.slds.css +19 -0
  248. package/src/lightning/verticalNavigationSection/verticalNavigationSection.css +2 -0
  249. package/src/lightning/verticalNavigationSection/verticalNavigationSection.html +1 -1
@@ -18,6 +18,11 @@ import closeButtonAltText from '@salesforce/label/LightningModalBase.cancelandcl
18
18
  import disableCloseBtnMessage from '@salesforce/label/LightningModalBase.waitstate';
19
19
 
20
20
  const DEBOUNCE_RESIZE = 300;
21
+ const SMALL_SCREEN_SIZE = 767;
22
+ const SIZE_SMALL = 'small';
23
+ const SIZE_MEDIUM = 'medium';
24
+ const SIZE_LARGE = 'large';
25
+ const SIZE_FULL = 'full';
21
26
 
22
27
  export default class LightningModalBase extends LightningElement {
23
28
  // this is visible in DOM, changed from 'lightning-modal-base'
@@ -26,12 +31,15 @@ export default class LightningModalBase extends LightningElement {
26
31
  // private tracked state
27
32
  initialRender = true;
28
33
  autoFocusCompletedOnce = false;
29
- windowResizeEventsBound = false;
30
34
  timeoutId = 0;
31
35
  disableCloseButton = false;
32
36
  sectionAriaBusy = null;
33
37
  closeButtonAltText = closeButtonAltText;
34
38
  disableCloseBtnMessage = disableCloseBtnMessage;
39
+ isModalClosing = false;
40
+ // screen size private tracked state
41
+ isSmallScreenSize = null;
42
+
35
43
  // modalHeader, child
36
44
  headerRegistered = false;
37
45
  headerHeight = 0;
@@ -51,6 +59,11 @@ export default class LightningModalBase extends LightningElement {
51
59
  baseUpdateBodyCallback = null;
52
60
  bodyResizeScheduled = false;
53
61
  bodyTabElemRef = null;
62
+ // eventing state utilized when modalBody present
63
+ windowResizeEventBound = false;
64
+ windowOrientationEventBound = false;
65
+ portraitMatchMedia = null;
66
+ screenOrientationChangeHandler = null;
54
67
 
55
68
  // modalFooter, child
56
69
  footerRegistered = false;
@@ -70,7 +83,6 @@ export default class LightningModalBase extends LightningElement {
70
83
  // modal features
71
84
  isModalOpen = false;
72
85
  isModalTransitioningIn = false;
73
- _size = 'medium';
74
86
  // modal background elements
75
87
  savedInertElements = [];
76
88
  // before modal opened, element previously focused
@@ -103,12 +115,12 @@ export default class LightningModalBase extends LightningElement {
103
115
 
104
116
  /**
105
117
  * Get the current modal size, calculated as a percentage of the viewport.
106
- * Valid values are small, medium, and large. The default is medium.
118
+ * Valid values are small, medium, large, and full. The default is medium.
107
119
  * @type {string}
108
120
  * @default medium
109
121
  */
110
122
  get size() {
111
- const sizeDefault = 'medium';
123
+ const sizeDefault = SIZE_MEDIUM;
112
124
  const modal = this.modal;
113
125
  if (!modal) {
114
126
  return sizeDefault;
@@ -116,7 +128,7 @@ export default class LightningModalBase extends LightningElement {
116
128
  // get the size value from <lightning-modal>
117
129
  return normalizeString(modal.size, {
118
130
  fallbackValue: sizeDefault,
119
- validValues: ['small', 'medium', 'large'],
131
+ validValues: [SIZE_FULL, SIZE_SMALL, SIZE_MEDIUM, SIZE_LARGE],
120
132
  });
121
133
  }
122
134
 
@@ -252,13 +264,16 @@ export default class LightningModalBase extends LightningElement {
252
264
  * @returns {number}
253
265
  * @private
254
266
  */
255
- get backdropHeight() {
267
+ get backdropDimensions() {
256
268
  const backdropElem = this.modalBackdrop;
257
269
  const backdropRect = backdropElem
258
270
  ? backdropElem.getBoundingClientRect()
259
271
  : {};
260
- const { height } = backdropRect;
261
- return height || 0;
272
+ const { height, width } = backdropRect;
273
+ return {
274
+ height: height || 0,
275
+ width: width || 0,
276
+ };
262
277
  }
263
278
 
264
279
  /**
@@ -287,9 +302,10 @@ export default class LightningModalBase extends LightningElement {
287
302
  }
288
303
  // don't add animation related css classes in this group
289
304
  classes.add({
290
- 'slds-modal_medium': sizeClass === 'medium',
291
- 'slds-modal_large': sizeClass === 'large',
292
- 'slds-modal_small': sizeClass === 'small',
305
+ 'slds-modal_full': sizeClass === SIZE_FULL,
306
+ 'slds-modal_medium': sizeClass === SIZE_MEDIUM,
307
+ 'slds-modal_large': sizeClass === SIZE_LARGE,
308
+ 'slds-modal_small': sizeClass === SIZE_SMALL,
293
309
  });
294
310
  return classes.toString();
295
311
  }
@@ -316,6 +332,39 @@ export default class LightningModalBase extends LightningElement {
316
332
  return classes.toString();
317
333
  }
318
334
 
335
+ /**
336
+ * Compute the correct lightning-button-icon CSS class to use
337
+ * for the size="full" behaviors, based upon the screen size
338
+ * threshold. Two classes are added for full screen behavior
339
+ * to handle edge cases where customers change background of the
340
+ * modal header so the close button maintains visibility for a11y
341
+ * @private
342
+ */
343
+ get computedCloseButtonCssClass() {
344
+ let classes = classSet('slds-modal__close');
345
+ const fullScreenActive =
346
+ this.isSmallScreenSize && this.size === SIZE_FULL;
347
+ classes.add({
348
+ 'slds-button_icon-border-filled': fullScreenActive,
349
+ 'slds-modal_full-close-button': fullScreenActive,
350
+ });
351
+ return classes.toString();
352
+ }
353
+
354
+ /**
355
+ * Compute the correct lightning-button-icon variant to use
356
+ * for the size="full" behaviors, based upon the screen size
357
+ * threshold. Important to maintain existing close button behavior
358
+ * when size 'small', 'medium' and 'large' close button variant
359
+ * when 'isSmallScreenSize = true' for a11y purposes
360
+ * @private
361
+ */
362
+ get computedCloseButtonVariant() {
363
+ return this.isSmallScreenSize && this.size === SIZE_FULL
364
+ ? 'bare'
365
+ : 'bare-inverse';
366
+ }
367
+
319
368
  /**
320
369
  * Saves the current active focused element on modal creation
321
370
  * in order to be able to set focus back to that previous element
@@ -492,8 +541,11 @@ export default class LightningModalBase extends LightningElement {
492
541
  [ARIA.LABEL]: label,
493
542
  });
494
543
  } else {
495
- // in headless variant, must have label value set
496
- this.unsetAriaLabelAndError();
544
+ // in headless variant, must have label value set, unless the modal
545
+ // is actively closing
546
+ if (!this.isModalClosing) {
547
+ this.unsetAriaLabelAndError();
548
+ }
497
549
  }
498
550
  }
499
551
  }
@@ -530,6 +582,10 @@ export default class LightningModalBase extends LightningElement {
530
582
  console.error('Invalid access to privateclose event');
531
583
  return;
532
584
  }
585
+
586
+ // set isModalClosing boolean, to prevent intentional error
587
+ // when checking for presence of api 'label' value
588
+ this.isModalClosing = true;
533
589
  if (hasAnimation()) {
534
590
  /// triggers the disappearance of the foreground modal elements
535
591
  this.modalWrapper.classList.remove('slds-fade-in-open');
@@ -542,6 +598,17 @@ export default class LightningModalBase extends LightningElement {
542
598
  // skip animation, resolve immediately
543
599
  e.detail.resolve();
544
600
  }
601
+ // disconnectedCallback doesn't get called on .close()
602
+ // unregistering child components
603
+ if (this.headerRegistered && this.unregisterHeader) {
604
+ this.unregisterHeader();
605
+ }
606
+ if (this.bodyRegistered && this.unregisterBody) {
607
+ this.unregisterBody();
608
+ }
609
+ if (this.footerRegistered && this.unregisterFooter) {
610
+ this.unregisterFooter();
611
+ }
545
612
  this.closeModal();
546
613
  }
547
614
 
@@ -678,7 +745,7 @@ export default class LightningModalBase extends LightningElement {
678
745
  // FUTURE TODO mechanism to support aria-describedby
679
746
  // aria-describedby is optional, without a good reproducible pattern
680
747
  this.initBodyState();
681
- this.detachBodyResizeEvents();
748
+ this.removeWindowResizeEventListener();
682
749
  }
683
750
 
684
751
  /**
@@ -707,11 +774,14 @@ export default class LightningModalBase extends LightningElement {
707
774
  });
708
775
  // cover case if modalBody is removed, then added back
709
776
  // required to correctly set the CSS classes on modalBody
710
- this.updateBodyHeight();
777
+ this.updateModalBodyHeight();
711
778
 
712
779
  // ModalBody can register 2+ times when initially rendering
713
- if (!this.windowResizeEventsBound) {
714
- this.bindBodyResizeEvents();
780
+ if (!this.windowResizeEventBound) {
781
+ this.addWindowResizeEventListener();
782
+ }
783
+ if (!this.windowOrientationEventBound) {
784
+ this.addOrientationChangeListener();
715
785
  }
716
786
  }
717
787
 
@@ -738,6 +808,7 @@ export default class LightningModalBase extends LightningElement {
738
808
  this.baseUpdateBodyCallback = null;
739
809
  this.bodyResizeScheduled = false;
740
810
  this.bodyTabElemRef = null;
811
+ this.removeModalEventListeners();
741
812
  }
742
813
 
743
814
  /**
@@ -781,7 +852,7 @@ export default class LightningModalBase extends LightningElement {
781
852
  });
782
853
  // update modalBody max-height values
783
854
  if (this.bodyRegistered) {
784
- this.updateBodyHeight();
855
+ this.updateModalBodyHeight();
785
856
  }
786
857
  }
787
858
 
@@ -847,7 +918,7 @@ export default class LightningModalBase extends LightningElement {
847
918
  });
848
919
  // update modalBody max-height values
849
920
  if (this.bodyRegistered) {
850
- this.updateBodyHeight();
921
+ this.updateModalBodyHeight();
851
922
  }
852
923
  }
853
924
 
@@ -884,7 +955,7 @@ export default class LightningModalBase extends LightningElement {
884
955
  */
885
956
  get modalResizing() {
886
957
  if (!this._resizing) {
887
- this._resizing = this.scheduleResize.bind(this);
958
+ this._resizing = this.scheduleWindowResizeEvent.bind(this);
888
959
  }
889
960
  return this._resizing;
890
961
  }
@@ -896,13 +967,16 @@ export default class LightningModalBase extends LightningElement {
896
967
  * the window.onresize event fires
897
968
  * @private
898
969
  */
899
- updateBodyHeight() {
970
+ updateModalBodyHeight() {
900
971
  clearTimeout(this.timeoutId);
901
972
  this.timeoutId = 0;
902
973
  const { bodyResizeScheduled, bodyRegistered, baseUpdateBodyCallback } =
903
974
  this;
904
975
 
905
976
  if (bodyRegistered && !bodyResizeScheduled) {
977
+ // check, and update isSmallScreenSize before
978
+ // callback to modalBody
979
+ this.setIsSmallScreenSize();
906
980
  // eslint-disable-next-line @lwc/lwc/no-async-operation
907
981
  requestAnimationFrame(() => {
908
982
  this.bodyResizeScheduled = false;
@@ -910,7 +984,11 @@ export default class LightningModalBase extends LightningElement {
910
984
  const values = {
911
985
  footerHeight: this.footerHeight || 0,
912
986
  headerHeight: this.headerHeight || 0,
913
- backdropHeight: this.backdropHeight,
987
+ // backdrop values can be used as proxies for screen width / height
988
+ backdropHeight: this.backdropDimensions.height,
989
+ backdropWidth: this.backdropDimensions.width,
990
+ sizeSetFull: this.size === SIZE_FULL,
991
+ isSmallScreenSize: this.isSmallScreenSize,
914
992
  };
915
993
  baseUpdateBodyCallback(values);
916
994
  }
@@ -924,11 +1002,11 @@ export default class LightningModalBase extends LightningElement {
924
1002
  * from being fired every time window.onresize event fires
925
1003
  * @private
926
1004
  */
927
- scheduleResize() {
1005
+ scheduleWindowResizeEvent() {
928
1006
  if (this.timeoutId === 0) {
929
1007
  // eslint-disable-next-line @lwc/lwc/no-async-operation
930
1008
  this.timeoutId = setTimeout(() => {
931
- this.updateBodyHeight();
1009
+ this.updateModalBodyHeight();
932
1010
  }, DEBOUNCE_RESIZE);
933
1011
  }
934
1012
  }
@@ -937,18 +1015,20 @@ export default class LightningModalBase extends LightningElement {
937
1015
  * Event handler for window.onresize event
938
1016
  * @private
939
1017
  */
940
- handleWindowResize = () => {
941
- this.scheduleResize();
1018
+ handleWindowResizeEvent = () => {
1019
+ this.scheduleWindowResizeEvent();
942
1020
  };
943
1021
 
944
1022
  /**
945
- * Bind window.onresize event listener when modalBody is present
1023
+ * Add window 'resize' event listener when modalBody is present
1024
+ * this only gets used by modalBody, so only gets wired up when
1025
+ * registerBody function called
946
1026
  * @private
947
1027
  */
948
- bindBodyResizeEvents() {
949
- if (window && !this.windowResizeEventsBound) {
950
- window.addEventListener('resize', this.handleWindowResize);
951
- this.windowResizeEventsBound = true;
1028
+ addWindowResizeEventListener() {
1029
+ if (window && !this.windowResizeEventBound) {
1030
+ window.addEventListener('resize', this.handleWindowResizeEvent);
1031
+ this.windowResizeEventBound = true;
952
1032
  }
953
1033
  }
954
1034
 
@@ -956,26 +1036,87 @@ export default class LightningModalBase extends LightningElement {
956
1036
  * Detach window.onresize event listener when modalBody is removed
957
1037
  * @private
958
1038
  */
959
- detachBodyResizeEvents() {
960
- if (window) {
961
- window.removeEventListener('resize', this.handleWindowResize);
1039
+ removeWindowResizeEventListener() {
1040
+ if (window && this.windowResizeEventBound) {
1041
+ window.removeEventListener('resize', this.handleWindowResizeEvent);
962
1042
  clearTimeout(this.timeoutId);
963
1043
  this.timeoutId = 0;
964
- this.windowResizeEventsBound = false;
1044
+ this.windowResizeEventBound = false;
1045
+ }
1046
+ }
1047
+
1048
+ /**
1049
+ * Remove screen orientation 'change' listener
1050
+ * @private
1051
+ */
1052
+ removeOrientationChangeListener() {
1053
+ // TODO START HERE, check for this.windowOrientationEventBound === true
1054
+ if (this.portraitMatchMedia) {
1055
+ this.portraitMatchMedia.removeEventListener(
1056
+ 'change',
1057
+ this.screenOrientationChangeHandler
1058
+ );
1059
+ this.portraitMatchMedia = null;
1060
+ this.windowOrientationEventBound = false;
1061
+ }
1062
+ if (this.screenOrientationChangeHandler) {
1063
+ this.screenOrientationChangeHandler = null;
1064
+ }
1065
+ }
1066
+
1067
+ /**
1068
+ * Add screen orientation 'change' listener.
1069
+ * orientation changes: 'portrait' -> 'landscape' -> 'portrait'
1070
+ */
1071
+ addOrientationChangeListener() {
1072
+ this.portraitMatchMedia = window.matchMedia('(orientation: portrait)');
1073
+ this.screenOrientationChangeHandler =
1074
+ this.handleWindowResizeEvent.bind(this);
1075
+ if (typeof this.portraitMatchMedia === 'function') {
1076
+ this.portraitMatchMedia.addEventListener(
1077
+ 'change',
1078
+ this.screenOrientationChangeHandler
1079
+ );
1080
+ this.windowOrientationEventBound = true;
965
1081
  }
966
1082
  }
967
1083
 
1084
+ /**
1085
+ * determine if the current screen is less than SMALL_SCREEN_SIZE
1086
+ * for Modal, screen size detection is simplified to what's required
1087
+ * for the size="full" feature addition, which is a single breakpoint
1088
+ * either (a) at or below 767 pixels (small = full screen modal behavior),
1089
+ * or (b) at or above 768 (large = default modal behavior)
1090
+ * @private
1091
+ */
1092
+ setIsSmallScreenSize() {
1093
+ const docElem = (document && document.documentElement) || null;
1094
+ const browserWidth = docElem ? docElem.clientWidth : window.innerWidth;
1095
+ const isSmallScreenSize = browserWidth <= SMALL_SCREEN_SIZE;
1096
+ if (isSmallScreenSize !== this.isSmallScreenSize) {
1097
+ this.isSmallScreenSize = isSmallScreenSize;
1098
+ }
1099
+ }
1100
+
1101
+ removeModalEventListeners() {
1102
+ this.removeWindowResizeEventListener();
1103
+ this.removeOrientationChangeListener();
1104
+ }
1105
+
968
1106
  /**
969
1107
  * When modal is being created, initialize
970
- * private tracked modal state
1108
+ * private tracked modal base/default state
1109
+ * this is a collection of state variables
1110
+ * that are not including modalHeader, modalBody,
1111
+ * modalFooter
971
1112
  * @private
972
1113
  */
973
- initState() {
1114
+ initBaseState() {
974
1115
  // setting initialRender true handles the case where modal
975
1116
  // is added / removed/added back to DOM
976
1117
  this.initialRender = true;
977
1118
  this.autoFocusCompletedOnce = false;
978
- this.windowResizeEventsBound = false;
1119
+ this.windowResizeEventBound = false;
979
1120
  this.timeoutId = 0;
980
1121
  this.disableCloseButton = false;
981
1122
  this.modalLabel = null;
@@ -983,24 +1124,37 @@ export default class LightningModalBase extends LightningElement {
983
1124
  this.modalDescribedBy = null;
984
1125
  this.showAriaLiveMessage = false;
985
1126
  this.ariaLiveMessage = '';
986
- this._size = 'medium';
987
1127
  this.savedInertElements = [];
988
1128
  this.savedActiveElement = null;
989
1129
  this.isModalOpen = false;
990
1130
  this.isModalTransitioningIn = false;
1131
+ this.isModalClosing = false;
1132
+ // browser screen size
1133
+ this.isSmallScreenSize = null;
991
1134
  }
992
1135
 
993
- connectedCallback() {
994
- this.initState();
1136
+ /**
1137
+ * Reset all modal state
1138
+ * @private
1139
+ */
1140
+ initModalState() {
1141
+ this.initBaseState();
995
1142
  this.initHeaderState();
996
1143
  this.initBodyState();
997
1144
  this.initFooterState();
998
1145
  }
999
1146
 
1147
+ connectedCallback() {
1148
+ this.initModalState();
1149
+ // check for screen size right away
1150
+ // not adding event listeners here,
1151
+ // as 'resize' and 'orientation' events
1152
+ // are utilized by modalBody, see registerBody()
1153
+ this.setIsSmallScreenSize();
1154
+ }
1155
+
1000
1156
  disconnectedCallback() {
1001
- if (this.windowResizeEventsBound) {
1002
- this.detachBodyResizeEvents();
1003
- }
1157
+ this.removeModalEventListeners();
1004
1158
  this.closeModal();
1005
1159
  }
1006
1160
 
@@ -1021,6 +1175,6 @@ export default class LightningModalBase extends LightningElement {
1021
1175
  this.focusFirstElement();
1022
1176
  }
1023
1177
  }
1024
- this.updateBodyHeight();
1178
+ this.updateModalBodyHeight();
1025
1179
  }
1026
1180
  }
@@ -114,34 +114,149 @@ export default class LightningModalBody extends LightningElement {
114
114
  return firstElem;
115
115
  }
116
116
 
117
+ /**
118
+ * Determine how much usuable screen height the modal has available
119
+ * @param {object} values passed from modalBase to modalBody
120
+ * representing height and width values of header, footer, and body
121
+ * @return {object} values, after adding of modalUsableHeight
122
+ * @private
123
+ */
124
+ calculateModalUsableHeight(values) {
125
+ const { backdropHeight, paddingTop, paddingBottom } = values;
126
+ const modalUsableHeight = backdropHeight - paddingTop - paddingBottom;
127
+ values.modalUsableHeight = modalUsableHeight;
128
+ return values;
129
+ }
130
+
131
+ /**
132
+ * Determine how much usuable height modalBody has available
133
+ * @param {object} values passed from modalBase to modalBody
134
+ * representing height and width values of header, footer, and body
135
+ * @return {number} calculation of modal body usable height
136
+ * @private
137
+ */
138
+ calculateModalBodyUsableHeight({
139
+ modalUsableHeight,
140
+ headerHeight,
141
+ footerHeight,
142
+ }) {
143
+ return modalUsableHeight - headerHeight - footerHeight;
144
+ }
145
+
146
+ /**
147
+ * Based on initial values, calculate min/max height style values
148
+ * to set on modalBody for correct display of content, and scrollability
149
+ * @param {object} values passed from modalBase to modalBody,
150
+ * @param {boolean} shouldUseFullHeight boolean to determine if full
151
+ * height of screen should be used
152
+ * representing height and width values of header, footer, and body
153
+ * @return {object} values, after adding of modalUsableHeight
154
+ * @private
155
+ */
156
+ updateModalBodyHeightValues(values, shouldUseFullHeight) {
157
+ const { modalBodyMinHeight } = values;
158
+ // first have to calculate the correct values
159
+ const updatedValues = this.calculateModalUsableHeight(values);
160
+ const modalBodyUsableHeight =
161
+ this.calculateModalBodyUsableHeight(updatedValues);
162
+ // update values with calculated values
163
+ values.modalBodyUsableHeight = modalBodyUsableHeight;
164
+ values.maxModalBodyHeightStyle = `${modalBodyUsableHeight}px`;
165
+ // need to adjust minHeight, to force modal to use full height
166
+ // of user screen
167
+ values.minModalBodyHeightStyle = shouldUseFullHeight
168
+ ? `${modalBodyUsableHeight}px`
169
+ : `${modalBodyMinHeight}px`;
170
+ return values;
171
+ }
172
+
173
+ /**
174
+ * Set modal body height style values after calculating the correcting values to assign
175
+ * @param {object} values Provided height, width values from handleUpdateHeight
176
+ * @private
177
+ */
178
+ setModalBodyHeight(values, shouldUseFullHeight) {
179
+ const { maxModalBodyHeightStyle, minModalBodyHeightStyle } =
180
+ this.updateModalBodyHeightValues(values, shouldUseFullHeight);
181
+ const divElem = this.contentElem;
182
+ const styles = {
183
+ maxHeight: maxModalBodyHeightStyle,
184
+ minHeight: minModalBodyHeightStyle,
185
+ };
186
+ // set the max and min height value on modal body wrapper div
187
+ Object.assign(divElem.style, styles);
188
+ }
189
+
190
+ /**
191
+ * Update values based on whether size="full" behavior should be full screen (small)
192
+ * or less than full screen (large)
193
+ * @param {Boolean} shouldUseFullHeight Whether full height of screen should be used
194
+ * @param {object} values Provided height, width values from handleUpdateHeight
195
+ * @returns {object} updatedValues based on full screen or default strategy used
196
+ * @private
197
+ */
198
+ updateValues(shouldUseFullHeight, values) {
199
+ const { headerHeight, footerHeight, backdropHeight } = values;
200
+ const MODAL_BODY_MIN_HEIGHT = 80;
201
+ // Full screen size constants
202
+ // positioning values of body and footer are effected
203
+ // by modalHeader presence (headless)
204
+ const PAD_TOP_FULL = 48;
205
+ const PAD_BOTTOM_FULL = 1;
206
+ // default screen behavior (original modal behavior)
207
+ const PAD_TOP_DEFAULT = 48;
208
+ const PAD_BOTTOM_DEFAULT = 80;
209
+ // use of Math.floor for some values returning half pixel values
210
+ // for example headerHeight = 505.5px
211
+ const updatedValues = {
212
+ headerHeight: Math.floor(headerHeight),
213
+ footerHeight: Math.floor(footerHeight),
214
+ backdropHeight: Math.floor(backdropHeight),
215
+ paddingTop: shouldUseFullHeight ? PAD_TOP_FULL : PAD_TOP_DEFAULT,
216
+ paddingBottom: shouldUseFullHeight
217
+ ? PAD_BOTTOM_FULL
218
+ : PAD_BOTTOM_DEFAULT,
219
+ modalBodyMinHeight: MODAL_BODY_MIN_HEIGHT,
220
+ // these last four values must first be calculated
221
+ // the first two values get set on modal body
222
+ minModalBodyHeightStyle: null,
223
+ maxModalBodyHeightStyle: null,
224
+ modalBodyUsableHeight: null,
225
+ modalUsableHeight: null,
226
+ };
227
+ return updatedValues;
228
+ }
117
229
  /**
118
230
  * Set the max-height style inline on modalBody to prevent vertical height
119
231
  * of overall modal to overflow
120
232
  * This function is passed to the parent modal as a callback
121
233
  * and will be called on first modal load, and then on window resize events
122
234
  * as long as modalBody is present
123
- * @param {Object} values Representing headerHeight, footerHeight, backdropHeight
124
- * @returns {object} Representing headerHeight, footerHeight, backdropHeight
235
+ * To support size="full" behavior (full screen modal), this flow has been updated
236
+ * to first determine which strategy to use, update values, then set values on modalBody
237
+ * @param {Object} values Representing headerHeight, footerHeight, backdropHeight,
238
+ * sizeSetFull, and isSmallScreenSize
125
239
  * @private
126
240
  */
127
- handleUpdateHeight({ headerHeight, footerHeight, backdropHeight }) {
241
+ handleUpdateModalBodyHeight(values) {
128
242
  if (!this.initialRender) {
129
- const paddingTop = 48; // 3rem
130
- const paddingBottom = 80; // 5rem
131
- const modalBodyMinHeight = 80;
132
- const modalUsableHeight =
133
- backdropHeight - paddingTop - paddingBottom;
134
- const modalBodyUsableHeight =
135
- modalUsableHeight - headerHeight - footerHeight;
136
- const divElem = this.contentElem;
137
- const styles = {
138
- maxHeight: `${modalBodyUsableHeight}px`,
139
- minHeight: `${modalBodyMinHeight}px`,
140
- };
141
- // set the max and min height value on modal body wrapper div
142
- Object.assign(divElem.style, styles);
243
+ const {
244
+ sizeSetFull,
245
+ isSmallScreenSize,
246
+ headerHeight,
247
+ footerHeight,
248
+ } = values;
249
+ // update modalBody state, tracks header and footer presence
143
250
  this.headerPresent = headerHeight !== 0;
144
251
  this.footerPresent = footerHeight !== 0;
252
+ // now determine behavior: full screen or default
253
+ const shouldUseFullHeight = sizeSetFull && isSmallScreenSize;
254
+ const updatedValues = this.updateValues(
255
+ shouldUseFullHeight,
256
+ values
257
+ );
258
+ // set updated values based on behavior
259
+ this.setModalBodyHeight(updatedValues, shouldUseFullHeight);
145
260
  }
146
261
  }
147
262
 
@@ -160,7 +275,7 @@ export default class LightningModalBody extends LightningElement {
160
275
  bodyId: this.modalContentId,
161
276
  bodyIsPopulated: this.isDefaultSlotPopulated,
162
277
  defaultSlotHasRendered: !this.initialSlotRender,
163
- updateBodyCallback: this.handleUpdateHeight.bind(this),
278
+ updateBodyCallback: this.handleUpdateModalBodyHeight.bind(this),
164
279
  unRegisterCallback: (unregisterCallback) => {
165
280
  this.unregisterCallback = unregisterCallback;
166
281
  },