@salesforce/design-system-react 11.0.0-alpha.8 → 11.0.0-alpha.9

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 (383) hide show
  1. package/dist/cjs/components/accordion/index.cjs +1 -1
  2. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  3. package/dist/cjs/components/alert/container.cjs +1 -1
  4. package/dist/cjs/components/alert/container.cjs.map +1 -1
  5. package/dist/cjs/components/avatar/index.cjs +1 -1
  6. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
  8. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
  9. package/dist/cjs/components/button-stateful/component.cjs +2 -0
  10. package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  16. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  17. package/dist/cjs/components/checkbox/index.cjs +1 -1
  18. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  19. package/dist/cjs/components/color-picker/check-props.cjs +1 -1
  20. package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
  21. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  23. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
  24. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  28. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  29. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  30. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/index.cjs +1 -1
  32. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  33. package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  35. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  36. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
  38. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  39. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  40. package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
  41. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  42. package/dist/cjs/components/index.cjs +1 -1
  43. package/dist/cjs/components/input/check-props.cjs +1 -1
  44. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  45. package/dist/cjs/components/input/index.cjs +1 -1
  46. package/dist/cjs/components/input/index.cjs.map +1 -1
  47. package/dist/cjs/components/input/private/inner-input.cjs +1 -1
  48. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  49. package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
  50. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  51. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  52. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  53. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  54. package/dist/cjs/components/modal/index.cjs +1 -1
  55. package/dist/cjs/components/modal/index.cjs.map +1 -1
  56. package/dist/cjs/components/popover/index.cjs.map +1 -1
  57. package/dist/cjs/components/popover/popover.cjs +1 -1
  58. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  59. package/dist/cjs/components/radio/check-props.cjs +1 -1
  60. package/dist/cjs/components/radio/check-props.cjs.map +1 -1
  61. package/dist/cjs/components/radio/index.cjs +1 -1
  62. package/dist/cjs/components/radio/index.cjs.map +1 -1
  63. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  64. package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
  65. package/dist/cjs/components/radio-group/check-props.cjs +2 -0
  66. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
  67. package/dist/cjs/components/radio-group/component.cjs +2 -0
  68. package/dist/cjs/components/radio-group/component.cjs.map +1 -0
  69. package/dist/cjs/components/radio-group/index.cjs +1 -1
  70. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  71. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  72. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  73. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  74. package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
  75. package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
  76. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  77. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  78. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  79. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  80. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  81. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  82. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  83. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  84. package/dist/cjs/components/slider/check-props.cjs +1 -1
  85. package/dist/cjs/components/slider/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/slider/index.cjs +1 -1
  87. package/dist/cjs/components/slider/index.cjs.map +1 -1
  88. package/dist/cjs/components/split-view/index.cjs +1 -1
  89. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  90. package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
  91. package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
  92. package/dist/cjs/components/split-view/listbox.cjs +1 -1
  93. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  94. package/dist/cjs/components/tabs/check-props.cjs +2 -0
  95. package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
  96. package/dist/cjs/components/tabs/component.cjs +2 -0
  97. package/dist/cjs/components/tabs/component.cjs.map +1 -0
  98. package/dist/cjs/components/tabs/index.cjs +1 -1
  99. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  100. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  101. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  102. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  103. package/dist/cjs/components/textarea/index.cjs +1 -1
  104. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  105. package/dist/cjs/components/toast/container.cjs +1 -1
  106. package/dist/cjs/components/toast/container.cjs.map +1 -1
  107. package/dist/cjs/components/tooltip/index.cjs +2 -2
  108. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  109. package/dist/cjs/components/tree/check-props.cjs +1 -1
  110. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  111. package/dist/cjs/components/tree/private/branch.cjs +1 -1
  112. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  113. package/dist/cjs/components/tree/private/item.cjs +1 -1
  114. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  115. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  116. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  117. package/dist/cjs/components/tree/tree.cjs +1 -1
  118. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  119. package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
  120. package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
  121. package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
  122. package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
  123. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  124. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  125. package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
  126. package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
  127. package/dist/cjs/utilities/hooks/index.cjs +1 -1
  128. package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
  129. package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
  130. package/dist/cjs/utilities/warning/required-property.cjs +2 -0
  131. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
  132. package/dist/es/components/accordion/index.js +10 -8
  133. package/dist/es/components/accordion/index.js.map +1 -1
  134. package/dist/es/components/alert/container.js +1 -1
  135. package/dist/es/components/alert/container.js.map +1 -1
  136. package/dist/es/components/avatar/index.js +2 -1
  137. package/dist/es/components/avatar/index.js.map +1 -1
  138. package/dist/es/components/button-stateful/check-props.js +14 -0
  139. package/dist/es/components/button-stateful/check-props.js.map +1 -0
  140. package/dist/es/components/button-stateful/component.js +20 -0
  141. package/dist/es/components/button-stateful/component.js.map +1 -0
  142. package/dist/es/components/button-stateful/index.js +102 -94
  143. package/dist/es/components/button-stateful/index.js.map +1 -1
  144. package/dist/es/components/carousel/index.js +112 -130
  145. package/dist/es/components/carousel/index.js.map +1 -1
  146. package/dist/es/components/checkbox/check-props.js +14 -8
  147. package/dist/es/components/checkbox/check-props.js.map +1 -1
  148. package/dist/es/components/checkbox/index.js +40 -33
  149. package/dist/es/components/checkbox/index.js.map +1 -1
  150. package/dist/es/components/color-picker/check-props.js +16 -11
  151. package/dist/es/components/color-picker/check-props.js.map +1 -1
  152. package/dist/es/components/color-picker/color-picker.js +185 -169
  153. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  154. package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
  155. package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
  156. package/dist/es/components/color-picker/private/hsv-color.js +1 -0
  157. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  158. package/dist/es/components/combobox/check-props.js +15 -14
  159. package/dist/es/components/combobox/check-props.js.map +1 -1
  160. package/dist/es/components/combobox/combobox.js +399 -399
  161. package/dist/es/components/combobox/combobox.js.map +1 -1
  162. package/dist/es/components/combobox/index.js +4 -4
  163. package/dist/es/components/date-picker/check-props.js +15 -9
  164. package/dist/es/components/date-picker/check-props.js.map +1 -1
  165. package/dist/es/components/date-picker/date-picker.js +144 -138
  166. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  167. package/dist/es/components/date-picker/index.js.map +1 -1
  168. package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
  169. package/dist/es/components/expandable-section/index.js +32 -26
  170. package/dist/es/components/expandable-section/index.js.map +1 -1
  171. package/dist/es/components/icon/input-icon/index.js +7 -2
  172. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  173. package/dist/es/components/index.js +3 -3
  174. package/dist/es/components/input/check-props.js +19 -17
  175. package/dist/es/components/input/check-props.js.map +1 -1
  176. package/dist/es/components/input/index.js +153 -156
  177. package/dist/es/components/input/index.js.map +1 -1
  178. package/dist/es/components/input/private/inner-input.js +18 -18
  179. package/dist/es/components/input/private/inner-input.js.map +1 -1
  180. package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
  181. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  182. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  183. package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
  184. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  185. package/dist/es/components/modal/index.js +1 -1
  186. package/dist/es/components/modal/index.js.map +1 -1
  187. package/dist/es/components/popover/index.js.map +1 -1
  188. package/dist/es/components/popover/popover.js +209 -205
  189. package/dist/es/components/popover/popover.js.map +1 -1
  190. package/dist/es/components/radio/check-props.js +8 -8
  191. package/dist/es/components/radio/check-props.js.map +1 -1
  192. package/dist/es/components/radio/index.js +15 -13
  193. package/dist/es/components/radio/index.js.map +1 -1
  194. package/dist/es/components/radio-button-group/index.js.map +1 -1
  195. package/dist/es/components/radio-button-group/radio.js.map +1 -1
  196. package/dist/es/components/radio-group/check-props.js +14 -0
  197. package/dist/es/components/radio-group/check-props.js.map +1 -0
  198. package/dist/es/components/radio-group/component.js +21 -0
  199. package/dist/es/components/radio-group/component.js.map +1 -0
  200. package/dist/es/components/radio-group/index.js +62 -38
  201. package/dist/es/components/radio-group/index.js.map +1 -1
  202. package/dist/es/components/setup-assistant/step.js +5 -4
  203. package/dist/es/components/setup-assistant/step.js.map +1 -1
  204. package/dist/es/components/simple-data-table/check-props.js +7 -6
  205. package/dist/es/components/simple-data-table/check-props.js.map +1 -1
  206. package/dist/es/components/simple-data-table/column.js.map +1 -1
  207. package/dist/es/components/simple-data-table/index.js +67 -49
  208. package/dist/es/components/simple-data-table/index.js.map +1 -1
  209. package/dist/es/components/simple-data-table/private/head.js +1 -1
  210. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  211. package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
  212. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  213. package/dist/es/components/simple-data-table/private/row.js +43 -57
  214. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  215. package/dist/es/components/slider/check-props.js +14 -12
  216. package/dist/es/components/slider/check-props.js.map +1 -1
  217. package/dist/es/components/slider/index.js +54 -48
  218. package/dist/es/components/slider/index.js.map +1 -1
  219. package/dist/es/components/split-view/index.js +23 -22
  220. package/dist/es/components/split-view/index.js.map +1 -1
  221. package/dist/es/components/split-view/listbox-check-props.js +10 -2
  222. package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
  223. package/dist/es/components/split-view/listbox.js +67 -50
  224. package/dist/es/components/split-view/listbox.js.map +1 -1
  225. package/dist/es/components/tabs/check-props.js +15 -0
  226. package/dist/es/components/tabs/check-props.js.map +1 -0
  227. package/dist/es/components/tabs/component.js +28 -0
  228. package/dist/es/components/tabs/component.js.map +1 -0
  229. package/dist/es/components/tabs/index.js +84 -69
  230. package/dist/es/components/tabs/index.js.map +1 -1
  231. package/dist/es/components/tabs/panel.js.map +1 -1
  232. package/dist/es/components/textarea/check-props.js +1 -1
  233. package/dist/es/components/textarea/check-props.js.map +1 -1
  234. package/dist/es/components/textarea/index.js +3 -2
  235. package/dist/es/components/textarea/index.js.map +1 -1
  236. package/dist/es/components/toast/container.js +1 -1
  237. package/dist/es/components/toast/container.js.map +1 -1
  238. package/dist/es/components/tooltip/index.js +120 -109
  239. package/dist/es/components/tooltip/index.js.map +1 -1
  240. package/dist/es/components/tree/check-props.js +14 -9
  241. package/dist/es/components/tree/check-props.js.map +1 -1
  242. package/dist/es/components/tree/private/branch.js +38 -35
  243. package/dist/es/components/tree/private/branch.js.map +1 -1
  244. package/dist/es/components/tree/private/item.js +6 -8
  245. package/dist/es/components/tree/private/item.js.map +1 -1
  246. package/dist/es/components/tree/private/render-branch.js +9 -10
  247. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  248. package/dist/es/components/tree/tree.js +126 -97
  249. package/dist/es/components/tree/tree.js.map +1 -1
  250. package/dist/es/components/vertical-navigation/check-props.js +13 -0
  251. package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
  252. package/dist/es/components/vertical-navigation/component.js +27 -0
  253. package/dist/es/components/vertical-navigation/component.js.map +1 -0
  254. package/dist/es/components/vertical-navigation/index.js +27 -26
  255. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  256. package/dist/es/components/welcome-mat/info-badge.js +14 -4
  257. package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
  258. package/dist/es/utilities/hooks/index.js +2 -1
  259. package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
  260. package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
  261. package/dist/es/utilities/warning/required-property.js +15 -0
  262. package/dist/es/utilities/warning/required-property.js.map +1 -0
  263. package/dist/types/components/accordion/index.d.ts.map +1 -1
  264. package/dist/types/components/avatar/index.d.ts.map +1 -1
  265. package/dist/types/components/button-stateful/check-props.d.ts +3 -0
  266. package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
  267. package/dist/types/components/button-stateful/index.d.ts +34 -6
  268. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  269. package/dist/types/components/carousel/index.d.ts +26 -7
  270. package/dist/types/components/carousel/index.d.ts.map +1 -1
  271. package/dist/types/components/checkbox/check-props.d.ts +1 -0
  272. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  273. package/dist/types/components/checkbox/index.d.ts +38 -9
  274. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  275. package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
  276. package/dist/types/components/color-picker/color-picker.d.ts +50 -11
  277. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  278. package/dist/types/components/color-picker/index.d.ts +2 -2
  279. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  280. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
  281. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
  282. package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
  283. package/dist/types/components/color-picker/types.d.ts +9 -5
  284. package/dist/types/components/color-picker/types.d.ts.map +1 -1
  285. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  286. package/dist/types/components/combobox/combobox.d.ts +41 -6
  287. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  288. package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
  289. package/dist/types/components/date-picker/date-picker.d.ts +52 -17
  290. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  291. package/dist/types/components/date-picker/index.d.ts +1 -1
  292. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  293. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
  294. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
  295. package/dist/types/components/expandable-section/index.d.ts +15 -3
  296. package/dist/types/components/expandable-section/index.d.ts.map +1 -1
  297. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  298. package/dist/types/components/input/check-props.d.ts.map +1 -1
  299. package/dist/types/components/input/index.d.ts +10 -4
  300. package/dist/types/components/input/index.d.ts.map +1 -1
  301. package/dist/types/components/input/private/inner-input.d.ts +2 -4
  302. package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
  303. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  304. package/dist/types/components/menu-dropdown/index.d.ts +1 -1
  305. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  306. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
  307. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  308. package/dist/types/components/popover/index.d.ts +1 -1
  309. package/dist/types/components/popover/index.d.ts.map +1 -1
  310. package/dist/types/components/popover/popover.d.ts +30 -3
  311. package/dist/types/components/popover/popover.d.ts.map +1 -1
  312. package/dist/types/components/radio/check-props.d.ts.map +1 -1
  313. package/dist/types/components/radio/index.d.ts +42 -9
  314. package/dist/types/components/radio/index.d.ts.map +1 -1
  315. package/dist/types/components/radio-button-group/index.d.ts +20 -10
  316. package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
  317. package/dist/types/components/radio-button-group/radio.d.ts +7 -2
  318. package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
  319. package/dist/types/components/radio-group/check-props.d.ts +3 -0
  320. package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
  321. package/dist/types/components/radio-group/index.d.ts +51 -8
  322. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  323. package/dist/types/components/radio-group/radio.d.ts +7 -2
  324. package/dist/types/components/radio-group/radio.d.ts.map +1 -1
  325. package/dist/types/components/setup-assistant/step.d.ts +10 -2
  326. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  327. package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
  328. package/dist/types/components/simple-data-table/column.d.ts +4 -1
  329. package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
  330. package/dist/types/components/simple-data-table/index.d.ts +10 -2
  331. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  332. package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
  333. package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
  334. package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
  335. package/dist/types/components/simple-data-table/types.d.ts +40 -13
  336. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  337. package/dist/types/components/slider/check-props.d.ts.map +1 -1
  338. package/dist/types/components/slider/index.d.ts +23 -10
  339. package/dist/types/components/slider/index.d.ts.map +1 -1
  340. package/dist/types/components/split-view/index.d.ts +12 -3
  341. package/dist/types/components/split-view/index.d.ts.map +1 -1
  342. package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
  343. package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
  344. package/dist/types/components/split-view/listbox.d.ts +41 -10
  345. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  346. package/dist/types/components/tabs/check-props.d.ts +3 -0
  347. package/dist/types/components/tabs/check-props.d.ts.map +1 -0
  348. package/dist/types/components/tabs/index.d.ts +46 -12
  349. package/dist/types/components/tabs/index.d.ts.map +1 -1
  350. package/dist/types/components/tabs/panel.d.ts +4 -0
  351. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  352. package/dist/types/components/textarea/check-props.d.ts.map +1 -1
  353. package/dist/types/components/textarea/index.d.ts +14 -6
  354. package/dist/types/components/textarea/index.d.ts.map +1 -1
  355. package/dist/types/components/toast/container.d.ts +1 -1
  356. package/dist/types/components/tooltip/index.d.ts +49 -3
  357. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  358. package/dist/types/components/tree/check-props.d.ts +1 -0
  359. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  360. package/dist/types/components/tree/private/branch.d.ts +6 -1
  361. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  362. package/dist/types/components/tree/private/item.d.ts +3 -1
  363. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  364. package/dist/types/components/tree/private/render-branch.d.ts +3 -1
  365. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  366. package/dist/types/components/tree/tree.d.ts +33 -6
  367. package/dist/types/components/tree/tree.d.ts.map +1 -1
  368. package/dist/types/components/tree/types.d.ts +23 -4
  369. package/dist/types/components/tree/types.d.ts.map +1 -1
  370. package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
  371. package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
  372. package/dist/types/components/vertical-navigation/index.d.ts +9 -4
  373. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  374. package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
  375. package/dist/types/types/components.d.ts +0 -2
  376. package/dist/types/types/components.d.ts.map +1 -1
  377. package/dist/types/utilities/hooks/index.d.ts +1 -0
  378. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  379. package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
  380. package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
  381. package/dist/types/utilities/warning/required-property.d.ts +3 -0
  382. package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
  383. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tooltip/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Forces tooltip to be open. A value of `false` will disable any interaction with the tooltip.\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn isOpenProp === undefined ? isOpenState : isOpenProp;\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Event handlers\n\tconst handleCancel = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\tsetIsOpenState(false);\n\t}, []);\n\n\tconst handleMouseEnter = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\tif (!isUnmountingRef.current) {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t}, hoverOpenDelay);\n\t}, [hoverOpenDelay]);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isUnmountingRef.current && !isHoveringTooltip) {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (!isUnmountingRef.current && e.key === 'Escape') {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: () => void;\n\t\t\t\t\tonMouseEnter?: () => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleMouseLeave,\n\t\t\t\t\tonFocus: handleMouseEnter,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\tconst isErrorTheme = theme === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\tconst isOpen = getIsOpen();\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error',\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleCancel}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleCancel}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPOVER_TOOLTIP;\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;;;;;;AAoKA,IAAM,IAA6C;CAClD,yBAAyB;CACzB,sBAAsB;AACvB,GAEM,IAA+B;CACpC,gBAAgB;CAChB,iBAAiB;AAClB,GAOM,KAAW,EAChB,WAAQ,OACR,eAAe,GACf,aACA,aAAU,kBAAC,QAAD,EAAA,UAAM,UAAa,CAAA,GAC7B,oBACA,uBAAoB,IACpB,wBAAqB,IACrB,qBAAkB,IAClB,oBAAiB,GACjB,iBAAc,QACd,IAAI,GACJ,QAAQ,IACR,QAAQ,GACR,2BACA,mBACA,qBACA,cAAW,YACX,iBACA,WAAQ,QACR,aAAU,aAC6B;CAEvC,IAAM,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAChE,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW,GAG3C,IAAe,GAAW,CAAmB,GAG7C,CAAC,GAAa,KAAkB,EAAS,EAAK,GAC9C,CAAC,GAAiB,KAAsB,EAAS,EAAK,GAGtD,IAAa,EAAuB,IAAI,GACxC,IAAoB,EAA6C,IAAI,GACrE,IAAiB,EAAO,EAAW,CAAC,GACpC,IAAkB,EAAO,EAAK;CAiCpC,AA9BA,QAAgB;EACf,GACC,GACA;GACC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,IAAI;GACJ;GACA,QAAQ;GACR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AmB,EAClB,gBACA,wBACA,EACC,oBAAoB,MAAU,QAC/B,GACA,CACD;EACO;EACP,SAAS;EACW;EACpB,SAAS;EACT,wBAAwB;EACxB,cAAc;EACJ;EACV,SAAQ;EACR,gBAAgB,EACf,IAAI,EAAM,EACX;EAEC,UAAA,GAAkB;CACZ,CAAA,IAER,kBAAC,QAAD,CAAO,CAAA,GAIH,KAAiC;EACtC,SAAS;EACT,YAAY;EACZ,GAAG;CACJ;CAEA,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,wBAAwB,CAAgB;EAC9D,OAAO;EACP,KAAK;EAHN,UAAA;GAKE,GAAwB;GACxB,GAAW;GACX,GAAW;EACR;;AAEP;AAEA,EAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tooltip/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { useControllableState } from '../../utilities/hooks';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\n/**\n * What caused `onRequestOpen` to fire:\n * * `focus`: the trigger received focus\n * * `mouseEnter`: the mouse entered the trigger\n */\nexport type TooltipRequestOpenTrigger = 'focus' | 'mouseEnter';\n\n/**\n * Data passed to `onRequestOpen`\n */\nexport interface TooltipRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: TooltipRequestOpenTrigger;\n}\n\n/**\n * What caused `onRequestClose` to fire:\n * * `blur`: focus left the trigger (including Tab from the tooltip)\n * * `cancel`: Escape was pressed on the trigger\n * * `clickOutside`: a click landed outside the tooltip\n * * `mouseLeave`: the mouse left the trigger or the tooltip\n */\nexport type TooltipRequestCloseTrigger =\n\t'blur' | 'cancel' | 'clickOutside' | 'mouseLeave';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface TooltipRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: TooltipRequestCloseTrigger;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Open state when the tooltip is controlled. When set, the tooltip only opens and closes when this\n\t * prop changes: `isOpen={false}` keeps it closed and `isOpen={true}` keeps it open, whatever the\n\t * user does. Handle `onRequestOpen`/`onRequestClose` to update it. Leave it `undefined` for an\n\t * uncontrolled tooltip that opens on hover and focus (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Initial open state of an uncontrolled tooltip (`isOpen` is `undefined`). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Called when the tooltip requests to open (hover after `hoverOpenDelay`, or focus), controlled or\n\t * not. `data.trigger` says why. A controlled tooltip opens only if the parent sets `isOpen` to `true`.\n\t */\n\tonRequestOpen?: (\n\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\tdata: TooltipRequestOpenData\n\t) => void;\n\t/**\n\t * Called when the tooltip requests to close (mouse leave, blur, Escape, click outside), controlled\n\t * or not. `data.trigger` says why. `event` is `undefined` for `clickOutside`. A controlled tooltip\n\t * closes only if the parent sets `isOpen` to `false`.\n\t */\n\tonRequestClose?: (\n\t\tevent:\n\t\t\t| MouseEvent<HTMLElement>\n\t\t\t| FocusEvent<HTMLElement>\n\t\t\t| KeyboardEvent<HTMLElement>\n\t\t\t| undefined,\n\t\tdata: TooltipRequestCloseData\n\t) => void;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tdefaultIsOpen = false,\n\tonRequestOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\t// Latest open state, read by the hover/blur/Escape timers\n\tconst isOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tisOpenRef.current = isOpen;\n\t}, [isOpen]);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => isOpen, [isOpen]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Event handlers\n\tconst clearTooltipTimeout = () => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\t};\n\n\tconst requestOpen = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestOpenTrigger\n\t\t) => {\n\t\t\tif (isUnmountingRef.current || isOpenRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonRequestOpen?.(event, { trigger });\n\t\t\tsetIsOpen(true);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst requestClose = useCallback(\n\t\t(\n\t\t\tevent:\n\t\t\t\t| MouseEvent<HTMLElement>\n\t\t\t\t| FocusEvent<HTMLElement>\n\t\t\t\t| KeyboardEvent<HTMLElement>\n\t\t\t\t| undefined,\n\t\t\ttrigger: TooltipRequestCloseTrigger\n\t\t) => {\n\t\t\tif (isUnmountingRef.current || !isOpenRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonRequestClose?.(event, { trigger });\n\t\t\tsetIsOpen(false);\n\t\t},\n\t\t[onRequestClose, setIsOpen]\n\t);\n\n\t// Called by the Dialog on click outside, Tab and unmount\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent?: KeyboardEvent<HTMLElement>,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tclearTooltipTimeout();\n\t\t\t// The dialog unmounts because the tooltip already closed: nothing to request\n\t\t\tif (data?.componentWillUnmount) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestClose(event, event ? 'blur' : 'clickOutside');\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst handleDialogMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tclearTooltipTimeout();\n\t\t\trequestClose(event as MouseEvent<HTMLElement>, 'mouseLeave');\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst scheduleOpen = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestOpenTrigger\n\t\t) => {\n\t\t\tclearTooltipTimeout();\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\trequestOpen(event, trigger);\n\t\t\t}, hoverOpenDelay);\n\t\t},\n\t\t[hoverOpenDelay, requestOpen]\n\t);\n\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent<HTMLElement>) => scheduleOpen(event, 'mouseEnter'),\n\t\t[scheduleOpen]\n\t);\n\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent<HTMLElement>) => scheduleOpen(event, 'focus'),\n\t\t[scheduleOpen]\n\t);\n\n\tconst scheduleClose = useCallback(\n\t\t(\n\t\t\te: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestCloseTrigger\n\t\t) => {\n\t\t\te.stopPropagation();\n\t\t\tclearTooltipTimeout();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isHoveringTooltip) {\n\t\t\t\t\trequestClose(e, trigger);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay, requestClose]\n\t);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement>) => scheduleClose(e, 'mouseLeave'),\n\t\t[scheduleClose]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLElement>) => scheduleClose(e, 'blur'),\n\t\t[scheduleClose]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (e.key === 'Escape') {\n\t\t\t\t\trequestClose(e, 'cancel');\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay, requestClose]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonMouseEnter?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleBlur,\n\t\t\t\t\tonFocus: handleFocus,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\tconst isErrorTheme = theme === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\treturn getIsOpen() ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error',\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleDialogMouseLeave}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPOVER_TOOLTIP;\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;;;;;;;AAkOA,IAAM,KAA6C;CAClD,yBAAyB;CACzB,sBAAsB;AACvB,GAEM,IAA+B;CACpC,gBAAgB;CAChB,iBAAiB;AAClB,GAOM,KAAW,EAChB,WAAQ,OACR,eAAe,IACf,aACA,aAAU,kBAAC,QAAD,EAAA,UAAM,UAAa,CAAA,GAC7B,oBACA,uBAAoB,IACpB,wBAAqB,IACrB,qBAAkB,IAClB,oBAAiB,GACjB,iBAAc,QACd,IAAI,GACJ,QAAQ,IACR,QAAQ,GACR,oBAAgB,IAChB,kBACA,mBACA,2BACA,mBACA,qBACA,cAAW,YACX,iBACA,WAAQ,QACR,aAAU,aAC6B;CAEvC,IAAM,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAChE,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW,GAG3C,KAAe,EAAW,CAAmB,GAG7C,CAAC,GAAQ,KAAa,EAAqB,GAAY,EAAa,GACpE,CAAC,GAAiB,KAAsB,GAAS,EAAK,GAGtD,IAAa,EAAuB,IAAI,GACxC,IAAoB,EAA6C,IAAI,GACrE,KAAiB,EAA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CAAgB;EAC9D,OAAO;EACP,KAAK;EAHN,UAAA;GAKE,GAAwB;GACxB,GAAW;GACX,GAAW;EACR;;AAEP;AAEA,EAAQ,cAAc"}
@@ -1,18 +1,23 @@
1
1
  import e from "../../utilities/get-component-doc.js";
2
2
  import t from "../../utilities/warning/one-of-required-property.js";
3
3
  import n from "../../utilities/warning/deprecated-property.js";
4
- import r from "../../utilities/warning/only-one-of-properties.js";
4
+ import r from "../../utilities/warning/required-property.js";
5
+ import i from "../../utilities/warning/only-one-of-properties.js";
5
6
  //#region components/tree/check-props.js
6
- var i = function() {};
7
- process.env.NODE_ENV !== "production" && (i = function(i, a, o) {
8
- let s = e(o), c = a.assistiveText || {}, l = {
9
- "labels.heading": a.labels?.heading ?? a.heading,
10
- "assistiveText.heading": c.heading ?? c.label
7
+ var a = function() {};
8
+ process.env.NODE_ENV !== "production" && (a = function(a, o, s) {
9
+ let c = e(s), l = o.assistiveText || {}, u = {
10
+ "labels.heading": o.labels?.heading ?? o.heading,
11
+ "assistiveText.heading": l.heading ?? l.label
11
12
  };
12
- t(i, l, s()), r(i, l, s()), n(i, a.heading, "heading", "labels.heading", s("labels")), n(i, c.label, "assistiveText.label", "assistiveText.heading", s("assistiveText")), n(i, a.onClick, "onClick", "onSelect", "`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state."), n(i, a.onExpandClick, "onExpandClick", "onRequestToggle", "`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead."), n(i, a.listClassName, "listClassName", "classNameList"), n(i, a.listStyle, "listStyle", "styleList");
13
+ t(a, u, c()), i(a, u, c()), n(a, o.heading, "heading", "labels.heading", c("labels")), n(a, l.label, "assistiveText.label", "assistiveText.heading", c("assistiveText")), n(a, o.onClick, "onClick", "onSelect", "`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state."), r(a, o.onSelect !== void 0 || o.onClick !== void 0, "onSelect", `Tree selection is controlled: without \`onSelect\`, selecting a node does nothing. Update \`selectedIds\` from \`data.selectedIds\` in \`onSelect\`. ${c("onSelect")}`), n(a, o.onExpandClick, "onExpandClick", "onRequestToggle", "`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead."), n(a, o.selectedIds === void 0 || void 0, "node.selected", "selectedIds", "`selectedIds` is not set, so Tree reads selection from the deprecated `selected` field of each node. Tree never writes to `nodes`; pass `selectedIds` and update it from `data.selectedIds` in `onSelect`."), n(a, o.listClassName, "listClassName", "classNameList"), n(a, o.listStyle, "listStyle", "styleList");
13
14
  });
14
- var a = i;
15
+ var o = function() {};
16
+ process.env.NODE_ENV !== "production" && (o = function(e, { hasExpandedField: t }) {
17
+ n(e, t ? !0 : void 0, "node.expanded", "expandedIds", "Tree reads the deprecated `expanded` field of each node only when neither `expandedIds` nor `defaultExpandedIds` is passed, and never writes to `nodes`. Pass `expandedIds` and update it from `data.expandedIds` in `onRequestToggle`, or pass `defaultExpandedIds` and let Tree manage expansion.");
18
+ });
19
+ var s = a;
15
20
  //#endregion
16
- export { a as default };
21
+ export { o as checkLegacyNodeFields, s as default };
17
22
 
18
23
  //# sourceMappingURL=check-props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tree/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\t\tconst assistiveText = props.assistiveText || {};\n\n\t\tconst headingProps = {\n\t\t\t'labels.heading': props.labels?.heading ?? props.heading,\n\t\t\t'assistiveText.heading': assistiveText.heading ?? assistiveText.label,\n\t\t};\n\t\toneOfRequiredProperty(COMPONENT, headingProps, createDocUrl());\n\t\tonlyOneOfProperties(COMPONENT, headingProps, createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.heading,\n\t\t\t'heading',\n\t\t\t'labels.heading',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tassistiveText.label,\n\t\t\t'assistiveText.label',\n\t\t\t'assistiveText.heading',\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\n\t\t/* eslint-disable max-len */\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick,\n\t\t\t'onClick',\n\t\t\t'onSelect',\n\t\t\t'`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onExpandClick,\n\t\t\t'onExpandClick',\n\t\t\t'onRequestToggle',\n\t\t\t'`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listClassName,\n\t\t\t'listClassName',\n\t\t\t'classNameList'\n\t\t);\n\t\tdeprecatedProperty(COMPONENT, props.listStyle, 'listStyle', 'styleList');\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AASA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO,GACxC,IAAgB,EAAM,iBAAiB,CAAC,GAExC,IAAe;EACpB,kBAAkB,EAAM,QAAQ,WAAW,EAAM;EACjD,yBAAyB,EAAc,WAAW,EAAc;CACjE;CAyCA,AAxCA,EAAsB,GAAW,GAAc,EAAa,CAAC,GAC7D,EAAoB,GAAW,GAAc,EAAa,CAAC,GAE3D,EACC,GACA,EAAM,SACN,WACA,kBACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAc,OACd,uBACA,yBACA,EAAa,eAAe,CAC7B,GAIA,EACC,GACA,EAAM,SACN,WACA,YACA,2GACD,GACA,EACC,GACA,EAAM,eACN,iBACA,mBACA,0MACD,GACA,EACC,GACA,EAAM,eACN,iBACA,eACD,GACA,EAAmB,GAAW,EAAM,WAAW,aAAa,WAAW;AAExE;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tree/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport requiredProperty from '../../utilities/warning/required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\t\tconst assistiveText = props.assistiveText || {};\n\n\t\tconst headingProps = {\n\t\t\t'labels.heading': props.labels?.heading ?? props.heading,\n\t\t\t'assistiveText.heading': assistiveText.heading ?? assistiveText.label,\n\t\t};\n\t\toneOfRequiredProperty(COMPONENT, headingProps, createDocUrl());\n\t\tonlyOneOfProperties(COMPONENT, headingProps, createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.heading,\n\t\t\t'heading',\n\t\t\t'labels.heading',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tassistiveText.label,\n\t\t\t'assistiveText.label',\n\t\t\t'assistiveText.heading',\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\n\t\t/* eslint-disable max-len */\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick,\n\t\t\t'onClick',\n\t\t\t'onSelect',\n\t\t\t'`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state.'\n\t\t);\n\t\t// The deprecated `onClick` still fires, so it satisfies the requirement at runtime.\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onSelect !== undefined || props.onClick !== undefined,\n\t\t\t'onSelect',\n\t\t\t`Tree selection is controlled: without \\`onSelect\\`, selecting a node does nothing. Update \\`selectedIds\\` from \\`data.selectedIds\\` in \\`onSelect\\`. ${createDocUrl(\n\t\t\t\t'onSelect'\n\t\t\t)}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onExpandClick,\n\t\t\t'onExpandClick',\n\t\t\t'onRequestToggle',\n\t\t\t'`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.'\n\t\t);\n\n\t\t// Selection is controlled data: without `selectedIds`, Tree falls back to `node.selected`\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.selectedIds === undefined ? true : undefined,\n\t\t\t'node.selected',\n\t\t\t'selectedIds',\n\t\t\t'`selectedIds` is not set, so Tree reads selection from the deprecated `selected` field of each node. Tree never writes to `nodes`; pass `selectedIds` and update it from `data.selectedIds` in `onSelect`.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listClassName,\n\t\t\t'listClassName',\n\t\t\t'classNameList'\n\t\t);\n\t\tdeprecatedProperty(COMPONENT, props.listStyle, 'listStyle', 'styleList');\n\t\t/* eslint-enable max-len */\n\t};\n}\n\n// The deprecated `node.expanded` fallback. Called whenever the visible nodes change, because\n// consumers usually add the field later, in their expand handler.\nexport let checkLegacyNodeFields = function checkLegacyNodeFieldsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckLegacyNodeFields = function checkLegacyNodeFieldsFunction(\n\t\tCOMPONENT,\n\t\t{ hasExpandedField }\n\t) {\n\t\t/* eslint-disable max-len */\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\thasExpandedField ? true : undefined,\n\t\t\t'node.expanded',\n\t\t\t'expandedIds',\n\t\t\t'Tree reads the deprecated `expanded` field of each node only when neither `expandedIds` nor `defaultExpandedIds` is passed, and never writes to `nodes`. Pass `expandedIds` and update it from `data.expandedIds` in `onRequestToggle`, or pass `defaultExpandedIds` and let Tree manage expansion.'\n\t\t);\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO,GACxC,IAAgB,EAAM,iBAAiB,CAAC,GAExC,IAAe;EACpB,kBAAkB,EAAM,QAAQ,WAAW,EAAM;EACjD,yBAAyB,EAAc,WAAW,EAAc;CACjE;CA2DA,AA1DA,EAAsB,GAAW,GAAc,EAAa,CAAC,GAC7D,EAAoB,GAAW,GAAc,EAAa,CAAC,GAE3D,EACC,GACA,EAAM,SACN,WACA,kBACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAc,OACd,uBACA,yBACA,EAAa,eAAe,CAC7B,GAIA,EACC,GACA,EAAM,SACN,WACA,YACA,2GACD,GAEA,EACC,GACA,EAAM,aAAa,KAAA,KAAa,EAAM,YAAY,KAAA,GAClD,YACA,wJAAwJ,EACvJ,UACD,GACD,GACA,EACC,GACA,EAAM,eACN,iBACA,mBACA,0MACD,GAGA,EACC,GACA,EAAM,gBAAgB,KAAA,KAAmB,KAAA,GACzC,iBACA,eACA,4MACD,GACA,EACC,GACA,EAAM,eACN,iBACA,eACD,GACA,EAAmB,GAAW,EAAM,WAAW,aAAa,WAAW;AAExE;AAKD,IAAW,IAAwB,WAAyC,CAAC;AAE7E,QAAA,IAAA,aAA6B,iBAC5B,IAAwB,SACvB,GACA,EAAE,uBACD;CAED,EACC,GACA,IAAmB,KAAO,KAAA,GAC1B,iBACA,eACA,qSACD;AAED;AAGD,IAAA,IAAe"}
@@ -6,55 +6,58 @@ import i from "./render-branch.js";
6
6
  import "react";
7
7
  import { jsx as a } from "react/jsx-runtime";
8
8
  //#region components/tree/private/branch.tsx
9
- var o = (e) => e.nodes, s = ({ level: e = 0, label: c = "", treeIndex: l = "", selectedNodeIndexes: u = [], getNodes: d = o, ...f }) => {
10
- let p = {
9
+ var o = (e) => e.nodes, s = ({ level: e = 0, label: c = "", treeIndex: l = "", getNodes: u = o, ...d }) => {
10
+ let f = {
11
11
  level: e,
12
12
  label: c,
13
13
  treeIndex: l,
14
- selectedNodeIndexes: u,
15
- getNodes: d,
16
- ...f
17
- }, { treeId: m, onExpand: h, searchTerm: g, node: _ } = p, v = "", y = null, b = d(_);
18
- return Array.isArray(b) && (y = b.map((r, i) => {
19
- let o, c = `${m}-${r.id}`;
20
- return v = `${i}`, l && (v = `${l}-${v}`), o = r.type === "branch" ? /* @__PURE__ */ a(s, {
21
- getNodes: d,
14
+ getNodes: u,
15
+ ...d
16
+ }, { treeId: p, onExpand: m, searchTerm: h, node: g } = f, _ = "", v = null, y = u(g);
17
+ return Array.isArray(y) && (v = y.map((r, i) => {
18
+ let o, c = `${p}-${r.id}`;
19
+ return _ = `${i}`, l && (_ = `${l}-${_}`), o = r.type === "branch" ? /* @__PURE__ */ a(s, {
20
+ getNodes: u,
22
21
  htmlId: c,
23
22
  label: r.label,
24
23
  level: e + 1,
25
24
  node: r,
26
- flattenedNodes: p.flattenedNodes,
27
- selectedNodeIndexes: u,
28
- focusedNodeIndex: p.focusedNodeIndex,
29
- treeHasFocus: p.treeHasFocus,
30
- onNodeBlur: p.onNodeBlur,
25
+ flattenedNodes: f.flattenedNodes,
26
+ isNodeSelected: f.isNodeSelected,
27
+ isNodeExpanded: f.isNodeExpanded,
28
+ tabStopIndex: f.tabStopIndex,
29
+ focusedNodeIndex: f.focusedNodeIndex,
30
+ treeHasFocus: f.treeHasFocus,
31
+ onNodeBlur: f.onNodeBlur,
31
32
  nodes: r.nodes,
32
- onSelect: p.onSelect,
33
- onExpand: h,
34
- searchTerm: g,
35
- treeId: m,
36
- treeIndex: v,
37
- parent: _
33
+ onSelect: f.onSelect,
34
+ onExpand: m,
35
+ searchTerm: h,
36
+ treeId: p,
37
+ treeIndex: _,
38
+ parent: g
38
39
  }, r.id) : /* @__PURE__ */ a(n, {
39
40
  label: r.label,
40
41
  htmlId: c,
41
42
  level: e + 1,
42
43
  node: r,
43
- flattenedNodes: p.flattenedNodes,
44
- selectedNodeIndexes: u,
45
- focusedNodeIndex: p.focusedNodeIndex,
46
- treeHasFocus: p.treeHasFocus,
47
- onNodeBlur: p.onNodeBlur,
48
- onSelect: p.onSelect,
49
- onExpand: h,
50
- searchTerm: g,
51
- treeIndex: v,
52
- treeId: m,
53
- parent: _
44
+ flattenedNodes: f.flattenedNodes,
45
+ isNodeSelected: f.isNodeSelected,
46
+ isNodeExpanded: f.isNodeExpanded,
47
+ tabStopIndex: f.tabStopIndex,
48
+ focusedNodeIndex: f.focusedNodeIndex,
49
+ treeHasFocus: f.treeHasFocus,
50
+ onNodeBlur: f.onNodeBlur,
51
+ onSelect: f.onSelect,
52
+ onExpand: m,
53
+ searchTerm: h,
54
+ treeIndex: _,
55
+ treeId: p,
56
+ parent: g
54
57
  }, t()), o;
55
- })), e === 0 ? r(y, p) : i(y, {
56
- ...p,
57
- node: _,
58
+ })), e === 0 ? r(v, f) : i(v, {
59
+ ...f,
60
+ node: g,
58
61
  treeIndex: l
59
62
  });
60
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"branch.js","names":[],"sources":["../../../../../components/tree/private/branch.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode, TreeScrollData } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: string;\n\ttreeIndex?: string;\n\tflattenedNodes: FlattenedNode[];\n\tselectedNodeIndexes: string[];\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tnodes?: TreeNode[];\n}\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A Tree Branch is an expandable node in a hierarchical list.\n */\nconst Branch: React.FC<BranchProps> = ({\n\tlevel = 0,\n\tlabel = '',\n\ttreeIndex = '',\n\tselectedNodeIndexes = [],\n\tgetNodes = defaultGetNodes,\n\t...rest\n}) => {\n\tconst props = {\n\t\tlevel,\n\t\tlabel,\n\t\ttreeIndex,\n\t\tselectedNodeIndexes,\n\t\tgetNodes,\n\t\t...rest,\n\t};\n\n\tconst { treeId, onExpand, searchTerm, node } = props;\n\tlet resolvedTreeIndex = '';\n\tlet children: ReactNode = null;\n\n\tconst nodeChildren = getNodes(node);\n\tif (Array.isArray(nodeChildren)) {\n\t\tchildren = nodeChildren.map((childNode, index) => {\n\t\t\tlet child: ReactNode;\n\t\t\tconst htmlId = `${treeId}-${childNode.id}`;\n\t\t\tresolvedTreeIndex = `${index}`;\n\t\t\tif (treeIndex) {\n\t\t\t\tresolvedTreeIndex = `${treeIndex}-${resolvedTreeIndex}`;\n\t\t\t}\n\n\t\t\tif (childNode.type === 'branch') {\n\t\t\t\tchild = (\n\t\t\t\t\t<Branch\n\t\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={childNode.id}\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tnodes={childNode.nodes}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchild = (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={generateId()}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}\n\n\tconst branch =\n\t\tlevel === 0\n\t\t\t? RenderInitialBranch(children, props)\n\t\t\t: RenderBranch(children, {\n\t\t\t\t\t...props,\n\t\t\t\t\tnode: node as TreeNode,\n\t\t\t\t\ttreeIndex,\n\t\t\t\t});\n\n\treturn branch;\n};\n\nBranch.displayName = TREE_BRANCH;\n\nexport default Branch;\n"],"mappings":";;;;;;;;AA0DA,IAAM,KAAmB,MAAiC,EAAK,OAKzD,KAAiC,EACtC,WAAQ,GACR,WAAQ,IACR,eAAY,IACZ,yBAAsB,CAAC,GACvB,cAAW,GACX,GAAG,QACE;CACL,IAAM,IAAQ;EACb;EACA;EACA;EACA;EACA;EACA,GAAG;CACJ,GAEM,EAAE,WAAQ,aAAU,eAAY,YAAS,GAC3C,IAAoB,IACpB,IAAsB,MAEpB,IAAe,EAAS,CAAI;CAoElC,OAnEI,MAAM,QAAQ,CAAY,MAC7B,IAAW,EAAa,KAAK,GAAW,MAAU;EACjD,IAAI,GACE,IAAS,GAAG,EAAO,GAAG,EAAU;EAmDtC,OAlDA,IAAoB,GAAG,KACnB,MACH,IAAoB,GAAG,EAAU,GAAG,MAGrC,AAwBC,IAxBG,EAAU,SAAS,WAErB,kBAAC,GAAD;GACW;GACF;GAER,OAAO,EAAU;GACjB,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,OAAO,EAAU;GACjB,UAAU,EAAM;GACN;GACE;GACJ;GACR,WAAW;GACX,QAAQ;EACR,GAhBK,EAAU,EAgBf,IAID,kBAAC,GAAD;GACC,OAAO,EAAU;GACT;GAER,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,UAAU,EAAM;GACN;GACE;GACZ,WAAW;GACH;GACR,QAAQ;EACR,GAdK,EAAW,CAchB,GAGI;CACR,CAAC,IAID,MAAU,IACP,EAAoB,GAAU,CAAK,IACnC,EAAa,GAAU;EACvB,GAAG;EACG;EACN;CACD,CAAC;AAGL;AAEA,EAAO,cAAc"}
1
+ {"version":3,"file":"branch.js","names":[],"sources":["../../../../../components/tree/private/branch.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode, TreeScrollData } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: string;\n\ttreeIndex?: string;\n\tflattenedNodes: FlattenedNode[];\n\t/** Whether a node is selected (from `selectedIds`, or the deprecated `node.selected`) */\n\tisNodeSelected: (node: TreeNode) => boolean;\n\t/** Whether a branch is expanded (from expansion state, or the deprecated `node.expanded`) */\n\tisNodeExpanded: (node: TreeNode) => boolean;\n\t/** Tree index of the node that is the tree's tab stop */\n\ttabStopIndex?: string;\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tnodes?: TreeNode[];\n}\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A Tree Branch is an expandable node in a hierarchical list.\n */\nconst Branch: React.FC<BranchProps> = ({\n\tlevel = 0,\n\tlabel = '',\n\ttreeIndex = '',\n\tgetNodes = defaultGetNodes,\n\t...rest\n}) => {\n\tconst props = {\n\t\tlevel,\n\t\tlabel,\n\t\ttreeIndex,\n\t\tgetNodes,\n\t\t...rest,\n\t};\n\n\tconst { treeId, onExpand, searchTerm, node } = props;\n\tlet resolvedTreeIndex = '';\n\tlet children: ReactNode = null;\n\n\tconst nodeChildren = getNodes(node);\n\tif (Array.isArray(nodeChildren)) {\n\t\tchildren = nodeChildren.map((childNode, index) => {\n\t\t\tlet child: ReactNode;\n\t\t\tconst htmlId = `${treeId}-${childNode.id}`;\n\t\t\tresolvedTreeIndex = `${index}`;\n\t\t\tif (treeIndex) {\n\t\t\t\tresolvedTreeIndex = `${treeIndex}-${resolvedTreeIndex}`;\n\t\t\t}\n\n\t\t\tif (childNode.type === 'branch') {\n\t\t\t\tchild = (\n\t\t\t\t\t<Branch\n\t\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={childNode.id}\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tisNodeSelected={props.isNodeSelected}\n\t\t\t\t\t\tisNodeExpanded={props.isNodeExpanded}\n\t\t\t\t\t\ttabStopIndex={props.tabStopIndex}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tnodes={childNode.nodes}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchild = (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={generateId()}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tisNodeSelected={props.isNodeSelected}\n\t\t\t\t\t\tisNodeExpanded={props.isNodeExpanded}\n\t\t\t\t\t\ttabStopIndex={props.tabStopIndex}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}\n\n\tconst branch =\n\t\tlevel === 0\n\t\t\t? RenderInitialBranch(children, props)\n\t\t\t: RenderBranch(children, {\n\t\t\t\t\t...props,\n\t\t\t\t\tnode: node as TreeNode,\n\t\t\t\t\ttreeIndex,\n\t\t\t\t});\n\n\treturn branch;\n};\n\nBranch.displayName = TREE_BRANCH;\n\nexport default Branch;\n"],"mappings":";;;;;;;;AA+DA,IAAM,KAAmB,MAAiC,EAAK,OAKzD,KAAiC,EACtC,WAAQ,GACR,WAAQ,IACR,eAAY,IACZ,cAAW,GACX,GAAG,QACE;CACL,IAAM,IAAQ;EACb;EACA;EACA;EACA;EACA,GAAG;CACJ,GAEM,EAAE,WAAQ,aAAU,eAAY,YAAS,GAC3C,IAAoB,IACpB,IAAsB,MAEpB,IAAe,EAAS,CAAI;CAwElC,OAvEI,MAAM,QAAQ,CAAY,MAC7B,IAAW,EAAa,KAAK,GAAW,MAAU;EACjD,IAAI,GACE,IAAS,GAAG,EAAO,GAAG,EAAU;EAuDtC,OAtDA,IAAoB,GAAG,KACnB,MACH,IAAoB,GAAG,EAAU,GAAG,MAGrC,AA0BC,IA1BG,EAAU,SAAS,WAErB,kBAAC,GAAD;GACW;GACF;GAER,OAAO,EAAU;GACjB,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACtB,gBAAgB,EAAM;GACtB,gBAAgB,EAAM;GACtB,cAAc,EAAM;GACpB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,OAAO,EAAU;GACjB,UAAU,EAAM;GACN;GACE;GACJ;GACR,WAAW;GACX,QAAQ;EACR,GAlBK,EAAU,EAkBf,IAID,kBAAC,GAAD;GACC,OAAO,EAAU;GACT;GAER,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACtB,gBAAgB,EAAM;GACtB,gBAAgB,EAAM;GACtB,cAAc,EAAM;GACpB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,UAAU,EAAM;GACN;GACE;GACZ,WAAW;GACH;GACR,QAAQ;EACR,GAhBK,EAAW,CAgBhB,GAGI;CACR,CAAC,IAID,MAAU,IACP,EAAoB,GAAU,CAAK,IACnC,EAAa,GAAU;EACvB,GAAG;EACG;EACN;CACD,CAAC;AAGL;AAEA,EAAO,cAAc"}
@@ -15,7 +15,7 @@ var d = ({ event: e, props: n, fromFocus: r }) => {
15
15
  event: e,
16
16
  data: {
17
17
  node: n.node,
18
- select: !n.node.selected,
18
+ select: !n.isNodeSelected(n.node),
19
19
  treeIndex: n.treeIndex
20
20
  },
21
21
  fromFocus: r
@@ -59,7 +59,7 @@ var d = ({ event: e, props: n, fromFocus: r }) => {
59
59
  data: {
60
60
  node: r,
61
61
  select: !0,
62
- expand: !r.expanded,
62
+ expand: !t.isNodeExpanded(r),
63
63
  treeIndex: t.flattenedNodes[i].treeIndex
64
64
  }
65
65
  });
@@ -80,11 +80,8 @@ var d = ({ event: e, props: n, fromFocus: r }) => {
80
80
  event: e,
81
81
  props: t
82
82
  });
83
- }, b = (e) => {
84
- let t = e.selectedNodeIndexes.length === 0 && e.treeIndex === e.flattenedNodes[0]?.treeIndex;
85
- return e.treeIndex === e.focusedNodeIndex || t ? 0 : -1;
86
- }, x = (e) => {
87
- let t = e.node.selected, n = e.treeIndex === e.focusedNodeIndex;
83
+ }, b = (e) => e.treeIndex === e.tabStopIndex ? 0 : -1, x = (e) => {
84
+ let t = e.isNodeSelected(e.node), n = e.treeIndex === e.focusedNodeIndex;
88
85
  return /* @__PURE__ */ s("li", {
89
86
  id: `${e.treeId}-${e.node.id}`,
90
87
  role: "treeitem",
@@ -104,13 +101,14 @@ var d = ({ event: e, props: n, fromFocus: r }) => {
104
101
  props: e
105
102
  }),
106
103
  children: [/* @__PURE__ */ s(r, {
104
+ "aria-hidden": !0,
107
105
  tabIndex: -1,
108
106
  assistiveText: { icon: "" },
109
107
  iconCategory: "utility",
110
108
  iconName: "chevronright",
111
109
  iconSize: "small",
112
110
  variant: "icon",
113
- className: "slds-m-right_small slds-is-disabled",
111
+ className: "slds-m-right_small slds-is-disabled slds-hidden",
114
112
  disabled: !0
115
113
  }), /* @__PURE__ */ s("span", {
116
114
  className: "slds-size_1-of-1",
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","names":[],"sources":["../../../../../components/tree/private/item.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\n\tlabel: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeId?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tselectedNodeIndexes: string[];\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n}\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: ItemProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.node.selected,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownLeft = (event: React.KeyboardEvent, props: ItemProps) => {\n\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst parent = props.parent as TreeNode;\n\tconst index = findIndex(nodes, { id: parent?.id });\n\tif (index !== -1) {\n\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: parent,\n\t\t\t\tselect: true,\n\t\t\t\texpand: !parent.expanded,\n\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: ItemProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: ItemProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props });\n\t}\n};\n\nconst getTabIndex = (props: ItemProps): number => {\n\tconst initialFocus =\n\t\tprops.selectedNodeIndexes.length === 0 &&\n\t\tprops.treeIndex === props.flattenedNodes[0]?.treeIndex;\n\treturn props.treeIndex === props.focusedNodeIndex || initialFocus ? 0 : -1;\n};\n\n/**\n * A Tree Item is a non-branching node in a hierarchical list.\n */\nconst Item: React.FC<ItemProps> = (props) => {\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\n\treturn (\n\t\t<li\n\t\t\tid={`${props.treeId}-${props.node.id}`}\n\t\t\trole=\"treeitem\"\n\t\t\taria-level={props.level}\n\t\t\taria-selected={isSelected ? 'true' : 'false'}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tassistiveText={{ icon: '' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\tclassName=\"slds-m-right_small slds-is-disabled\"\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\">\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</li>\n\t);\n};\n\nItem.displayName = TREE_ITEM;\n\nexport default Item;\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAM,KAAgB,EACrB,UACA,UACA,mBAKK;CAEL,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,MAAM;GACL,MAAM,EAAM;GACZ,QAAQ,CAAC,EAAM,KAAK;GACpB,WAAW,EAAM;EAClB;EACA;CACD,CAAC;AAEH,GAEM,KAAgB,GAAiC,MAAmB;CACzE,IAAM,IAAQ,EAAe,KAAK,MAAkB,EAAc,IAAI;CAEtE,OAAO,GADO,EAAU,GAAO,EAAE,IAAI,EAAK,GAAG,CACtB,IAAQ,KAAK,EAAe;AACpD,GAEM,KAAoB,GAAiC,M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,CACF;;CACF,CAAA;AAEN;AAEA,EAAK,cAAc"}
1
+ {"version":3,"file":"item.js","names":[],"sources":["../../../../../components/tree/private/item.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\n\tlabel: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeId?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tisNodeSelected: (node: TreeNode) => boolean;\n\tisNodeExpanded: (node: TreeNode) => boolean;\n\ttabStopIndex?: string;\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n}\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: ItemProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.isNodeSelected(props.node),\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownLeft = (event: React.KeyboardEvent, props: ItemProps) => {\n\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst parent = props.parent as TreeNode;\n\tconst index = findIndex(nodes, { id: parent?.id });\n\tif (index !== -1) {\n\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: parent,\n\t\t\t\tselect: true,\n\t\t\t\texpand: !props.isNodeExpanded(parent),\n\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: ItemProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: ItemProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props });\n\t}\n};\n\nconst getTabIndex = (props: ItemProps): number =>\n\tprops.treeIndex === props.tabStopIndex ? 0 : -1;\n\n/**\n * A Tree Item is a non-branching node in a hierarchical list.\n */\nconst Item: React.FC<ItemProps> = (props) => {\n\tconst isSelected = props.isNodeSelected(props.node);\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\n\treturn (\n\t\t<li\n\t\t\tid={`${props.treeId}-${props.node.id}`}\n\t\t\trole=\"treeitem\"\n\t\t\taria-level={props.level}\n\t\t\taria-selected={isSelected ? 'true' : 'false'}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tassistiveText={{ icon: '' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t// `slds-hidden` keeps the chevron's space so leaf labels align with\n\t\t\t\t\t// branch labels; SLDS 2 no longer hides `.slds-is-disabled` here.\n\t\t\t\t\tclassName=\"slds-m-right_small slds-is-disabled slds-hidden\"\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\">\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</li>\n\t);\n};\n\nItem.displayName = TREE_ITEM;\n\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AAD;GACC,WAAW,EAAW,mBAAmB,EACxC,oBAAoB,EACrB,CAAC;GACD,UAAU,MAAU,EAAa;IAAE;IAAO;GAAM,CAAC;GAJlD,UAAA,CAMC,kBAAC,GAAD;IACC,eAAA;IACA,UAAU;IACV,eAAe,EAAE,MAAM,GAAG;IAC1B,cAAa;IACb,UAAS;IACT,UAAS;IACT,SAAQ;IAGR,WAAU;IACV,UAAA;GACA,CAAA,GACD,kBAAC,QAAD;IAAM,WAAU;IACf,UAAA,kBAAC,GAAD;KACC,QAAQ,EAAM;KACd,WAAU;KAET,UAAA,EAAM;IACK,CAAA;GACR,CAAA,CACF;;CACF,CAAA;AAEN;AAEA,EAAK,cAAc"}
@@ -14,7 +14,7 @@ var u = (t, n) => {
14
14
  event: t,
15
15
  data: {
16
16
  node: n.node,
17
- expand: !n.node.expanded,
17
+ expand: !n.isNodeExpanded(n.node),
18
18
  treeIndex: n.treeIndex
19
19
  }
20
20
  });
@@ -23,7 +23,7 @@ var u = (t, n) => {
23
23
  event: t,
24
24
  data: {
25
25
  node: n.node,
26
- select: !n.node.selected,
26
+ select: !n.isNodeSelected(n.node),
27
27
  treeIndex: n.treeIndex
28
28
  },
29
29
  fromFocus: r
@@ -61,12 +61,12 @@ var u = (t, n) => {
61
61
  });
62
62
  }
63
63
  }, g = (e, t) => {
64
- if (t.node.expanded) {
64
+ if (t.isNodeExpanded(t.node)) {
65
65
  let n = t.getNodes?.(t.node);
66
66
  n && n.length > 0 && m(e, t);
67
67
  } else u(e, t);
68
68
  }, _ = (e, t) => {
69
- if (t.node.expanded) u(e, t);
69
+ if (t.isNodeExpanded(t.node)) u(e, t);
70
70
  else {
71
71
  let n = t.flattenedNodes.map((e) => e.node), r = t.parent, i = l(n, { id: r?.id });
72
72
  i !== -1 && t.onExpand({
@@ -74,7 +74,7 @@ var u = (t, n) => {
74
74
  data: {
75
75
  node: r,
76
76
  select: !0,
77
- expand: !r.expanded,
77
+ expand: !t.isNodeExpanded(r),
78
78
  treeIndex: t.flattenedNodes[i].treeIndex
79
79
  }
80
80
  });
@@ -98,11 +98,8 @@ var u = (t, n) => {
98
98
  props: t,
99
99
  fromFocus: !0
100
100
  });
101
- }, x = (e) => {
102
- let t = e.selectedNodeIndexes.length === 0 && e.treeIndex === e.flattenedNodes[0]?.treeIndex;
103
- return e.treeIndex === e.focusedNodeIndex || t ? 0 : -1;
104
- }, S = (e, t) => {
105
- let r = t.node.expanded, c = t.node.selected, l = t.treeIndex === t.focusedNodeIndex, f = t.node.loading, p = /* @__PURE__ */ s("div", {
101
+ }, x = (e) => e.treeIndex === e.tabStopIndex ? 0 : -1, S = (e, t) => {
102
+ let r = t.isNodeExpanded(t.node), c = t.isNodeSelected(t.node), l = t.treeIndex === t.focusedNodeIndex, f = t.node.loading, p = /* @__PURE__ */ s("div", {
106
103
  style: {
107
104
  display: "block",
108
105
  paddingLeft: `${1.5 * t.level + 1.5}rem`,
@@ -158,6 +155,8 @@ var u = (t, n) => {
158
155
  props: t
159
156
  }),
160
157
  children: [/* @__PURE__ */ o(n, {
158
+ "aria-controls": String(t.htmlId),
159
+ "aria-hidden": !0,
161
160
  assistiveText: { icon: "Expand Tree Branch" },
162
161
  iconCategory: "utility",
163
162
  iconName: "chevronright",
@@ -1 +1 @@
1
- {"version":3,"file":"render-branch.js","names":[],"sources":["../../../../../components/tree/private/render-branch.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\nimport classNames from 'classnames';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface RenderBranchProps {\n\thtmlId: string | number;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tselectedNodeIndexes: string[];\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n}\n\nconst handleExpand = (\n\tevent: React.SyntheticEvent,\n\tprops: RenderBranchProps\n) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onExpand)) {\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\texpand: !props.node.expanded,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: RenderBranchProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.node.selected,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownRight = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.node.expanded) {\n\t\tconst childNodes = props.getNodes?.(props.node);\n\t\tif (childNodes && childNodes.length > 0) {\n\t\t\thandleKeyDownDown(event, props);\n\t\t}\n\t} else {\n\t\thandleExpand(event, props);\n\t}\n};\n\nconst handleKeyDownLeft = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.node.expanded) {\n\t\thandleExpand(event, props);\n\t} else {\n\t\tconst nodes = props.flattenedNodes.map(\n\t\t\t(flattenedNode) => flattenedNode.node\n\t\t);\n\t\tconst parent = props.parent as TreeNode;\n\t\tconst index = findIndex(nodes, { id: parent?.id });\n\t\tif (index !== -1) {\n\t\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\t\tprops.onExpand({\n\t\t\t\tevent,\n\t\t\t\tdata: {\n\t\t\t\t\tnode: parent,\n\t\t\t\t\tselect: true,\n\t\t\t\t\texpand: !parent.expanded,\n\t\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n};\n\nconst handleKeyDownEnter = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.RIGHT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownRight(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: RenderBranchProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props, fromFocus: true });\n\t}\n};\n\nconst getTabIndex = (props: RenderBranchProps): number => {\n\tconst initialFocus =\n\t\tprops.selectedNodeIndexes.length === 0 &&\n\t\tprops.treeIndex === props.flattenedNodes[0]?.treeIndex;\n\treturn props.treeIndex === props.focusedNodeIndex || initialFocus ? 0 : -1;\n};\n\n/**\n * Renders a branch node in the tree.\n */\nconst RenderBranch = (\n\tchildren: ReactNode,\n\tprops: RenderBranchProps\n): React.ReactElement => {\n\tconst isExpanded = props.node.expanded;\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\tconst isLoading = props.node.loading;\n\n\tconst loader = (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'block',\n\t\t\t\tpaddingLeft: `${1.5 * props.level + 1.5}rem`,\n\t\t\t\tmarginTop: '.5rem',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '40%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '80%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '60%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst label =\n\t\tprops.node.assistiveText ||\n\t\t(typeof props.node.label === 'string' ? props.node.label : null);\n\n\t// aria-level and aria-expanded are valid for elements with role=\"treeitem\"\n\tconst ariaProps = {\n\t\t'aria-level': props.level,\n\t\t'aria-expanded': isExpanded ? ('true' as const) : ('false' as const),\n\t\t'aria-label':\n\t\t\tprops.node.nodes && props.node.nodes.length > 0 ? label : undefined,\n\t};\n\n\treturn (\n\t\t// @ts-expect-error - aria-level is valid for treeitem role but not in React types\n\t\t<li\n\t\t\tid={String(props.htmlId)}\n\t\t\trole=\"treeitem\"\n\t\t\t{...ariaProps}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: 'Expand Tree Branch' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\tclassName=\"slds-m-right_small\"\n\t\t\t\t\tonClick={(event) => handleExpand(event, props)}\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\" id={`${props.htmlId}__label`}>\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t{isLoading ? loader : null}\n\t\t\t<ul\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t'slds-is-expanded': isExpanded,\n\t\t\t\t\t'slds-is-collapsed': !isExpanded,\n\t\t\t\t})}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-labelledby={`${props.htmlId}__label`}\n\t\t\t>\n\t\t\t\t{isExpanded && !isLoading ? children : null}\n\t\t\t</ul>\n\t\t</li>\n\t);\n};\n\nRenderBranch.displayName = 'Branch';\n\nexport default RenderBranch;\n"],"mappings":";;;;;;;;;;;AAmDA,IAAM,KACL,GACA,MACI;CAEJ,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,MAAM;GACL,MAAM,EAAM;GACZ,QAAQ,CAAC,EAAM,KAAK;GACpB,WAAW,EAAM;EAClB;CACD,CAAC;AAEH,GAEM,KAAgB,EACrB,UACA,UACA,mBAKK;CAEL,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,MAAM;GACL,MAAM,EAAM;GACZ,QAAQ,CAAC,EAAM,KAAK;GACpB,WAAW,EAAM;EAClB;EACA;CACD,CAAC;AAEH,GAEM,KAAgB,GAAiC,MAAmB;CACzE,IAAM,IAAQ,EAAe,KAAK,MAAkB,EAAc,IAAI;CAEtE,OAAO,GADO,EAAU,GAAO,EAAE,IAAI,EAAK,GAAG,CACtB,IAAQ,KAAK,EAAe;AACpD,GAEM,KAAoB,GAAiC,MAAmB;CAC7E,IAAM,IAAQ,EAAe,KAAK,MAAkB,EAAc,IAAI,GAClE,IAAQ,EAAU,GAAO,EAAE,IAAI,EAAK,GAAG,CAAC,IAAI;CAIhD,OAHI,IAAQ,M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AAM,KAAK,QAAQ,OAGtD,IAAY;EACjB,cAAc,EAAM;EACpB,iBAAiB,IAAc,SAAoB;EACnD,cACC,EAAM,KAAK,SAAS,EAAM,KAAK,MAAM,SAAS,IAAI,IAAQ,KAAA;CAC5D;CAEA,OAEC,kBAAC,MAAD;EACC,IAAI,OAAO,EAAM,MAAM;EACvB,MAAK;EACL,GAAI;EACJ,UAAU,EAAY,CAAK;EAC3B,YAAY,MAAU,EAAc,GAAO,CAAK;EAChD,UAAU,MAAU,EAAY,GAAO,CAAK;EAC5C,QAAQ,EAAM;EACd,MAAM,MAAc;GACnB,AAAI,EAAM,gBAAgB,KAAa,KACtC,EAAU,MAAM;EAElB;EAZD,UAAA;GAcC,kBAAC,OAAD;IACC,WAAW,EAAW,mBAAmB,EACxC,oBAAoB,EACrB,CAAC;IACD,UAAU,MAAU,EAAa;KAAE;KAAO;IAAM,CAAC;IAJlD,UAAA,CAMC,kBAAC,GAAD;KACC,eAAe,EAAE,MAAM,qBAAqB;KAC5C,cAAa;KACb,UAAS;KACT,UAAS;KACT,SAAQ;KACR,WAAU;KACV,UAAU,MAAU,EAAa,GAAO,CAAK;KAC7C,UAAU;IACV,CAAA,GACD,kBAAC,QAAD;KAAM,WAAU;KAAmB,IAAI,GAAG,EAAM,OAAO;KACtD,UAAA,kBAAC,GAAD;MACC,QAAQ,EAAM;MACd,WAAU;MAET,UAAA,EAAM;KACK,CAAA;IACR,CAAA,CACF;;GACJ,IAAY,IAAS;GACtB,kBAAC,MAAD;IACC,WAAW,EAAW;KACrB,oBAAoB;KACpB,qBAAqB,CAAC;IACvB,CAAC;IACD,MAAK;IACL,mBAAiB,GAAG,EAAM,OAAO;IAEhC,UAAA,KAAc,CAAC,IAAY,IAAW;GACpC,CAAA;EACD;;AAEN;AAEA,EAAa,cAAc"}
1
+ {"version":3,"file":"render-branch.js","names":[],"sources":["../../../../../components/tree/private/render-branch.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\nimport classNames from 'classnames';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface RenderBranchProps {\n\thtmlId: string | number;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tisNodeSelected: (node: TreeNode) => boolean;\n\tisNodeExpanded: (node: TreeNode) => boolean;\n\ttabStopIndex?: string;\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n}\n\nconst handleExpand = (\n\tevent: React.SyntheticEvent,\n\tprops: RenderBranchProps\n) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onExpand)) {\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\texpand: !props.isNodeExpanded(props.node),\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: RenderBranchProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.isNodeSelected(props.node),\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownRight = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.isNodeExpanded(props.node)) {\n\t\tconst childNodes = props.getNodes?.(props.node);\n\t\tif (childNodes && childNodes.length > 0) {\n\t\t\thandleKeyDownDown(event, props);\n\t\t}\n\t} else {\n\t\thandleExpand(event, props);\n\t}\n};\n\nconst handleKeyDownLeft = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.isNodeExpanded(props.node)) {\n\t\thandleExpand(event, props);\n\t} else {\n\t\tconst nodes = props.flattenedNodes.map(\n\t\t\t(flattenedNode) => flattenedNode.node\n\t\t);\n\t\tconst parent = props.parent as TreeNode;\n\t\tconst index = findIndex(nodes, { id: parent?.id });\n\t\tif (index !== -1) {\n\t\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\t\tprops.onExpand({\n\t\t\t\tevent,\n\t\t\t\tdata: {\n\t\t\t\t\tnode: parent,\n\t\t\t\t\tselect: true,\n\t\t\t\t\texpand: !props.isNodeExpanded(parent),\n\t\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n};\n\nconst handleKeyDownEnter = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.RIGHT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownRight(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: RenderBranchProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props, fromFocus: true });\n\t}\n};\n\nconst getTabIndex = (props: RenderBranchProps): number =>\n\tprops.treeIndex === props.tabStopIndex ? 0 : -1;\n\n/**\n * Renders a branch node in the tree.\n */\nconst RenderBranch = (\n\tchildren: ReactNode,\n\tprops: RenderBranchProps\n): React.ReactElement => {\n\tconst isExpanded = props.isNodeExpanded(props.node);\n\tconst isSelected = props.isNodeSelected(props.node);\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\tconst isLoading = props.node.loading;\n\n\tconst loader = (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'block',\n\t\t\t\tpaddingLeft: `${1.5 * props.level + 1.5}rem`,\n\t\t\t\tmarginTop: '.5rem',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '40%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '80%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '60%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst label =\n\t\tprops.node.assistiveText ||\n\t\t(typeof props.node.label === 'string' ? props.node.label : null);\n\n\t// aria-level and aria-expanded are valid for elements with role=\"treeitem\"\n\tconst ariaProps = {\n\t\t'aria-level': props.level,\n\t\t'aria-expanded': isExpanded ? ('true' as const) : ('false' as const),\n\t\t'aria-label':\n\t\t\tprops.node.nodes && props.node.nodes.length > 0 ? label : undefined,\n\t};\n\n\treturn (\n\t\t// @ts-expect-error - aria-level is valid for treeitem role but not in React types\n\t\t<li\n\t\t\tid={String(props.htmlId)}\n\t\t\trole=\"treeitem\"\n\t\t\t{...ariaProps}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t// SLDS 1 only rotates the chevron when `aria-controls` is set.\n\t\t\t\t\taria-controls={String(props.htmlId)}\n\t\t\t\t\taria-hidden\n\t\t\t\t\tassistiveText={{ icon: 'Expand Tree Branch' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\tclassName=\"slds-m-right_small\"\n\t\t\t\t\tonClick={(event) => handleExpand(event, props)}\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\" id={`${props.htmlId}__label`}>\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t{isLoading ? loader : null}\n\t\t\t<ul\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t'slds-is-expanded': isExpanded,\n\t\t\t\t\t'slds-is-collapsed': !isExpanded,\n\t\t\t\t})}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-labelledby={`${props.htmlId}__label`}\n\t\t\t>\n\t\t\t\t{isExpanded && !isLoading ? children : null}\n\t\t\t</ul>\n\t\t</li>\n\t);\n};\n\nRenderBranch.displayName = 'Branch';\n\nexport default RenderBranch;\n"],"mappings":";;;;;;;;;;;AAqDA,IAAM,KACL,GACA,MACI;CAEJ,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,MAAM;GACL,MAAM,EAAM;GACZ,QAAQ,CAAC,EAAM,eAAe,EAAM,IAAI;GACxC,WAAW,EAAM;EAClB;CACD,CAAC;AAEH,GAEM,KAAgB,EACrB,UACA,UACA,mBAKK;CAEL,AADA,EAAU,KAAK,CAAK,GAChB,EAA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