@salesforce/design-system-react 11.0.0-alpha.2 → 11.0.0-alpha.3

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 (311) hide show
  1. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  2. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  3. package/dist/cjs/components/data-table/highlight-cell.cjs +1 -1
  4. package/dist/cjs/components/data-table/index.cjs +1 -1
  5. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  6. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  7. package/dist/cjs/components/date-picker/index.cjs +1 -1
  8. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  9. package/dist/cjs/components/illustration/check-props.cjs +2 -0
  10. package/dist/cjs/components/illustration/check-props.cjs.map +1 -0
  11. package/dist/cjs/components/illustration/index.cjs +1 -1
  12. package/dist/cjs/components/illustration/index.cjs.map +1 -1
  13. package/dist/cjs/components/index.cjs +1 -1
  14. package/dist/cjs/components/modal/trigger.cjs +1 -1
  15. package/dist/cjs/components/pill/index.cjs +1 -1
  16. package/dist/cjs/components/pill/index.cjs.map +1 -1
  17. package/dist/cjs/components/pill-container/index.cjs +1 -1
  18. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  19. package/dist/cjs/components/pill-container/private/selected-listbox.cjs +1 -1
  20. package/dist/cjs/components/pill-container/private/selected-listbox.cjs.map +1 -1
  21. package/dist/cjs/components/tree/private/item.cjs +1 -1
  22. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  23. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  24. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  25. package/dist/cjs/utilities/constants.cjs +1 -1
  26. package/dist/cjs/utilities/constants.cjs.map +1 -1
  27. package/dist/es/components/combobox/combobox.js +131 -117
  28. package/dist/es/components/combobox/combobox.js.map +1 -1
  29. package/dist/es/components/data-table/highlight-cell.js +4 -4
  30. package/dist/es/components/data-table/index.js +9 -9
  31. package/dist/es/components/date-picker/date-picker.js +150 -145
  32. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  33. package/dist/es/components/date-picker/index.js +6 -18
  34. package/dist/es/components/date-picker/index.js.map +1 -1
  35. package/dist/es/components/illustration/check-props.js +11 -0
  36. package/dist/es/components/illustration/check-props.js.map +1 -0
  37. package/dist/es/components/illustration/index.js +37 -25
  38. package/dist/es/components/illustration/index.js.map +1 -1
  39. package/dist/es/components/index.js +89 -115
  40. package/dist/es/components/modal/trigger.js +4 -4
  41. package/dist/es/components/pill/index.js +32 -30
  42. package/dist/es/components/pill/index.js.map +1 -1
  43. package/dist/es/components/pill-container/index.js +1 -0
  44. package/dist/es/components/pill-container/index.js.map +1 -1
  45. package/dist/es/components/pill-container/private/selected-listbox.js +3 -1
  46. package/dist/es/components/pill-container/private/selected-listbox.js.map +1 -1
  47. package/dist/es/components/tree/private/item.js +4 -4
  48. package/dist/es/components/tree/private/render-branch.js +9 -9
  49. package/dist/es/components/utilities/dialog/index.js +2 -2
  50. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  51. package/dist/es/utilities/constants.js +2 -2
  52. package/dist/es/utilities/constants.js.map +1 -1
  53. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  54. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  55. package/dist/types/components/date-picker/index.d.ts +6 -2
  56. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  57. package/dist/types/components/illustration/index.d.ts.map +1 -1
  58. package/dist/types/components/index.d.ts +0 -52
  59. package/dist/types/components/index.d.ts.map +1 -1
  60. package/dist/types/components/pill/index.d.ts +4 -0
  61. package/dist/types/components/pill/index.d.ts.map +1 -1
  62. package/dist/types/components/pill-container/index.d.ts.map +1 -1
  63. package/dist/types/components/pill-container/private/selected-listbox.d.ts +7 -1
  64. package/dist/types/components/pill-container/private/selected-listbox.d.ts.map +1 -1
  65. package/package.json +4 -1
  66. package/dist/cjs/components/app-launcher/check-props.cjs +0 -2
  67. package/dist/cjs/components/app-launcher/check-props.cjs.map +0 -1
  68. package/dist/cjs/components/app-launcher/component.cjs +0 -2
  69. package/dist/cjs/components/app-launcher/component.cjs.map +0 -1
  70. package/dist/cjs/components/app-launcher/expandable-section.cjs +0 -2
  71. package/dist/cjs/components/app-launcher/expandable-section.cjs.map +0 -1
  72. package/dist/cjs/components/app-launcher/index.cjs +0 -2
  73. package/dist/cjs/components/app-launcher/index.cjs.map +0 -1
  74. package/dist/cjs/components/app-launcher/link.cjs +0 -2
  75. package/dist/cjs/components/app-launcher/link.cjs.map +0 -1
  76. package/dist/cjs/components/app-launcher/tile.cjs +0 -2
  77. package/dist/cjs/components/app-launcher/tile.cjs.map +0 -1
  78. package/dist/cjs/components/app-launcher.cjs +0 -1
  79. package/dist/cjs/components/brand-band/index.cjs +0 -2
  80. package/dist/cjs/components/brand-band/index.cjs.map +0 -1
  81. package/dist/cjs/components/brand-band.cjs +0 -1
  82. package/dist/cjs/components/expression/condition.cjs +0 -2
  83. package/dist/cjs/components/expression/condition.cjs.map +0 -1
  84. package/dist/cjs/components/expression/formula.cjs +0 -2
  85. package/dist/cjs/components/expression/formula.cjs.map +0 -1
  86. package/dist/cjs/components/expression/group.cjs +0 -2
  87. package/dist/cjs/components/expression/group.cjs.map +0 -1
  88. package/dist/cjs/components/expression/index.cjs +0 -2
  89. package/dist/cjs/components/expression/index.cjs.map +0 -1
  90. package/dist/cjs/components/expression.cjs +0 -1
  91. package/dist/cjs/components/global-header/button.cjs +0 -2
  92. package/dist/cjs/components/global-header/button.cjs.map +0 -1
  93. package/dist/cjs/components/global-header/check-props.cjs +0 -2
  94. package/dist/cjs/components/global-header/check-props.cjs.map +0 -1
  95. package/dist/cjs/components/global-header/dropdown.cjs +0 -2
  96. package/dist/cjs/components/global-header/dropdown.cjs.map +0 -1
  97. package/dist/cjs/components/global-header/favorites.cjs +0 -2
  98. package/dist/cjs/components/global-header/favorites.cjs.map +0 -1
  99. package/dist/cjs/components/global-header/help.cjs +0 -2
  100. package/dist/cjs/components/global-header/help.cjs.map +0 -1
  101. package/dist/cjs/components/global-header/index.cjs +0 -2
  102. package/dist/cjs/components/global-header/index.cjs.map +0 -1
  103. package/dist/cjs/components/global-header/notifications.cjs +0 -2
  104. package/dist/cjs/components/global-header/notifications.cjs.map +0 -1
  105. package/dist/cjs/components/global-header/private/dropdown-trigger.cjs +0 -2
  106. package/dist/cjs/components/global-header/private/dropdown-trigger.cjs.map +0 -1
  107. package/dist/cjs/components/global-header/profile.cjs +0 -2
  108. package/dist/cjs/components/global-header/profile.cjs.map +0 -1
  109. package/dist/cjs/components/global-header/search.cjs +0 -2
  110. package/dist/cjs/components/global-header/search.cjs.map +0 -1
  111. package/dist/cjs/components/global-header/setup.cjs +0 -2
  112. package/dist/cjs/components/global-header/setup.cjs.map +0 -1
  113. package/dist/cjs/components/global-header/task.cjs +0 -2
  114. package/dist/cjs/components/global-header/task.cjs.map +0 -1
  115. package/dist/cjs/components/global-header.cjs +0 -1
  116. package/dist/cjs/components/global-navigation-bar/button.cjs +0 -2
  117. package/dist/cjs/components/global-navigation-bar/button.cjs.map +0 -1
  118. package/dist/cjs/components/global-navigation-bar/check-props.cjs +0 -2
  119. package/dist/cjs/components/global-navigation-bar/check-props.cjs.map +0 -1
  120. package/dist/cjs/components/global-navigation-bar/component.cjs +0 -2
  121. package/dist/cjs/components/global-navigation-bar/component.cjs.map +0 -1
  122. package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs +0 -2
  123. package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs.map +0 -1
  124. package/dist/cjs/components/global-navigation-bar/dropdown.cjs +0 -2
  125. package/dist/cjs/components/global-navigation-bar/dropdown.cjs.map +0 -1
  126. package/dist/cjs/components/global-navigation-bar/index.cjs +0 -2
  127. package/dist/cjs/components/global-navigation-bar/index.cjs.map +0 -1
  128. package/dist/cjs/components/global-navigation-bar/label.cjs +0 -2
  129. package/dist/cjs/components/global-navigation-bar/label.cjs.map +0 -1
  130. package/dist/cjs/components/global-navigation-bar/link.cjs +0 -2
  131. package/dist/cjs/components/global-navigation-bar/link.cjs.map +0 -1
  132. package/dist/cjs/components/global-navigation-bar/region.cjs +0 -2
  133. package/dist/cjs/components/global-navigation-bar/region.cjs.map +0 -1
  134. package/dist/cjs/components/global-navigation-bar.cjs +0 -1
  135. package/dist/cjs/components/location-map/index.cjs +0 -2
  136. package/dist/cjs/components/location-map/index.cjs.map +0 -1
  137. package/dist/cjs/components/location-map.cjs +0 -1
  138. package/dist/cjs/components/utilities/truncate/index.cjs +0 -2
  139. package/dist/cjs/components/utilities/truncate/index.cjs.map +0 -1
  140. package/dist/cjs/components/utilities/truncate.cjs +0 -1
  141. package/dist/cjs/utilities/warning/one-of-component.cjs +0 -2
  142. package/dist/cjs/utilities/warning/one-of-component.cjs.map +0 -1
  143. package/dist/es/components/app-launcher/check-props.js +0 -17
  144. package/dist/es/components/app-launcher/check-props.js.map +0 -1
  145. package/dist/es/components/app-launcher/component.js +0 -31
  146. package/dist/es/components/app-launcher/component.js.map +0 -1
  147. package/dist/es/components/app-launcher/expandable-section.js +0 -42
  148. package/dist/es/components/app-launcher/expandable-section.js.map +0 -1
  149. package/dist/es/components/app-launcher/index.js +0 -96
  150. package/dist/es/components/app-launcher/index.js.map +0 -1
  151. package/dist/es/components/app-launcher/link.js +0 -29
  152. package/dist/es/components/app-launcher/link.js.map +0 -1
  153. package/dist/es/components/app-launcher/tile.js +0 -101
  154. package/dist/es/components/app-launcher/tile.js.map +0 -1
  155. package/dist/es/components/app-launcher.js +0 -2
  156. package/dist/es/components/brand-band/index.js +0 -27
  157. package/dist/es/components/brand-band/index.js.map +0 -1
  158. package/dist/es/components/brand-band.js +0 -2
  159. package/dist/es/components/expression/condition.js +0 -124
  160. package/dist/es/components/expression/condition.js.map +0 -1
  161. package/dist/es/components/expression/formula.js +0 -105
  162. package/dist/es/components/expression/formula.js.map +0 -1
  163. package/dist/es/components/expression/group.js +0 -153
  164. package/dist/es/components/expression/group.js.map +0 -1
  165. package/dist/es/components/expression/index.js +0 -33
  166. package/dist/es/components/expression/index.js.map +0 -1
  167. package/dist/es/components/expression.js +0 -2
  168. package/dist/es/components/global-header/button.js +0 -19
  169. package/dist/es/components/global-header/button.js.map +0 -1
  170. package/dist/es/components/global-header/check-props.js +0 -20
  171. package/dist/es/components/global-header/check-props.js.map +0 -1
  172. package/dist/es/components/global-header/dropdown.js +0 -33
  173. package/dist/es/components/global-header/dropdown.js.map +0 -1
  174. package/dist/es/components/global-header/favorites.js +0 -74
  175. package/dist/es/components/global-header/favorites.js.map +0 -1
  176. package/dist/es/components/global-header/help.js +0 -39
  177. package/dist/es/components/global-header/help.js.map +0 -1
  178. package/dist/es/components/global-header/index.js +0 -90
  179. package/dist/es/components/global-header/index.js.map +0 -1
  180. package/dist/es/components/global-header/notifications.js +0 -51
  181. package/dist/es/components/global-header/notifications.js.map +0 -1
  182. package/dist/es/components/global-header/private/dropdown-trigger.js +0 -50
  183. package/dist/es/components/global-header/private/dropdown-trigger.js.map +0 -1
  184. package/dist/es/components/global-header/profile.js +0 -47
  185. package/dist/es/components/global-header/profile.js.map +0 -1
  186. package/dist/es/components/global-header/search.js +0 -12
  187. package/dist/es/components/global-header/search.js.map +0 -1
  188. package/dist/es/components/global-header/setup.js +0 -39
  189. package/dist/es/components/global-header/setup.js.map +0 -1
  190. package/dist/es/components/global-header/task.js +0 -38
  191. package/dist/es/components/global-header/task.js.map +0 -1
  192. package/dist/es/components/global-header.js +0 -2
  193. package/dist/es/components/global-navigation-bar/button.js +0 -22
  194. package/dist/es/components/global-navigation-bar/button.js.map +0 -1
  195. package/dist/es/components/global-navigation-bar/check-props.js +0 -13
  196. package/dist/es/components/global-navigation-bar/check-props.js.map +0 -1
  197. package/dist/es/components/global-navigation-bar/component.js +0 -43
  198. package/dist/es/components/global-navigation-bar/component.js.map +0 -1
  199. package/dist/es/components/global-navigation-bar/dropdown-trigger.js +0 -66
  200. package/dist/es/components/global-navigation-bar/dropdown-trigger.js.map +0 -1
  201. package/dist/es/components/global-navigation-bar/dropdown.js +0 -34
  202. package/dist/es/components/global-navigation-bar/dropdown.js.map +0 -1
  203. package/dist/es/components/global-navigation-bar/index.js +0 -27
  204. package/dist/es/components/global-navigation-bar/index.js.map +0 -1
  205. package/dist/es/components/global-navigation-bar/label.js +0 -25
  206. package/dist/es/components/global-navigation-bar/label.js.map +0 -1
  207. package/dist/es/components/global-navigation-bar/link.js +0 -50
  208. package/dist/es/components/global-navigation-bar/link.js.map +0 -1
  209. package/dist/es/components/global-navigation-bar/region.js +0 -50
  210. package/dist/es/components/global-navigation-bar/region.js.map +0 -1
  211. package/dist/es/components/global-navigation-bar.js +0 -2
  212. package/dist/es/components/location-map/index.js +0 -75
  213. package/dist/es/components/location-map/index.js.map +0 -1
  214. package/dist/es/components/location-map.js +0 -2
  215. package/dist/es/components/utilities/truncate/index.js +0 -91
  216. package/dist/es/components/utilities/truncate/index.js.map +0 -1
  217. package/dist/es/components/utilities/truncate.js +0 -2
  218. package/dist/es/utilities/warning/one-of-component.js +0 -15
  219. package/dist/es/utilities/warning/one-of-component.js.map +0 -1
  220. package/dist/types/components/app-launcher/check-props.d.ts +0 -3
  221. package/dist/types/components/app-launcher/check-props.d.ts.map +0 -1
  222. package/dist/types/components/app-launcher/expandable-section.d.ts +0 -62
  223. package/dist/types/components/app-launcher/expandable-section.d.ts.map +0 -1
  224. package/dist/types/components/app-launcher/index.d.ts +0 -48
  225. package/dist/types/components/app-launcher/index.d.ts.map +0 -1
  226. package/dist/types/components/app-launcher/link.d.ts +0 -39
  227. package/dist/types/components/app-launcher/link.d.ts.map +0 -1
  228. package/dist/types/components/app-launcher/section.d.ts +0 -55
  229. package/dist/types/components/app-launcher/section.d.ts.map +0 -1
  230. package/dist/types/components/app-launcher/tile.d.ts +0 -74
  231. package/dist/types/components/app-launcher/tile.d.ts.map +0 -1
  232. package/dist/types/components/app-launcher.d.ts +0 -2
  233. package/dist/types/components/brand-band/check-props.d.ts +0 -3
  234. package/dist/types/components/brand-band/check-props.d.ts.map +0 -1
  235. package/dist/types/components/brand-band/index.d.ts +0 -39
  236. package/dist/types/components/brand-band/index.d.ts.map +0 -1
  237. package/dist/types/components/brand-band.d.ts +0 -2
  238. package/dist/types/components/bread-crumb/index.d.ts +0 -3
  239. package/dist/types/components/bread-crumb/index.d.ts.map +0 -1
  240. package/dist/types/components/bread-crumb.d.ts +0 -2
  241. package/dist/types/components/expression/condition.d.ts +0 -105
  242. package/dist/types/components/expression/condition.d.ts.map +0 -1
  243. package/dist/types/components/expression/formula.d.ts +0 -88
  244. package/dist/types/components/expression/formula.d.ts.map +0 -1
  245. package/dist/types/components/expression/group.d.ts +0 -114
  246. package/dist/types/components/expression/group.d.ts.map +0 -1
  247. package/dist/types/components/expression/index.d.ts +0 -72
  248. package/dist/types/components/expression/index.d.ts.map +0 -1
  249. package/dist/types/components/expression.d.ts +0 -2
  250. package/dist/types/components/forms/input/index.d.ts +0 -3
  251. package/dist/types/components/forms/input/index.d.ts.map +0 -1
  252. package/dist/types/components/forms/input/search.d.ts +0 -3
  253. package/dist/types/components/forms/input/search.d.ts.map +0 -1
  254. package/dist/types/components/forms/input.d.ts +0 -2
  255. package/dist/types/components/forms/radio/index.d.ts +0 -3
  256. package/dist/types/components/forms/radio/index.d.ts.map +0 -1
  257. package/dist/types/components/forms/radio.d.ts +0 -2
  258. package/dist/types/components/forms/textarea/index.d.ts +0 -3
  259. package/dist/types/components/forms/textarea/index.d.ts.map +0 -1
  260. package/dist/types/components/forms/textarea.d.ts +0 -2
  261. package/dist/types/components/global-header/button.d.ts +0 -15
  262. package/dist/types/components/global-header/button.d.ts.map +0 -1
  263. package/dist/types/components/global-header/check-props.d.ts +0 -3
  264. package/dist/types/components/global-header/check-props.d.ts.map +0 -1
  265. package/dist/types/components/global-header/dropdown.d.ts +0 -59
  266. package/dist/types/components/global-header/dropdown.d.ts.map +0 -1
  267. package/dist/types/components/global-header/favorites.d.ts +0 -42
  268. package/dist/types/components/global-header/favorites.d.ts.map +0 -1
  269. package/dist/types/components/global-header/help.d.ts +0 -25
  270. package/dist/types/components/global-header/help.d.ts.map +0 -1
  271. package/dist/types/components/global-header/index.d.ts +0 -38
  272. package/dist/types/components/global-header/index.d.ts.map +0 -1
  273. package/dist/types/components/global-header/notifications.d.ts +0 -33
  274. package/dist/types/components/global-header/notifications.d.ts.map +0 -1
  275. package/dist/types/components/global-header/private/dropdown-trigger.d.ts +0 -78
  276. package/dist/types/components/global-header/private/dropdown-trigger.d.ts.map +0 -1
  277. package/dist/types/components/global-header/profile.d.ts +0 -38
  278. package/dist/types/components/global-header/profile.d.ts.map +0 -1
  279. package/dist/types/components/global-header/search.d.ts +0 -14
  280. package/dist/types/components/global-header/search.d.ts.map +0 -1
  281. package/dist/types/components/global-header/setup.d.ts +0 -25
  282. package/dist/types/components/global-header/setup.d.ts.map +0 -1
  283. package/dist/types/components/global-header/task.d.ts +0 -25
  284. package/dist/types/components/global-header/task.d.ts.map +0 -1
  285. package/dist/types/components/global-header.d.ts +0 -2
  286. package/dist/types/components/global-navigation-bar/button.d.ts +0 -18
  287. package/dist/types/components/global-navigation-bar/button.d.ts.map +0 -1
  288. package/dist/types/components/global-navigation-bar/check-props.d.ts +0 -3
  289. package/dist/types/components/global-navigation-bar/check-props.d.ts.map +0 -1
  290. package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts +0 -88
  291. package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts.map +0 -1
  292. package/dist/types/components/global-navigation-bar/dropdown.d.ts +0 -64
  293. package/dist/types/components/global-navigation-bar/dropdown.d.ts.map +0 -1
  294. package/dist/types/components/global-navigation-bar/index.d.ts +0 -35
  295. package/dist/types/components/global-navigation-bar/index.d.ts.map +0 -1
  296. package/dist/types/components/global-navigation-bar/label.d.ts +0 -25
  297. package/dist/types/components/global-navigation-bar/label.d.ts.map +0 -1
  298. package/dist/types/components/global-navigation-bar/link.d.ts +0 -84
  299. package/dist/types/components/global-navigation-bar/link.d.ts.map +0 -1
  300. package/dist/types/components/global-navigation-bar/region.d.ts +0 -36
  301. package/dist/types/components/global-navigation-bar/region.d.ts.map +0 -1
  302. package/dist/types/components/global-navigation-bar.d.ts +0 -2
  303. package/dist/types/components/location-map/index.d.ts +0 -49
  304. package/dist/types/components/location-map/index.d.ts.map +0 -1
  305. package/dist/types/components/location-map.d.ts +0 -2
  306. package/dist/types/components/navigation/index.d.ts +0 -3
  307. package/dist/types/components/navigation/index.d.ts.map +0 -1
  308. package/dist/types/components/navigation.d.ts +0 -2
  309. package/dist/types/components/popover-tooltip/index.d.ts +0 -3
  310. package/dist/types/components/popover-tooltip/index.d.ts.map +0 -1
  311. package/dist/types/components/popover-tooltip.d.ts +0 -2
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../../utilities/key-code.cjs"),a=require("../utilities/dialog/index.cjs"),ee=require("../button/index.cjs"),te=require("../../utilities/key-buffer.cjs"),o=require("../input/private/inner-input.cjs"),ne=require("../tooltip/private/field-level-help-tooltip.cjs"),s=require("../icon/input-icon/index.cjs"),re=require("../popover/index.cjs"),ie=require("./private/menu.cjs"),ae=require("../forms/private/label.cjs"),oe=require("../../utilities/key-callbacks.cjs"),se=require("../pill-container/private/selected-listbox.cjs"),ce=require("../../utilities/key-letter-menu-item-select.cjs"),le=require("../../utilities/menu-item-select-scroll.cjs"),ue=require("./check-props.cjs"),de=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),fe=require("dequal"),pe=require("lodash.isfunction");pe=e.__toESM(pe,1);let d=require("lodash.assign");d=e.__toESM(d,1);let me=require("lodash.findindex");me=e.__toESM(me,1);let he=require("lodash.find");he=e.__toESM(he,1);let ge=require("lodash.reject");ge=e.__toESM(ge,1);var f,_e=typeof document<`u`,ve={label:``,loadingMenuItems:`Loading`,optionSelectedInMenu:`Current Selection:`,popoverLabel:``,removeSingleSelectedOption:`Remove selected option`,removePill:`, Press delete or backspace to remove`,selectedListboxLabel:`Selected Options:`},ye={deselectOption:`None`,label:``,cancelButton:`Cancel`,doneButton:`Done`,multipleOptionsSelected:``,noOptionsFound:`No matches found.`,placeholder:``,placeholderReadOnly:`Select an Option`,removePillTitle:`Remove`,optionDisabledTooltipLabel:`This option is disabled.`,inputIconTitle:``},be={},xe=e=>{let{assistiveText:xe={},"aria-describedby":Se,className:p,classNameContainer:Ce,classNameMenu:we,classNameMenuSubHeader:Te,defaultValue:m,disabled:Ee,entityCombobox:De,errorText:h,events:Oe={},fieldLevelHelpTooltip:ke,hasDeselect:Ae,hasInputSpinner:je,hasMenuSpinner:Me,hasStaticAlignment:Ne,id:Pe,inheritWidthOf:Fe=`target`,input:Ie,inputRef:Le,isOpen:g,labels:Re={},menuItemVisibleLength:ze,menuMaxWidth:Be,menuPosition:Ve=`absolute`,multiple:_,onRenderMenuItem:He,options:v=[],optionsAddItem:Ue=[],optionsSearchEntity:We=[],popover:y,predefinedOptionsOnly:b,required:x=!1,selection:S=[],selectedListboxRef:Ge,singleInputDisabled:Ke=!1,tooltipMenuItemDisabled:qe,value:C,variant:w=`base`,menuItem:Je}=e,T=(0,d.default)({},ve,xe),E=(0,d.default)({},ye,Re),D=(0,d.default)({},be,Oe),Ye=(0,c.useContext)(n.IconSettingsContext),O=(0,c.useRef)(null),k=(0,c.useRef)(null),Xe=(0,c.useRef)(null),Ze=(0,c.useRef)(null),Qe=(0,c.useRef)(null),$e=(0,c.useRef)(new te.default),et=(0,c.useRef)(r.default()),tt=(0,c.useRef)(r.default()),A=(0,c.useCallback)(()=>Pe||et.current,[Pe]),nt=`${A()}-deselect`,[j,M]=(0,c.useState)(void 0),[N,P]=(0,c.useState)(-1),[F,I]=(0,c.useState)(S?.[0]),[L,R]=(0,c.useState)(0),[rt,z]=(0,c.useState)(!1),[B,it]=(0,c.useState)(typeof g==`boolean`&&g),[at,ot]=(0,c.useState)(!1);(0,c.useEffect)(()=>{ue.default(t.COMBOBOX,e,de.default)},[]);let V=(0,c.useCallback)(()=>!!(typeof g==`boolean`?g:B),[g,B]),st=(0,c.useCallback)(()=>j&&N!==-1,[j,N]),H=(0,c.useCallback)(()=>Se||h&&tt.current,[Se,h]),U=(0,c.useCallback)(()=>{let e={id:nt,label:E.deselectOption,value:``,type:`deselect`},t=We.map(e=>({...e,type:`header`,id:e.id||``})),n=Ue.map(e=>({...e,type:`footer`,id:e.id||``}));return[...t.length>0?t:[],...Ae?[e]:[],...v&&v.length>0?v:[],...n.length>0?n:[]]},[nt,E.deselectOption,We,Ue,Ae,v]),ct=(0,c.useCallback)(({selection:e,option:t})=>!!(0,he.default)(e,t),[]),lt=(0,c.useCallback)(({activeOptionIndex:e,offset:t,options:n})=>{let r=e+t,i=n.length>r&&r>=0&&n[r].type===`separator`?r+t:r;return n.length>r&&r>=0?i:e},[]),W=(0,c.useCallback)((e,{trigger:t}={})=>{if(V()){if(f&&f.handleClose===W&&(f=void 0),M(void 0),P(-1),it(!1),w===`popover`&&t===`cancel`){let n=y?.props;n?.onClose&&n.onClose(e,{trigger:t})}D.onClose&&D.onClose(e,{})}},[V,w,y,D]),ut=(0,c.useCallback)((e,t)=>{if(!V())f&&(0,pe.default)(f.handleClose)&&f.handleClose();else if(f={handleClose:W},it(!0),D.onOpen&&D.onOpen(e,t||{}),w===`readonly`){let e=U(),t=(0,me.default)(e,e=>(0,fe.dequal)(e,S[0]));P(t),M(S[0]),k.current!==null&&le.default({container:k.current,focusedIndex:t})}},[V,W,D,w,U,S]),dt=(0,c.useCallback)((e,t)=>{D.onRequestClose&&D.onRequestClose(e,t),V()&&W(e,{trigger:`cancel`})},[D,V,W]),G=(0,c.useCallback)(()=>{D.onRequestOpen?D.onRequestOpen():it(!0)},[D]),K=(0,c.useCallback)(()=>{(!_&&S.length===0&&w===`inline-listbox`||_||w===`readonly`)&&G()},[_,S.length,w,G]);(0,c.useCallback)(e=>{dt(e,{})},[dt]);let ft=(0,c.useCallback)((e,{selection:t,option:n})=>{let r,i=ct({selection:t,option:n}),a=!_&&!i,ee=_&&!i;r=n.id===nt?[]:a?[n]:ee?[...S,n]:(0,ge.default)(S,n),D.onSelect&&D.onSelect(e,{selection:r}),W()},[ct,_,nt,S,D,W]),q=(0,c.useCallback)(e=>{setTimeout(()=>{let t=_e?document.activeElement:null;t&&t.tagName===`DIV`&&t.id===`${A()}-listbox`?O.current&&O.current.focus():y||W(e)},200),D.onBlur&&D.onBlur(e)},[A,y,W,D]),J=(0,c.useCallback)(e=>{K(),D.onChange&&D.onChange(e,{value:e.target.value})},[K,D]),Y=(0,c.useCallback)(e=>{D.onFocus&&D.onFocus(e,{})},[D]),pt=(0,c.useCallback)(e=>{if(j===void 0&&N===-1&&(B?dt(e,{}):e.shiftKey||G()),!j?.disabled){if(j&&(j.type===`header`||j.type===`footer`)){j.onClick?.(e);return}st()?ft(e,{option:j,selection:S}):!b&&e.target.value!==``&&D.onSubmit&&D.onSubmit(e,{value:e.target.value})}},[j,N,B,G,dt,st,ft,S,b,D]),mt=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=U(),i=lt({activeOptionIndex:N,offset:n[t],options:r});V()&&k.current&&le.default({container:k.current,focusedIndex:i}),M(r[i]),P(i)},[U,lt,N,V]),X=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=L+1===S.length&&t===`next`,i=L===0&&t===`previous`;if(r)I(S[0]),R(0),z(!0);else if(i)I(S[S.length-1]),R(S.length-1),z(!0);else{let e=lt({activeOptionIndex:L,offset:n[t],options:S});I(S[e]),R(e),z(!0)}},[L,S,lt]),ht=(0,c.useCallback)(e=>{e.shiftKey||G(),w!==`popover`&&mt(e,{direction:`next`})},[G,w,mt]),gt=(0,c.useCallback)(e=>{!e.shiftKey&&V()&&mt(e,{direction:`previous`})},[V,mt]),_t=(0,c.useCallback)(()=>{Xe.current&&z(!0)},[]),vt=(0,c.useCallback)(e=>{let t=U(),n=ce.default({key:e.key,keyBuffer:$e.current,keyCode:e.keyCode,options:t});n!==void 0&&(V()&&k.current&&le.default({container:k.current,focusedIndex:n}),M(t[n]),P(n))},[U,V]),Z=(0,c.useCallback)(e=>{let t={[i.default.DOWN]:{callback:ht},[i.default.ENTER]:{callback:pt},[i.default.ESCAPE]:{callback:W},[i.default.UP]:{callback:gt}};w===`readonly`&&(S.length>2?t[i.default.TAB]={callback:_t}:t[i.default.TAB]=void 0,t.other={callback:vt,stopPropagation:!1});let n=V();oe.default(e,{callbacks:t,stopPropagation:n})},[ht,pt,W,gt,w,S.length,_t,vt,V]),yt=(0,c.useCallback)(()=>{z(!1)},[]),bt=(0,c.useCallback)((e,{option:t,index:n})=>{rt||(I(t),R(n),z(!0))},[rt]),xt=(0,c.useCallback)((e,{option:t,index:n})=>{e.preventDefault();let r=S.length===1,i=S.length===2&&w===`readonly`&&_,a=n!==void 0&&n+1===S.length;(r||i)&&O.current?O.current.focus():a&&n!==void 0?(I(S[n-1]),R(n-1),z(!0)):n!==void 0&&(I(S[n+1]),R(n),z(!0)),D.onRequestRemoveSelectedOption&&D.onRequestRemoveSelectedOption(e,{selection:(0,ge.default)(S,t)})},[S,w,_,D]),St=(0,c.useCallback)((e,{ref:t})=>{t&&(Ze.current=t,Ze.current.focus())},[]),Q=(0,c.useCallback)(e=>{O.current=e,at||ot(!0),Le&&Le(e)},[at,Le]),Ct=(0,c.useCallback)(e=>{Xe.current=e,Ge&&Ge(e)},[Ge]),wt=(0,c.useCallback)(e=>{k.current=e},[]),Tt=(0,c.useCallback)(()=>O.current,[]);(0,c.useEffect)(()=>{typeof g==`boolean`&&(it(g),g||(M(void 0),P(-1)))},[g]),(0,c.useEffect)(()=>{let e=U();if(j){let t=(0,me.default)(e,e=>(0,fe.dequal)(e,j));t===-1?(M(void 0),P(-1)):P(t)}},[v,U,j]),(0,c.useEffect)(()=>{S.length>0&&!F&&(I(S[0]),R(0))},[S,F]),(0,c.useEffect)(()=>()=>{f&&f.handleClose===W&&(f=void 0)},[W]);let Et=(0,c.useCallback)(e=>{let t=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`slds-assistive-text`,id:`${A()}-label`,children:T.popoverLabel}),e]}),n=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(ee.default,{label:E.cancelButton,onClick:e=>{W(e,{trigger:`cancel`})}}),(0,u.jsx)(ee.default,{label:E.doneButton,variant:`brand`,onClick:W})]}),r={ariaLabelledby:`${A()}-label`,align:`bottom`,body:t,className:`slds-popover_full-width`,footer:n,footerClassName:`slds-popover__footer_form`,hasNoNubbin:!0,id:A(),isOpen:B,hasNoTriggerStyles:!0,onOpen:ut,onClose:W,onRequestClose:W},i=y?.props,a=(0,d.default)(r,i||{});return a.body=t,delete a.children,a},[A,T.popoverLabel,E.cancelButton,E.doneButton,W,B,ut,y]),Dt=(0,c.useCallback)(({menuRenderer:e})=>{let t=Ve;if(!Ee&&V()){let n={align:`bottom left`,context:Ye,hasStaticAlignment:Ne,inheritWidthOf:Fe,onClose:W,onMouseDown:e=>{e.preventDefault()},onOpen:ut,onRequestTargetElement:Tt,position:t,containerProps:{id:`${A()}-listbox`,role:`listbox`}};return(0,u.jsx)(a.default,{...n,children:e})}return null},[Ve,Ee,V,Ye,Ne,Fe,W,ut,Tt,A]),Ot=(0,c.useCallback)(()=>{let e={base:`icon-title-subtitle`,"inline-listbox":`icon-title-subtitle`,readonly:`checkbox`},t=w===`readonly`?5:null;return(0,u.jsx)(ie.default,{assistiveText:T,activeOption:j,activeOptionIndex:N,classNameMenu:we,classNameMenuSubHeader:Te,inheritWidthOf:Fe,inputId:A(),inputValue:C,isSelected:ct,itemVisibleLength:ze||t,labels:{noOptionsFound:E.noOptionsFound||``},hasMenuSpinner:Me,menuPosition:Ve,menuRef:wt,maxWidth:Be,options:U(),onSelect:ft,onRenderMenuItem:He||Je,selection:S,tooltipMenuItemDisabled:qe,variant:e[w]})},[w,T,j,N,we,Te,Fe,A,C,ct,ze,E.noOptionsFound,Me,Ve,wt,Be,U,ft,He,Je,S,qe]),$=Ie?.props||{},kt=()=>(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,"aria-owns":V()?`${A()}-listbox`:void 0,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:je,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,defaultValue:m,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...$}),Dt({menuRenderer:Ot()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]}),At=()=>(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:[S.length?(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,containerRole:`listbox`,containerAriaOrientation:`horizontal`,listboxRole:`group`,listboxAriaOrientation:null,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt}):null,(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),defaultValue:m,autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:je,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...$}),Dt({menuRenderer:Ot()}),h&&(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})]})]})}),jt=()=>{let e=S[0]?.icon,t=e&&c.default.isValidElement(e)?c.default.cloneElement(e,{containerClassName:`slds-combobox__input-entity-icon`}):null,n=S[0]?.label?S[0].label:C;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ke,hasSpinner:je,iconRight:S.length?(0,u.jsx)(s.default,{assistiveText:{icon:T.removeSingleSelectedOption},buttonRef:e=>{Qe.current=e},category:`utility`,iconPosition:`right`,name:`close`,onClick:e=>{xt(e,{option:S[0]})}}):(0,u.jsx)(s.default,{category:`utility`,name:`search`}),iconLeft:t,id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholder,readOnly:!!(b&&j)||!!S.length,required:x,role:`textbox`,value:b?j?.label||C:n,...$}),Dt({menuRenderer:Ot()})]})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})})]})},Mt=()=>{let e=y?.props,t=Et(e?.body);return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`dialog`,children:(0,u.jsx)(re.default,{...t,children:(0,u.jsx)(o.default,{"aria-autocomplete":`none`,"aria-controls":V()?`${A()}-popover`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,readOnly:!0,required:x,role:`textbox`,value:C})})})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]})},Nt=()=>{let e=S.length>1?E.multipleOptionsSelected||`${S.length} options selected`:S[0]?.label||``;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:e,...$}),Dt({menuRenderer:Ot()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt,variant:w,renderAtSelectionLength:2}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]})},Pt=()=>{let e=j?.label,t=S[0]?.label,n=e||t||``;return S[0]?.value===``&&(n=``),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ke,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:n,...$}),Dt({menuRenderer:Ot()}),h&&(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})]})})})},Ft=E.label||T?.label,It={base:{multiple:kt,single:kt},"inline-listbox":{multiple:At,single:jt},popover:{multiple:Mt,single:Mt},readonly:{multiple:Nt,single:Pt}},Lt=_?`multiple`:`single`,Rt=It[w]?.[Lt],zt=(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-form-element`,Ce),children:[De?null:(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),ke&&Ft?(0,u.jsx)(ne.default,{fieldLevelHelpTooltip:ke}):null,Rt?Rt():It.base.multiple()]});return De?(0,u.jsxs)(`div`,{className:`slds-form-element`,children:[(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:`slds-combobox-group`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_object-switcher slds-combobox-addon_start`,children:De}),(0,u.jsx)(`div`,{className:`slds-combobox_container slds-combobox-addon_end`,children:zt})]})})]}):zt};xe.displayName=t.COMBOBOX,exports.default=xe;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../../utilities/key-code.cjs"),a=require("../utilities/dialog/index.cjs"),ee=require("../button/index.cjs"),te=require("../../utilities/key-buffer.cjs"),o=require("../input/private/inner-input.cjs"),ne=require("../tooltip/private/field-level-help-tooltip.cjs"),s=require("../icon/input-icon/index.cjs"),re=require("../popover/index.cjs"),ie=require("./private/menu.cjs"),ae=require("../forms/private/label.cjs"),oe=require("../../utilities/key-callbacks.cjs"),se=require("../pill-container/private/selected-listbox.cjs"),ce=require("../../utilities/key-letter-menu-item-select.cjs"),le=require("../../utilities/menu-item-select-scroll.cjs"),ue=require("./check-props.cjs"),de=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),fe=require("dequal"),pe=require("lodash.isfunction");pe=e.__toESM(pe,1);let d=require("lodash.assign");d=e.__toESM(d,1);let me=require("lodash.findindex");me=e.__toESM(me,1);let he=require("lodash.find");he=e.__toESM(he,1);let ge=require("lodash.reject");ge=e.__toESM(ge,1);var f,_e=typeof document<`u`,ve={label:``,loadingMenuItems:`Loading`,optionSelectedInMenu:`Current Selection:`,popoverLabel:``,removeSingleSelectedOption:`Remove selected option`,removePill:`, Press delete or backspace to remove`,selectedListboxLabel:`Selected Options:`},ye={deselectOption:`None`,label:``,cancelButton:`Cancel`,doneButton:`Done`,multipleOptionsSelected:``,noOptionsFound:`No matches found.`,placeholder:``,placeholderReadOnly:`Select an Option`,removePillTitle:`Remove`,optionDisabledTooltipLabel:`This option is disabled.`,inputIconTitle:``},be={},xe=e=>{let{assistiveText:xe={},"aria-describedby":Se,className:p,classNameContainer:Ce,classNameMenu:we,classNameMenuSubHeader:Te,defaultValue:m,disabled:Ee,entityCombobox:De,errorText:h,events:Oe={},fieldLevelHelpTooltip:ke,hasDeselect:Ae,hasInputSpinner:je,hasMenuSpinner:Me,hasStaticAlignment:Ne,id:Pe,inheritWidthOf:Fe=`target`,input:Ie,inputRef:Le,isOpen:g,labels:Re={},menuItemVisibleLength:ze,menuMaxWidth:Be,menuPosition:Ve=`absolute`,multiple:_,onRenderMenuItem:He,options:v=[],optionsAddItem:Ue=[],optionsSearchEntity:We=[],popover:y,predefinedOptionsOnly:b,required:x=!1,selection:S=[],selectedListboxRef:Ge,singleInputDisabled:Ke=!1,tooltipMenuItemDisabled:qe,value:C,variant:w=`base`,menuItem:Je}=e,T=(0,d.default)({},ve,xe),E=(0,d.default)({},ye,Re),D=(0,d.default)({},be,Oe),Ye=(0,c.useContext)(n.IconSettingsContext),O=(0,c.useRef)(null),k=(0,c.useRef)(null),Xe=(0,c.useRef)(null),Ze=(0,c.useRef)(null),Qe=(0,c.useRef)(null),$e=(0,c.useRef)(new te.default),et=(0,c.useRef)(r.default()),tt=(0,c.useRef)(r.default()),A=(0,c.useCallback)(()=>Pe||et.current,[Pe]),nt=`${A()}-deselect`,[j,M]=(0,c.useState)(void 0),[N,P]=(0,c.useState)(-1),[F,I]=(0,c.useState)(S?.[0]),[L,R]=(0,c.useState)(0),[rt,z]=(0,c.useState)(!1),[B,it]=(0,c.useState)(typeof g==`boolean`&&g),[at,ot]=(0,c.useState)(!1);(0,c.useEffect)(()=>{ue.default(t.COMBOBOX,e,de.default)},[]);let V=(0,c.useCallback)(()=>!!(typeof g==`boolean`?g:B),[g,B]),st=(0,c.useCallback)(()=>j&&N!==-1,[j,N]),H=(0,c.useCallback)(()=>Se||h&&tt.current,[Se,h]),U=(0,c.useCallback)(()=>{let e={id:nt,label:E.deselectOption,value:``,type:`deselect`},t=We.map(e=>({...e,type:`header`,id:e.id||``})),n=Ue.map(e=>({...e,type:`footer`,id:e.id||``}));return[...t.length>0?t:[],...Ae?[e]:[],...v&&v.length>0?v:[],...n.length>0?n:[]]},[nt,E.deselectOption,We,Ue,Ae,v]),ct=(0,c.useCallback)(({selection:e,option:t})=>!!(0,he.default)(e,t),[]),lt=(0,c.useCallback)(({activeOptionIndex:e,offset:t,options:n})=>{let r=e+t,i=n.length>r&&r>=0&&n[r].type===`separator`?r+t:r;return n.length>r&&r>=0?i:e},[]),W=(0,c.useCallback)((e,{trigger:t}={})=>{if(V()){if(f&&f.handleClose===W&&(f=void 0),M(void 0),P(-1),it(!1),w===`popover`&&t===`cancel`){let n=y?.props;n?.onClose&&n.onClose(e,{trigger:t})}D.onClose&&D.onClose(e,{})}},[V,w,y,D]),ut=(0,c.useCallback)((e,t)=>{if(!V())f&&(0,pe.default)(f.handleClose)&&f.handleClose();else if(f={handleClose:W},it(!0),D.onOpen&&D.onOpen(e,t||{}),w===`readonly`){let e=U(),t=(0,me.default)(e,e=>(0,fe.dequal)(e,S[0]));P(t),M(S[0]),k.current!==null&&le.default({container:k.current,focusedIndex:t})}},[V,W,D,w,U,S]),dt=(0,c.useCallback)((e,t)=>{D.onRequestClose&&D.onRequestClose(e,t),V()&&W(e,{trigger:`cancel`})},[D,V,W]),G=(0,c.useCallback)(()=>{D.onRequestOpen?D.onRequestOpen():it(!0)},[D]),K=(0,c.useCallback)(()=>{(!_&&S.length===0&&w===`inline-listbox`||_||w===`readonly`)&&G()},[_,S.length,w,G]);(0,c.useCallback)(e=>{dt(e,{})},[dt]);let ft=(0,c.useCallback)((e,{selection:t,option:n})=>{let r,i=ct({selection:t,option:n}),a=!_&&!i,ee=_&&!i;r=n.id===nt?[]:a?[n]:ee?[...S,n]:(0,ge.default)(S,n),D.onSelect&&D.onSelect(e,{selection:r}),W()},[ct,_,nt,S,D,W]),q=(0,c.useCallback)(e=>{setTimeout(()=>{let t=_e?document.activeElement:null;t&&t.tagName===`DIV`&&t.id===`${A()}-listbox`?O.current&&O.current.focus():y||W(e)},200),D.onBlur&&D.onBlur(e)},[A,y,W,D]),J=(0,c.useCallback)(e=>{K(),D.onChange&&D.onChange(e,{value:e.target.value})},[K,D]),Y=(0,c.useCallback)(e=>{D.onFocus&&D.onFocus(e,{})},[D]),pt=(0,c.useCallback)(e=>{if(j===void 0&&N===-1&&(B?dt(e,{}):e.shiftKey||G()),!j?.disabled){if(j&&(j.type===`header`||j.type===`footer`)){j.onClick?.(e);return}st()?ft(e,{option:j,selection:S}):!b&&e.target.value!==``&&D.onSubmit&&D.onSubmit(e,{value:e.target.value})}},[j,N,B,G,dt,st,ft,S,b,D]),mt=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=U(),i=lt({activeOptionIndex:N,offset:n[t],options:r});V()&&k.current&&le.default({container:k.current,focusedIndex:i}),M(r[i]),P(i)},[U,lt,N,V]),X=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=L+1===S.length&&t===`next`,i=L===0&&t===`previous`;if(r)I(S[0]),R(0),z(!0);else if(i)I(S[S.length-1]),R(S.length-1),z(!0);else{let e=lt({activeOptionIndex:L,offset:n[t],options:S});I(S[e]),R(e),z(!0)}},[L,S,lt]),ht=(0,c.useCallback)(e=>{e.shiftKey||G(),w!==`popover`&&mt(e,{direction:`next`})},[G,w,mt]),gt=(0,c.useCallback)(e=>{!e.shiftKey&&V()&&mt(e,{direction:`previous`})},[V,mt]),_t=(0,c.useCallback)(()=>{Xe.current&&z(!0)},[]),vt=(0,c.useCallback)(e=>{let t=U(),n=ce.default({key:e.key,keyBuffer:$e.current,keyCode:e.keyCode,options:t});n!==void 0&&(V()&&k.current&&le.default({container:k.current,focusedIndex:n}),M(t[n]),P(n))},[U,V]),Z=(0,c.useCallback)(e=>{let t={[i.default.DOWN]:{callback:ht},[i.default.ENTER]:{callback:pt},[i.default.ESCAPE]:{callback:W},[i.default.UP]:{callback:gt}};w===`readonly`&&(S.length>2?t[i.default.TAB]={callback:_t}:t[i.default.TAB]=void 0,t.other={callback:vt,stopPropagation:!1});let n=V();oe.default(e,{callbacks:t,stopPropagation:n})},[ht,pt,W,gt,w,S.length,_t,vt,V]),yt=(0,c.useCallback)(()=>{z(!1)},[]),bt=(0,c.useCallback)((e,{option:t,index:n})=>{rt||(I(t),R(n),z(!0))},[rt]),xt=(0,c.useCallback)((e,{option:t,index:n})=>{e.preventDefault();let r=S.length===1,i=S.length===2&&w===`readonly`&&_,a=n!==void 0&&n+1===S.length;(r||i)&&O.current?O.current.focus():a&&n!==void 0?(I(S[n-1]),R(n-1),z(!0)):n!==void 0&&(I(S[n+1]),R(n),z(!0)),D.onRequestRemoveSelectedOption&&D.onRequestRemoveSelectedOption(e,{selection:(0,ge.default)(S,t)})},[S,w,_,D]),St=(0,c.useCallback)((e,{ref:t})=>{t&&(Ze.current=t,Ze.current.focus())},[]),Q=(0,c.useCallback)(e=>{O.current=e,at||ot(!0),Le&&Le(e)},[at,Le]),Ct=(0,c.useCallback)(e=>{Xe.current=e,Ge&&Ge(e)},[Ge]),wt=(0,c.useCallback)(e=>{k.current=e},[]),Tt=(0,c.useCallback)(()=>O.current,[]);(0,c.useEffect)(()=>{typeof g==`boolean`&&(it(g),g||(M(void 0),P(-1)))},[g]),(0,c.useEffect)(()=>{let e=U();if(j){let t=(0,me.default)(e,e=>(0,fe.dequal)(e,j));t===-1?(M(void 0),P(-1)):P(t)}},[v,U,j]),(0,c.useEffect)(()=>{if(S.length===0){F!==void 0&&(I(void 0),R(0));return}if(!F||!S[L]){let e=L>=S.length?S.length-1:L;I(S[e]),R(e)}},[S,F,L]),(0,c.useEffect)(()=>()=>{f&&f.handleClose===W&&(f=void 0)},[W]);let Et=(0,c.useCallback)(e=>{let t=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`slds-assistive-text`,id:`${A()}-label`,children:T.popoverLabel}),e]}),n=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(ee.default,{label:E.cancelButton,onClick:e=>{W(e,{trigger:`cancel`})}}),(0,u.jsx)(ee.default,{label:E.doneButton,variant:`brand`,onClick:W})]}),r={ariaLabelledby:`${A()}-label`,align:`bottom`,body:t,className:`slds-popover_full-width`,footer:n,footerClassName:`slds-popover__footer_form`,hasNoNubbin:!0,id:A(),isOpen:B,hasNoTriggerStyles:!0,onOpen:ut,onClose:W,onRequestClose:W},i=y?.props,a=(0,d.default)(r,i||{});return a.body=t,delete a.children,a},[A,T.popoverLabel,E.cancelButton,E.doneButton,W,B,ut,y]),Dt=(0,c.useCallback)(({menuRenderer:e})=>{let t=Ve;if(!Ee&&V()){let n={align:`bottom left`,context:Ye,hasStaticAlignment:Ne,inheritWidthOf:Fe,onClose:W,onMouseDown:e=>{e.preventDefault()},onOpen:ut,onRequestTargetElement:Tt,position:t,containerProps:{id:`${A()}-listbox`,role:`listbox`}};return(0,u.jsx)(a.default,{...n,children:e})}return null},[Ve,Ee,V,Ye,Ne,Fe,W,ut,Tt,A]),Ot=(0,c.useCallback)(()=>{let e={base:`icon-title-subtitle`,"inline-listbox":`icon-title-subtitle`,readonly:`checkbox`},t=w===`readonly`?5:null;return(0,u.jsx)(ie.default,{assistiveText:T,activeOption:j,activeOptionIndex:N,classNameMenu:we,classNameMenuSubHeader:Te,inheritWidthOf:Fe,inputId:A(),inputValue:C,isSelected:ct,itemVisibleLength:ze||t,labels:{noOptionsFound:E.noOptionsFound||``},hasMenuSpinner:Me,menuPosition:Ve,menuRef:wt,maxWidth:Be,options:U(),onSelect:ft,onRenderMenuItem:He||Je,selection:S,tooltipMenuItemDisabled:qe,variant:e[w]})},[w,T,j,N,we,Te,Fe,A,C,ct,ze,E.noOptionsFound,Me,Ve,wt,Be,U,ft,He,Je,S,qe]),$=Ie?.props||{},kt=()=>(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,"aria-owns":V()?`${A()}-listbox`:void 0,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:je,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,defaultValue:m,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...$}),Dt({menuRenderer:Ot()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt,multiselectable:_}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]}),At=()=>(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:[S.length?(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,containerRole:`listbox`,containerAriaOrientation:`horizontal`,listboxRole:`group`,listboxAriaOrientation:null,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt,multiselectable:_}):null,(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),defaultValue:m,autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:je,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...$}),Dt({menuRenderer:Ot()}),h&&(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})]})]})}),jt=()=>{let e=S[0]?.icon,t=e&&c.default.isValidElement(e)?c.default.cloneElement(e,{containerClassName:`slds-combobox__input-entity-icon`}):null,n=S[0]?.label?S[0].label:C;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ke,hasSpinner:je,iconRight:S.length?(0,u.jsx)(s.default,{assistiveText:{icon:T.removeSingleSelectedOption},buttonRef:e=>{Qe.current=e},category:`utility`,iconPosition:`right`,name:`close`,onClick:e=>{xt(e,{option:S[0]})}}):(0,u.jsx)(s.default,{category:`utility`,name:`search`}),iconLeft:t,id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholder,readOnly:!!(b&&j)||!!S.length,required:x,role:`textbox`,value:b?j?.label||C:n,...$}),Dt({menuRenderer:Ot()})]})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})})]})},Mt=()=>{let e=y?.props,t=Et(e?.body);return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`dialog`,children:(0,u.jsx)(re.default,{...t,children:(0,u.jsx)(o.default,{"aria-autocomplete":`none`,"aria-controls":V()?`${A()}-popover`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>G(),onChange:J,placeholder:E.placeholder,readOnly:!0,required:x,role:`textbox`,value:C})})})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]})},Nt=()=>{let e=S.length>1?E.multipleOptionsSelected||`${S.length} options selected`:S[0]?.label||``;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:e,...$}),Dt({menuRenderer:Ot()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:yt,onPillFocus:bt,onRequestFocus:St,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:xt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Ct,selection:S,listboxHasFocus:rt,variant:w,renderAtSelectionLength:2,multiselectable:_}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help slds-has-error`,children:h})})]})},Pt=()=>{let e=j?.label,t=S[0]?.label,n=e||t||``;return S[0]?.value===``&&(n=``),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":V(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":V(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":V()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":H(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ke,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:n,...$}),Dt({menuRenderer:Ot()}),h&&(0,u.jsx)(`div`,{id:H(),className:`slds-form-element__help`,children:h})]})})})},Ft=E.label||T?.label,It={base:{multiple:kt,single:kt},"inline-listbox":{multiple:At,single:jt},popover:{multiple:Mt,single:Mt},readonly:{multiple:Nt,single:Pt}},Lt=_?`multiple`:`single`,Rt=It[w]?.[Lt],zt=(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-form-element`,Ce),children:[De?null:(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),ke&&Ft?(0,u.jsx)(ne.default,{fieldLevelHelpTooltip:ke}):null,Rt?Rt():It.base.multiple()]});return De?(0,u.jsxs)(`div`,{className:`slds-form-element`,children:[(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:`slds-combobox-group`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_object-switcher slds-combobox-addon_start`,children:De}),(0,u.jsx)(`div`,{className:`slds-combobox_container slds-combobox-addon_end`,children:zt})]})})]}):zt};xe.displayName=t.COMBOBOX,exports.default=xe;
2
2
  //# sourceMappingURL=combobox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.cjs","names":[],"sources":["../../../../components/combobox/combobox.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, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport find from 'lodash.find';\nimport reject from 'lodash.reject';\nimport { dequal as isEqual } from 'dequal';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Dialog from '../utilities/dialog';\nimport InnerInput from '../input/private/inner-input';\nimport InputIcon from '../icon/input-icon';\nimport Menu, { type ComboboxOption } from './private/menu';\nimport Label from '../forms/private/label';\nimport Popover from '../popover';\nimport SelectedListBox from '../pill-container/private/selected-listbox';\n\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport KEYS from '../../utilities/key-code';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyLetterMenuItemSelect from '../../utilities/key-letter-menu-item-select';\nimport mapKeyEventCallbacks from '../../utilities/key-callbacks';\nimport menuItemSelectScroll from '../../utilities/menu-item-select-scroll';\n\nimport checkProps from './check-props';\n\nimport { COMBOBOX } from '../../utilities/constants';\nimport type { SelectedListBoxOption } from '../pill-container/private/selected-listbox';\nimport generateId from '../../utilities/generate-id';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\nlet currentOpenDropdown: { handleClose: () => void } | undefined;\nconst documentDefined = typeof document !== 'undefined';\n\n// ===== Types =====\n\nexport interface ComboboxAssistiveText {\n\tlabel?: string;\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n\tpopoverLabel?: string;\n\tremoveSingleSelectedOption?: string;\n\tremovePill?: string;\n\tselectedListboxLabel?: string;\n}\n\nexport interface ComboboxLabels {\n\tdeselectOption?: string;\n\tlabel?: ReactNode | string;\n\tcancelButton?: string;\n\tdoneButton?: string;\n\tmultipleOptionsSelected?: string;\n\tnoOptionsFound?: ReactNode | string;\n\tplaceholder?: string;\n\tplaceholderReadOnly?: string;\n\tremovePillTitle?: string;\n\toptionDisabledTooltipLabel?: string;\n\tinputIconTitle?: string;\n}\n\nexport interface ComboboxEvents {\n\tonBlur?: (event: React.FocusEvent) => void;\n\tonChange?: (event: React.ChangeEvent<HTMLInputElement>, data: { value: string }) => void;\n\tonClose?: (event: React.SyntheticEvent | undefined, data: Record<string, unknown>) => void;\n\tonFocus?: (event: React.FocusEvent, data: Record<string, unknown>) => void;\n\tonOpen?: (event: React.SyntheticEvent | undefined, data: Record<string, unknown>) => void;\n\tonRequestClose?: (event: React.SyntheticEvent, data: Record<string, unknown>) => void;\n\tonRequestOpen?: () => void;\n\tonRequestRemoveSelectedOption?: (event: React.SyntheticEvent, data: { selection: ComboboxOption[] }) => void;\n\tonSelect?: (event: React.SyntheticEvent, data: { selection: ComboboxOption[] }) => void;\n\tonSubmit?: (event: React.KeyboardEvent, data: { value: string }) => void;\n}\n\nexport interface ComboboxProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ComboboxAssistiveText;\n\t/** aria-describedby attribute */\n\t'aria-describedby'?: string;\n\t/** CSS classes for combobox container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for top level container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for dropdown menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu sub header */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** Default input value for uncontrolled usage */\n\tdefaultValue?: string;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Entity combobox for grouped comboboxes */\n\tentityCombobox?: ReactNode;\n\t/** Error text to display */\n\terrorText?: string;\n\t/** Event callbacks */\n\tevents?: ComboboxEvents;\n\t/** Field level help tooltip */\n\tfieldLevelHelpTooltip?: ReactNode;\n\t/** Whether to show deselect option */\n\thasDeselect?: boolean;\n\t/** Whether to show input spinner */\n\thasInputSpinner?: boolean;\n\t/** Whether to show menu spinner */\n\thasMenuSpinner?: boolean;\n\t/** Whether to use static alignment */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Sets dialog width inheritance */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Callback to get input ref */\n\tinputRef?: (ref: HTMLInputElement | null) => void;\n\t/** Whether the dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: ComboboxLabels;\n\t/** Menu item visible length */\n\tmenuItemVisibleLength?: 5 | 7 | 10;\n\t/** Menu max width */\n\tmenuMaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Whether multiple selection is allowed */\n\tmultiple?: boolean;\n\t/** Custom menu item renderer */\n\tonRenderMenuItem?: React.ComponentType<{\n\t\tassistiveText?: ComboboxAssistiveText;\n\t\tselected: boolean;\n\t\toption: ComboboxOption;\n\t}>;\n\t/** Menu options */\n\toptions?: ComboboxOption[];\n\t/** Options to add items */\n\toptionsAddItem?: Array<{ id?: string; icon?: ReactNode; label?: string | ((searchTerm: string) => ReactNode) }>;\n\t/** Options for search entity */\n\toptionsSearchEntity?: Array<{ id?: string; icon?: ReactNode; label?: string | ((searchTerm: string) => ReactNode) }>;\n\t/** Popover component for popover variant */\n\tpopover?: ReactElement;\n\t/** Whether only predefined options are allowed */\n\tpredefinedOptionsOnly?: boolean;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Callback to get selected listbox ref */\n\tselectedListboxRef?: (ref: HTMLUListElement | null) => void;\n\t/** Whether single input is disabled */\n\tsingleInputDisabled?: boolean;\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement;\n\t/** Input value (controlled) */\n\tvalue?: string;\n\t/** Combobox variant */\n\tvariant?: 'base' | 'inline-listbox' | 'popover' | 'readonly';\n\t/** @deprecated Use menuItem instead */\n\tmenuItem?: React.ComponentType<{\n\t\tassistiveText?: ComboboxAssistiveText;\n\t\tselected: boolean;\n\t\toption: ComboboxOption;\n\t}>;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<ComboboxAssistiveText> = {\n\tlabel: '',\n\tloadingMenuItems: 'Loading',\n\toptionSelectedInMenu: 'Current Selection:',\n\tpopoverLabel: '',\n\tremoveSingleSelectedOption: 'Remove selected option',\n\tremovePill: ', Press delete or backspace to remove',\n\tselectedListboxLabel: 'Selected Options:',\n};\n\nconst defaultLabels: Required<ComboboxLabels> = {\n\tdeselectOption: 'None',\n\tlabel: '',\n\tcancelButton: 'Cancel',\n\tdoneButton: 'Done',\n\tmultipleOptionsSelected: '',\n\tnoOptionsFound: 'No matches found.',\n\tplaceholder: '',\n\tplaceholderReadOnly: 'Select an Option',\n\tremovePillTitle: 'Remove',\n\toptionDisabledTooltipLabel: 'This option is disabled.',\n\tinputIconTitle: '',\n};\n\nconst defaultEvents: ComboboxEvents = {};\n\n// ===== Component =====\n\nconst Combobox: React.FC<ComboboxProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\t'aria-describedby': ariaDescribedby,\n\t\tclassName,\n\t\tclassNameContainer,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\tentityCombobox,\n\t\terrorText,\n\t\tevents: eventsProp = {},\n\t\tfieldLevelHelpTooltip,\n\t\thasDeselect,\n\t\thasInputSpinner,\n\t\thasMenuSpinner,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinheritWidthOf = 'target',\n\t\tinput,\n\t\tinputRef: inputRefCallback,\n\t\tisOpen: isOpenProp,\n\t\tlabels: labelsProp = {},\n\t\tmenuItemVisibleLength,\n\t\tmenuMaxWidth,\n\t\tmenuPosition = 'absolute',\n\t\tmultiple,\n\t\tonRenderMenuItem,\n\t\toptions = [],\n\t\toptionsAddItem = [],\n\t\toptionsSearchEntity = [],\n\t\tpopover,\n\t\tpredefinedOptionsOnly,\n\t\trequired = false,\n\t\tselection = [],\n\t\tselectedListboxRef: selectedListboxRefCallback,\n\t\tsingleInputDisabled = false,\n\t\ttooltipMenuItemDisabled,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\tmenuItem,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\tconst events = assign({}, defaultEvents, eventsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst menuRef = useRef<HTMLUListElement | null>(null);\n\tconst selectedListboxRef = useRef<HTMLUListElement | null>(null);\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst buttonRef = useRef<HTMLButtonElement | null>(null);\n\tconst menuKeyBuffer = useRef(new KeyBuffer());\n\n\t// Generated IDs\n\tconst generatedId = useRef(generateId());\n\tconst generatedErrorId = useRef(generateId());\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\tconst deselectId = `${getId()}-deselect`;\n\n\t// State\n\tconst [activeOption, setActiveOption] = useState<ComboboxOption | undefined>(undefined);\n\tconst [activeOptionIndex, setActiveOptionIndex] = useState(-1);\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<ComboboxOption | undefined>(\n\t\tselection?.[0]\n\t);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\tconst [isOpenState, setIsOpenState] = useState(typeof isOpenProp === 'boolean' ? isOpenProp : false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\tcheckProps(COMBOBOX, props as unknown as Record<string, unknown>, componentDoc);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getIsActiveOption = useCallback(() => {\n\t\treturn activeOption && activeOptionIndex !== -1;\n\t}, [activeOption, activeOptionIndex]);\n\n\tconst getErrorId = useCallback(() => {\n\t\treturn ariaDescribedby || (errorText && generatedErrorId.current);\n\t}, [ariaDescribedby, errorText]);\n\n\t// Build options list\n\tconst getOptions = useCallback(() => {\n\t\tconst deselectOption: ComboboxOption = {\n\t\t\tid: deselectId,\n\t\t\tlabel: labels.deselectOption,\n\t\t\tvalue: '',\n\t\t\ttype: 'deselect',\n\t\t};\n\n\t\tconst localOptionsSearchEntity = optionsSearchEntity.map((entity) => ({\n\t\t\t...entity,\n\t\t\ttype: 'header' as const,\n\t\t\tid: entity.id || '',\n\t\t}));\n\n\t\tconst localOptionsAddItem = optionsAddItem.map((entity) => ({\n\t\t\t...entity,\n\t\t\ttype: 'footer' as const,\n\t\t\tid: entity.id || '',\n\t\t}));\n\n\t\treturn [\n\t\t\t...(localOptionsSearchEntity.length > 0 ? localOptionsSearchEntity : []),\n\t\t\t...(hasDeselect ? [deselectOption] : []),\n\t\t\t...(options && options.length > 0 ? options : []),\n\t\t\t...(localOptionsAddItem.length > 0 ? localOptionsAddItem : []),\n\t\t];\n\t}, [deselectId, labels.deselectOption, optionsSearchEntity, optionsAddItem, hasDeselect, options]);\n\n\tconst isSelected = useCallback(({ selection: sel, option }: { selection: ComboboxOption[]; option: ComboboxOption }) => {\n\t\treturn !!find(sel, option);\n\t}, []);\n\n\t// Get new active option index (for navigation)\n\tconst getNewActiveOptionIndex = useCallback(({\n\t\tactiveOptionIndex: currentIndex,\n\t\toffset,\n\t\toptions: opts,\n\t}: {\n\t\tactiveOptionIndex: number;\n\t\toffset: number;\n\t\toptions: ComboboxOption[];\n\t}) => {\n\t\tconst nextIndex = currentIndex + offset;\n\t\tconst skipIndex =\n\t\t\topts.length > nextIndex &&\n\t\t\tnextIndex >= 0 &&\n\t\t\topts[nextIndex].type === 'separator';\n\t\tconst newIndex = skipIndex ? nextIndex + offset : nextIndex;\n\t\tconst hasNewIndex = opts.length > nextIndex && nextIndex >= 0;\n\t\treturn hasNewIndex ? newIndex : currentIndex;\n\t}, []);\n\n\t// ===== Event Handlers =====\n\n\tconst handleClose = useCallback((event?: React.SyntheticEvent, { trigger }: { trigger?: string } = {}) => {\n\t\tconst isOpen = getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tif (currentOpenDropdown && currentOpenDropdown.handleClose === handleClose) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t\tsetIsOpenState(false);\n\n\t\t\tif (variant === 'popover' && trigger === 'cancel') {\n\t\t\t\tconst popoverProps = popover?.props as { onClose?: (event: unknown, data: { trigger: string }) => void } | undefined;\n\t\t\t\tif (popoverProps?.onClose) {\n\t\t\t\t\tpopoverProps.onClose(event, { trigger });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (events.onClose) {\n\t\t\t\tevents.onClose(event, {});\n\t\t\t}\n\t\t}\n\t}, [getIsOpen, variant, popover, events]);\n\n\tconst handleOpen = useCallback((event?: React.SyntheticEvent, data?: Record<string, unknown>) => {\n\t\tconst isOpen = getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentOpenDropdown = { handleClose };\n\n\t\t\tsetIsOpenState(true);\n\n\t\t\tif (events.onOpen) {\n\t\t\t\tevents.onOpen(event, data || {});\n\t\t\t}\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tconst opts = getOptions();\n\t\t\t\tconst idx = findIndex(opts, (item) => isEqual(item, selection[0]));\n\n\t\t\t\tsetActiveOptionIndex(idx);\n\t\t\t\tsetActiveOption(selection[0]);\n\n\t\t\t\tif (menuRef.current !== null) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: idx,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [getIsOpen, handleClose, events, variant, getOptions, selection]);\n\n\tconst handleRequestClose = useCallback((event: React.SyntheticEvent, data: Record<string, unknown>) => {\n\t\tif (events.onRequestClose) {\n\t\t\tevents.onRequestClose(event, data);\n\t\t}\n\t\tif (getIsOpen()) {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t}\n\t}, [events, getIsOpen, handleClose]);\n\n\tconst openDialog = useCallback(() => {\n\t\tif (events.onRequestOpen) {\n\t\t\tevents.onRequestOpen();\n\t\t} else {\n\t\t\tsetIsOpenState(true);\n\t\t}\n\t}, [events]);\n\n\tconst requestOpenMenu = useCallback(() => {\n\t\tconst isInlineSingleSelectionAndIsNotSelected =\n\t\t\t!multiple &&\n\t\t\tselection.length === 0 &&\n\t\t\tvariant === 'inline-listbox';\n\n\t\tif (\n\t\t\tisInlineSingleSelectionAndIsNotSelected ||\n\t\t\tmultiple ||\n\t\t\tvariant === 'readonly'\n\t\t) {\n\t\t\topenDialog();\n\t\t}\n\t}, [multiple, selection.length, variant, openDialog]);\n\n\tconst handleClickOutside = useCallback((event: MouseEvent | TouchEvent) => {\n\t\thandleRequestClose(event as unknown as React.SyntheticEvent, {});\n\t}, [handleRequestClose]);\n\n\tconst handleSelect = useCallback((event: React.SyntheticEvent, { selection: sel, option }: { selection: ComboboxOption[]; option: ComboboxOption }) => {\n\t\tlet newSelection: ComboboxOption[];\n\t\tconst selected = isSelected({ selection: sel, option });\n\t\tconst singleSelectAndSelectedWasNotClicked = !multiple && !selected;\n\t\tconst multiSelectAndSelectedWasNotClicked = multiple && !selected;\n\t\tconst deselectWasClicked = option.id === deselectId;\n\n\t\tif (deselectWasClicked) {\n\t\t\tnewSelection = [];\n\t\t} else if (singleSelectAndSelectedWasNotClicked) {\n\t\t\tnewSelection = [option];\n\t\t} else if (multiSelectAndSelectedWasNotClicked) {\n\t\t\tnewSelection = [...selection, option];\n\t\t} else {\n\t\t\tnewSelection = reject(selection, option);\n\t\t}\n\n\t\tif (events.onSelect) {\n\t\t\tevents.onSelect(event, { selection: newSelection });\n\t\t}\n\n\t\thandleClose();\n\t}, [isSelected, multiple, deselectId, selection, events, handleClose]);\n\n\tconst handleInputBlur = useCallback((event: React.FocusEvent) => {\n\t\tsetTimeout(() => {\n\t\t\tconst activeElement = documentDefined ? document.activeElement : null;\n\t\t\tif (\n\t\t\t\tactiveElement &&\n\t\t\t\tactiveElement.tagName === 'DIV' &&\n\t\t\t\tactiveElement.id === `${getId()}-listbox`\n\t\t\t) {\n\t\t\t\tif (inputRef.current) {\n\t\t\t\t\tinputRef.current.focus();\n\t\t\t\t}\n\t\t\t} else if (!popover) {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t}, 200);\n\n\t\tif (events.onBlur) {\n\t\t\tevents.onBlur(event);\n\t\t}\n\t}, [getId, popover, handleClose, events]);\n\n\tconst handleInputChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n\t\trequestOpenMenu();\n\t\tif (events.onChange) {\n\t\t\tevents.onChange(event, { value: event.target.value });\n\t\t}\n\t}, [requestOpenMenu, events]);\n\n\tconst handleInputFocus = useCallback((event: React.FocusEvent) => {\n\t\tif (events.onFocus) {\n\t\t\tevents.onFocus(event, {});\n\t\t}\n\t}, [events]);\n\n\tconst handleInputSubmit = useCallback((event: React.KeyboardEvent) => {\n\t\tif (activeOption === undefined && activeOptionIndex === -1) {\n\t\t\tif (!isOpenState) {\n\t\t\t\tif (!event.shiftKey) {\n\t\t\t\t\topenDialog();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandleRequestClose(event, {});\n\t\t\t}\n\t\t}\n\n\t\tif (activeOption?.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tactiveOption &&\n\t\t\t(activeOption.type === 'header' || activeOption.type === 'footer')\n\t\t) {\n\t\t\tactiveOption.onClick?.(event as unknown as React.MouseEvent);\n\t\t\treturn;\n\t\t}\n\n\t\tif (getIsActiveOption()) {\n\t\t\thandleSelect(event, {\n\t\t\t\toption: activeOption!,\n\t\t\t\tselection,\n\t\t\t});\n\t\t} else if (\n\t\t\t!predefinedOptionsOnly &&\n\t\t\t(event.target as HTMLInputElement).value !== '' &&\n\t\t\tevents.onSubmit\n\t\t) {\n\t\t\tevents.onSubmit(event, {\n\t\t\t\tvalue: (event.target as HTMLInputElement).value,\n\t\t\t});\n\t\t}\n\t}, [activeOption, activeOptionIndex, isOpenState, openDialog, handleRequestClose, getIsActiveOption, handleSelect, selection, predefinedOptionsOnly, events]);\n\n\tconst handleNavigateListboxMenu = useCallback((event: React.KeyboardEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\tconst offsets = { next: 1, previous: -1 };\n\t\tconst opts = getOptions();\n\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\tactiveOptionIndex,\n\t\t\toffset: offsets[direction],\n\t\t\toptions: opts,\n\t\t});\n\n\t\tif (getIsOpen() && menuRef.current) {\n\t\t\tmenuItemSelectScroll({\n\t\t\t\tcontainer: menuRef.current,\n\t\t\t\tfocusedIndex: newIndex,\n\t\t\t});\n\t\t}\n\n\t\tsetActiveOption(opts[newIndex]);\n\t\tsetActiveOptionIndex(newIndex);\n\t}, [getOptions, getNewActiveOptionIndex, activeOptionIndex, getIsOpen]);\n\n\tconst handleNavigateSelectedListbox = useCallback((event: React.SyntheticEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\tconst offsets = { next: 1, previous: -1 };\n\t\tconst isLastOptionAndRightIsPressed =\n\t\t\tactiveSelectedOptionIndex + 1 === selection.length && direction === 'next';\n\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\tsetActiveSelectedOption(selection[0]);\n\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\tsetActiveSelectedOption(selection[selection.length - 1]);\n\t\t\tsetActiveSelectedOptionIndex(selection.length - 1);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else {\n\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\tactiveOptionIndex: activeSelectedOptionIndex,\n\t\t\t\toffset: offsets[direction],\n\t\t\t\toptions: selection,\n\t\t\t});\n\t\t\tsetActiveSelectedOption(selection[newIndex]);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, [activeSelectedOptionIndex, selection, getNewActiveOptionIndex]);\n\n\tconst handleKeyDownDown = useCallback((event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey) {\n\t\t\topenDialog();\n\t\t}\n\n\t\tif (variant !== 'popover') {\n\t\t\thandleNavigateListboxMenu(event, { direction: 'next' });\n\t\t}\n\t}, [openDialog, variant, handleNavigateListboxMenu]);\n\n\tconst handleKeyDownUp = useCallback((event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey && getIsOpen()) {\n\t\t\thandleNavigateListboxMenu(event, { direction: 'previous' });\n\t\t}\n\t}, [getIsOpen, handleNavigateListboxMenu]);\n\n\tconst handleKeyDownTab = useCallback(() => {\n\t\tif (selectedListboxRef.current) {\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, []);\n\n\tconst handleKeyDownOther = useCallback((event: React.KeyboardEvent) => {\n\t\tconst opts = getOptions();\n\t\tconst newActiveOptionIndex = keyLetterMenuItemSelect({\n\t\t\tkey: event.key,\n\t\t\tkeyBuffer: menuKeyBuffer.current,\n\t\t\tkeyCode: event.keyCode,\n\t\t\toptions: opts,\n\t\t});\n\n\t\tif (newActiveOptionIndex !== undefined) {\n\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\tfocusedIndex: newActiveOptionIndex,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetActiveOption(opts[newActiveOptionIndex]);\n\t\t\tsetActiveOptionIndex(newActiveOptionIndex);\n\t\t}\n\t}, [getOptions, getIsOpen]);\n\n\tconst handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n\t\tconst callbacks: Record<number | string, { callback: (e: React.KeyboardEvent) => void; stopPropagation?: boolean } | undefined> = {\n\t\t\t[KEYS.DOWN]: { callback: handleKeyDownDown },\n\t\t\t[KEYS.ENTER]: { callback: handleInputSubmit },\n\t\t\t[KEYS.ESCAPE]: { callback: handleClose as (e: React.KeyboardEvent) => void },\n\t\t\t[KEYS.UP]: { callback: handleKeyDownUp },\n\t\t};\n\n\t\tif (variant === 'readonly') {\n\t\t\tif (selection.length > 2) {\n\t\t\t\tcallbacks[KEYS.TAB] = { callback: handleKeyDownTab };\n\t\t\t} else {\n\t\t\t\tcallbacks[KEYS.TAB] = undefined;\n\t\t\t}\n\t\t\tcallbacks.other = {\n\t\t\t\tcallback: handleKeyDownOther,\n\t\t\t\tstopPropagation: false,\n\t\t\t};\n\t\t}\n\n\t\tconst stopPropagation = getIsOpen();\n\n\t\tmapKeyEventCallbacks(event, { callbacks, stopPropagation });\n\t}, [handleKeyDownDown, handleInputSubmit, handleClose, handleKeyDownUp, variant, selection.length, handleKeyDownTab, handleKeyDownOther, getIsOpen]);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tsetListboxHasFocus(false);\n\t}, []);\n\n\tconst handlePillFocus = useCallback((event: React.FocusEvent, { option, index }: { option: ComboboxOption; index: number }) => {\n\t\tif (!listboxHasFocus) {\n\t\t\tsetActiveSelectedOption(option);\n\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, [listboxHasFocus]);\n\n\tconst handleRemoveSelectedOption = useCallback((event: React.SyntheticEvent, { option, index }: { option: ComboboxOption; index?: number }) => {\n\t\tevent.preventDefault();\n\t\tconst onlyOnePillAndInputExists = selection.length === 1;\n\t\tconst isReadOnlyAndTwoPillsExists =\n\t\t\tselection.length === 2 && variant === 'readonly' && multiple;\n\t\tconst lastPillWasRemoved = index !== undefined && index + 1 === selection.length;\n\n\t\tif (\n\t\t\t(onlyOnePillAndInputExists || isReadOnlyAndTwoPillsExists) &&\n\t\t\tinputRef.current\n\t\t) {\n\t\t\tinputRef.current.focus();\n\t\t} else if (lastPillWasRemoved && index !== undefined) {\n\t\t\tsetActiveSelectedOption(selection[index - 1]);\n\t\t\tsetActiveSelectedOptionIndex(index - 1);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else if (index !== undefined) {\n\t\t\tsetActiveSelectedOption(selection[index + 1]);\n\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\n\t\tif (events.onRequestRemoveSelectedOption) {\n\t\t\tevents.onRequestRemoveSelectedOption(event, {\n\t\t\t\tselection: reject(selection, option),\n\t\t\t});\n\t\t}\n\t}, [selection, variant, multiple, events]);\n\n\tconst handleRequestFocusSelectedListbox = useCallback((event: React.SyntheticEvent, { ref }: { ref: HTMLElement | null }) => {\n\t\tif (ref) {\n\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t}\n\t}, []);\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback((component: HTMLInputElement | null) => {\n\t\tinputRef.current = component;\n\t\tif (!inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t\tif (inputRefCallback) {\n\t\t\tinputRefCallback(component);\n\t\t}\n\t}, [inputRendered, inputRefCallback]);\n\n\tconst setSelectedListboxRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tselectedListboxRef.current = ref;\n\t\tif (selectedListboxRefCallback) {\n\t\t\tselectedListboxRefCallback(ref);\n\t\t}\n\t}, [selectedListboxRefCallback]);\n\n\tconst setMenuRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tmenuRef.current = ref;\n\t}, []);\n\n\tconst getTargetElement = useCallback(() => inputRef.current, []);\n\n\t// ===== Effects =====\n\n\t// Sync controlled isOpen prop\n\tuseEffect(() => {\n\t\tif (typeof isOpenProp === 'boolean') {\n\t\t\tsetIsOpenState(isOpenProp);\n\t\t\tif (!isOpenProp) {\n\t\t\t\tsetActiveOption(undefined);\n\t\t\t\tsetActiveOptionIndex(-1);\n\t\t\t}\n\t\t}\n\t}, [isOpenProp]);\n\n\t// Handle options change - maintain active highlight\n\tuseEffect(() => {\n\t\tconst opts = getOptions();\n\t\tif (activeOption) {\n\t\t\tconst index = findIndex(opts, (item) => isEqual(item, activeOption));\n\t\t\tif (index !== -1) {\n\t\t\t\tsetActiveOptionIndex(index);\n\t\t\t} else {\n\t\t\t\tsetActiveOption(undefined);\n\t\t\t\tsetActiveOptionIndex(-1);\n\t\t\t}\n\t\t}\n\t}, [options, getOptions, activeOption]);\n\n\t// Handle selection change - update active selected option\n\tuseEffect(() => {\n\t\tif (selection.length > 0 && !activeSelectedOption) {\n\t\t\tsetActiveSelectedOption(selection[0]);\n\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t}\n\t}, [selection, activeSelectedOption]);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (currentOpenDropdown && currentOpenDropdown.handleClose === handleClose) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t};\n\t}, [handleClose]);\n\n\t// ===== Render Helpers =====\n\n\tconst getCustomPopoverProps = useCallback((body: ReactNode) => {\n\t\tconst popoverBody = (\n\t\t\t<div>\n\t\t\t\t<div className=\"slds-assistive-text\" id={`${getId()}-label`}>\n\t\t\t\t\t{assistiveText.popoverLabel}\n\t\t\t\t</div>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\n\t\tconst popoverFooter = (\n\t\t\t<div>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\thandleClose(e, { trigger: 'cancel' });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.doneButton}\n\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\tonClick={handleClose as unknown as (event: React.MouseEvent<HTMLButtonElement>) => void}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\n\t\tconst defaultPopoverProps: Record<string, unknown> = {\n\t\t\tariaLabelledby: `${getId()}-label`,\n\t\t\talign: 'bottom',\n\t\t\tbody: popoverBody,\n\t\t\tclassName: 'slds-popover_full-width',\n\t\t\tfooter: popoverFooter,\n\t\t\tfooterClassName: 'slds-popover__footer_form',\n\t\t\thasNoNubbin: true,\n\t\t\tid: getId(),\n\t\t\tisOpen: isOpenState,\n\t\t\thasNoTriggerStyles: true,\n\t\t\tonOpen: handleOpen,\n\t\t\tonClose: handleClose,\n\t\t\tonRequestClose: handleClose,\n\t\t};\n\n\t\tconst popoverPropsFromProp = popover?.props as Record<string, unknown> | undefined;\n\t\tconst popoverProps = assign(\n\t\t\tdefaultPopoverProps,\n\t\t\tpopoverPropsFromProp || {}\n\t\t);\n\t\tpopoverProps.body = popoverBody;\n\n\t\tdelete popoverProps.children;\n\t\treturn popoverProps;\n\t}, [getId, assistiveText.popoverLabel, labels.cancelButton, labels.doneButton, handleClose, isOpenState, handleOpen, popover]);\n\n\tconst getDialog = useCallback(({ menuRenderer }: { menuRenderer: ReactNode }) => {\n\t\tconst position = menuPosition;\n\n\t\tif (!disabled && getIsOpen()) {\n\t\t\tconst dialogProps = {\n\t\t\t\talign: 'bottom left' as const,\n\t\t\t\tcontext: iconSettingsContext,\n\t\t\t\thasStaticAlignment,\n\t\t\t\tinheritWidthOf,\n\t\t\t\tonClose: handleClose,\n\t\t\t\tonMouseDown: (event: React.MouseEvent) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t\tonOpen: handleOpen,\n\t\t\t\tonRequestTargetElement: getTargetElement,\n\t\t\t\tposition,\n\t\t\t\tcontainerProps: {\n\t\t\t\t\tid: `${getId()}-listbox`,\n\t\t\t\t\trole: 'listbox',\n\t\t\t\t},\n\t\t\t};\n\t\t\treturn (\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t<Dialog {...(dialogProps as any)}>\n\t\t\t\t\t{menuRenderer}\n\t\t\t\t</Dialog>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}, [menuPosition, disabled, getIsOpen, iconSettingsContext, hasStaticAlignment, inheritWidthOf, handleClose, handleOpen, getTargetElement, getId]);\n\n\tconst renderMenu = useCallback(() => {\n\t\tconst menuVariant: Record<string, 'icon-title-subtitle' | 'checkbox'> = {\n\t\t\tbase: 'icon-title-subtitle',\n\t\t\t'inline-listbox': 'icon-title-subtitle',\n\t\t\treadonly: 'checkbox',\n\t\t};\n\n\t\tconst readonlyItemVisibleLength = variant === 'readonly' ? 5 : null;\n\n\t\treturn (\n\t\t\t<Menu\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tactiveOption={activeOption}\n\t\t\t\tactiveOptionIndex={activeOptionIndex}\n\t\t\t\tclassNameMenu={classNameMenu}\n\t\t\t\tclassNameMenuSubHeader={classNameMenuSubHeader}\n\t\t\t\tinheritWidthOf={inheritWidthOf}\n\t\t\t\tinputId={getId()}\n\t\t\t\tinputValue={value}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\titemVisibleLength={menuItemVisibleLength || readonlyItemVisibleLength}\n\t\t\t\tlabels={{ noOptionsFound: labels.noOptionsFound || '' }}\n\t\t\t\thasMenuSpinner={hasMenuSpinner}\n\t\t\t\tmenuPosition={menuPosition}\n\t\t\t\tmenuRef={setMenuRefCallback}\n\t\t\t\tmaxWidth={menuMaxWidth}\n\t\t\t\toptions={getOptions()}\n\t\t\t\tonSelect={handleSelect as (event: React.MouseEvent, data: { option: ComboboxOption; selection?: ComboboxOption[] }) => void}\n\t\t\t\tonRenderMenuItem={onRenderMenuItem || menuItem}\n\t\t\t\tselection={selection}\n\t\t\t\ttooltipMenuItemDisabled={tooltipMenuItemDisabled}\n\t\t\t\tvariant={menuVariant[variant]}\n\t\t\t/>\n\t\t);\n\t}, [variant, assistiveText, activeOption, activeOptionIndex, classNameMenu, classNameMenuSubHeader, inheritWidthOf, getId, value, isSelected, menuItemVisibleLength, labels.noOptionsFound, hasMenuSpinner, menuPosition, setMenuRefCallback, menuMaxWidth, getOptions, handleSelect, onRenderMenuItem, menuItem, selection, tooltipMenuItemDisabled]);\n\n\t// User defined props from input\n\tconst userDefinedInputProps = input?.props || {};\n\n\t// ===== Sub-renders =====\n\n\tconst renderBase = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-owns={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<SelectedListBox\n\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\tevents={{\n\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t}}\n\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\tlabels={labels}\n\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t/>\n\t\t\t{errorText && (\n\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\tconst renderInlineMultiple = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selection.length ? (\n\t\t\t\t\t<SelectedListBox\n\t\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\t\t\tcontainerRole=\"listbox\"\n\t\t\t\t\t\tcontainerAriaOrientation=\"horizontal\"\n\t\t\t\t\t\tlistboxRole=\"group\"\n\t\t\t\t\t\tlistboxAriaOrientation={null}\n\t\t\t\t\t\tevents={{\n\t\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\t\tlabels={labels}\n\t\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tconst renderInlineSingle = () => {\n\t\tconst selectedIcon = selection[0]?.icon;\n\t\tconst iconLeft =\n\t\t\tselectedIcon && React.isValidElement(selectedIcon)\n\t\t\t\t? React.cloneElement(selectedIcon, {\n\t\t\t\t\t\tcontainerClassName: 'slds-combobox__input-entity-icon',\n\t\t\t\t } as Record<string, unknown>)\n\t\t\t\t: null;\n\n\t\tconst inputValue =\n\t\t\tselection[0]?.label\n\t\t\t\t? selection[0].label as string\n\t\t\t\t: value;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={singleInputDisabled}\n\t\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\tselection.length ? (\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\t\t\t\ticon: assistiveText.removeSingleSelectedOption,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tbuttonRef={(component: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\t\t\t\tbuttonRef.current = component;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\thandleRemoveSelectedOption(event, {\n\t\t\t\t\t\t\t\t\t\t\t\toption: selection[0],\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"search\" />\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\treadOnly={\n\t\t\t\t\t\t\t\t!!(predefinedOptionsOnly && activeOption) ||\n\t\t\t\t\t\t\t\t!!selection.length\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t\t: inputValue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderPopover = () => {\n\t\tconst popoverPropsFromProp = popover?.props as { body?: ReactNode } | undefined;\n\t\tconst popoverProps = getCustomPopoverProps(popoverPropsFromProp?.body);\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* @ts-expect-error - popoverProps contains body from getCustomPopoverProps */}\n\t\t\t\t\t<Popover {...popoverProps}>\n\t\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\t\t\t\taria-controls={\n\t\t\t\t\t\t\t\t\tgetIsOpen() ? `${getId()}-popover` : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"combobox\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlyMultiple = () => {\n\t\tconst displayValue =\n\t\t\tselection.length > 1\n\t\t\t\t? labels.multipleOptionsSelected ||\n\t\t\t\t `${selection.length} options selected`\n\t\t\t\t: (selection[0]?.label as string) || '';\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<SelectedListBox\n\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t}}\n\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\trenderAtSelectionLength={2}\n\t\t\t\t/>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlySingle = () => {\n\t\tconst activeOptionLabel = activeOption?.label as string | undefined;\n\t\tconst selectedOptionLabel = selection[0]?.label as string | undefined;\n\t\tlet inputValue = activeOptionLabel || selectedOptionLabel || '';\n\n\t\tif (selection[0]?.value === '') {\n\t\t\tinputValue = '';\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={singleInputDisabled}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// ===== Main Render =====\n\n\tconst hasRenderedLabel = labels.label || assistiveText?.label;\n\n\tconst subRenders: Record<string, Record<string, () => ReactNode>> = {\n\t\tbase: {\n\t\t\tmultiple: renderBase,\n\t\t\tsingle: renderBase,\n\t\t},\n\t\t'inline-listbox': {\n\t\t\tmultiple: renderInlineMultiple,\n\t\t\tsingle: renderInlineSingle,\n\t\t},\n\t\tpopover: {\n\t\t\tmultiple: renderPopover,\n\t\t\tsingle: renderPopover,\n\t\t},\n\t\treadonly: {\n\t\t\tmultiple: renderReadOnlyMultiple,\n\t\t\tsingle: renderReadOnlySingle,\n\t\t},\n\t};\n\n\tconst multipleOrSingle = multiple ? 'multiple' : 'single';\n\tconst variantRenderer = subRenders[variant]?.[multipleOrSingle];\n\n\tconst mainCombobox = (\n\t\t<div\n\t\t\tclassName={classNames('slds-form-element', classNameContainer)}\n\t\t>\n\t\t\t{entityCombobox ? null : (\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText as unknown as { label?: string; [key: string]: unknown }}\n\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\tlabel={labels.label}\n\t\t\t\t\trequired={required}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip as any}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{variantRenderer\n\t\t\t\t? variantRenderer()\n\t\t\t\t: subRenders.base.multiple()}\n\t\t</div>\n\t);\n\n\treturn entityCombobox ? (\n\t\t<div className=\"slds-form-element\">\n\t\t\t<Label\n\t\t\t\tassistiveText={assistiveText as unknown as { label?: string; [key: string]: unknown }}\n\t\t\t\thtmlFor={getId()}\n\t\t\t\tlabel={labels.label}\n\t\t\t\trequired={required}\n\t\t\t/>\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox-group\">\n\t\t\t\t\t<div className=\"slds-combobox_object-switcher slds-combobox-addon_start\">\n\t\t\t\t\t\t{entityCombobox}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"slds-combobox_container slds-combobox-addon_end\">\n\t\t\t\t\t\t{mainCombobox}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t) : (\n\t\tmainCombobox\n\t);\n};\n\nCombobox.displayName = COMBOBOX;\n\nexport default Combobox;\n\n"],"mappings":"4wCA8CA,IAAI,EACE,GAAkB,OAAO,SAAa,IAsItC,GAAwD,CAC7D,MAAO,GACP,iBAAkB,UAClB,qBAAsB,qBACtB,aAAc,GACd,2BAA4B,yBAC5B,WAAY,wCACZ,qBAAsB,mBACvB,EAEM,GAA0C,CAC/C,eAAgB,OAChB,MAAO,GACP,aAAc,SACd,WAAY,OACZ,wBAAyB,GACzB,eAAgB,oBAChB,YAAa,GACb,oBAAqB,mBACrB,gBAAiB,SACjB,2BAA4B,2BAC5B,eAAgB,EACjB,EAEM,GAAgC,CAAC,EAIjC,GAAqC,GAAU,CACpD,GAAM,CACL,cAAe,GAAoB,CAAC,EACpC,mBAAoB,GACpB,YACA,sBACA,iBACA,0BACA,eACA,YACA,kBACA,YACA,OAAQ,GAAa,CAAC,E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,CACL,SAAU,GACV,OAAQ,EACT,EACA,iBAAkB,CACjB,SAAU,GACV,OAAQ,EACT,EACA,QAAS,CACR,SAAU,GACV,OAAQ,EACT,EACA,SAAU,CACT,SAAU,GACV,OAAQ,EACT,CACD,EAEM,GAAmB,EAAW,WAAa,SAC3C,GAAkB,GAAW,EAAQ,GAAG,IAExC,IACL,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,oBAAqB,EAAkB,EAD9D,SAAA,CAGE,GAAiB,MACjB,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACgB,gBACf,QAAS,EAAM,EACf,MAAO,EAAO,MACJ,UACV,CAAA,EAED,IAAyB,IACzB,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CAEwB,wBACvB,CAAA,EACE,KACH,GACE,GAAgB,EAChB,GAAW,KAAK,SAAS,CACxB,IAGN,OAAO,IACN,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACgB,gBACf,QAAS,EAAM,EACf,MAAO,EAAO,MACJ,UACV,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACd,UAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sBAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0DACb,SAAA,EACG,CAAA,GAEL,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,kDACb,SAAA,EACG,CAAA,CACD,GACD,CAAA,CACD,CAEL,CAAA,EAAA,EAEF,EAEA,GAAS,YAAc,EAAA"}
1
+ {"version":3,"file":"combobox.cjs","names":[],"sources":["../../../../components/combobox/combobox.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, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport find from 'lodash.find';\nimport reject from 'lodash.reject';\nimport { dequal as isEqual } from 'dequal';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Dialog from '../utilities/dialog';\nimport InnerInput from '../input/private/inner-input';\nimport InputIcon from '../icon/input-icon';\nimport Menu, { type ComboboxOption } from './private/menu';\nimport Label from '../forms/private/label';\nimport Popover from '../popover';\nimport SelectedListBox from '../pill-container/private/selected-listbox';\n\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport KEYS from '../../utilities/key-code';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyLetterMenuItemSelect from '../../utilities/key-letter-menu-item-select';\nimport mapKeyEventCallbacks from '../../utilities/key-callbacks';\nimport menuItemSelectScroll from '../../utilities/menu-item-select-scroll';\n\nimport checkProps from './check-props';\n\nimport { COMBOBOX } from '../../utilities/constants';\nimport type { SelectedListBoxOption } from '../pill-container/private/selected-listbox';\nimport generateId from '../../utilities/generate-id';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\nlet currentOpenDropdown: { handleClose: () => void } | undefined;\nconst documentDefined = typeof document !== 'undefined';\n\n// ===== Types =====\n\nexport interface ComboboxAssistiveText {\n\tlabel?: string;\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n\tpopoverLabel?: string;\n\tremoveSingleSelectedOption?: string;\n\tremovePill?: string;\n\tselectedListboxLabel?: string;\n}\n\nexport interface ComboboxLabels {\n\tdeselectOption?: string;\n\tlabel?: ReactNode | string;\n\tcancelButton?: string;\n\tdoneButton?: string;\n\tmultipleOptionsSelected?: string;\n\tnoOptionsFound?: ReactNode | string;\n\tplaceholder?: string;\n\tplaceholderReadOnly?: string;\n\tremovePillTitle?: string;\n\toptionDisabledTooltipLabel?: string;\n\tinputIconTitle?: string;\n}\n\nexport interface ComboboxEvents {\n\tonBlur?: (event: React.FocusEvent) => void;\n\tonChange?: (event: React.ChangeEvent<HTMLInputElement>, data: { value: string }) => void;\n\tonClose?: (event: React.SyntheticEvent | undefined, data: Record<string, unknown>) => void;\n\tonFocus?: (event: React.FocusEvent, data: Record<string, unknown>) => void;\n\tonOpen?: (event: React.SyntheticEvent | undefined, data: Record<string, unknown>) => void;\n\tonRequestClose?: (event: React.SyntheticEvent, data: Record<string, unknown>) => void;\n\tonRequestOpen?: () => void;\n\tonRequestRemoveSelectedOption?: (event: React.SyntheticEvent, data: { selection: ComboboxOption[] }) => void;\n\tonSelect?: (event: React.SyntheticEvent, data: { selection: ComboboxOption[] }) => void;\n\tonSubmit?: (event: React.KeyboardEvent, data: { value: string }) => void;\n}\n\nexport interface ComboboxProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ComboboxAssistiveText;\n\t/** aria-describedby attribute */\n\t'aria-describedby'?: string;\n\t/** CSS classes for combobox container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for top level container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for dropdown menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu sub header */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** Default input value for uncontrolled usage */\n\tdefaultValue?: string;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Entity combobox for grouped comboboxes */\n\tentityCombobox?: ReactNode;\n\t/** Error text to display */\n\terrorText?: string;\n\t/** Event callbacks */\n\tevents?: ComboboxEvents;\n\t/** Field level help tooltip */\n\tfieldLevelHelpTooltip?: ReactNode;\n\t/** Whether to show deselect option */\n\thasDeselect?: boolean;\n\t/** Whether to show input spinner */\n\thasInputSpinner?: boolean;\n\t/** Whether to show menu spinner */\n\thasMenuSpinner?: boolean;\n\t/** Whether to use static alignment */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Sets dialog width inheritance */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Callback to get input ref */\n\tinputRef?: (ref: HTMLInputElement | null) => void;\n\t/** Whether the dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: ComboboxLabels;\n\t/** Menu item visible length */\n\tmenuItemVisibleLength?: 5 | 7 | 10;\n\t/** Menu max width */\n\tmenuMaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Whether multiple selection is allowed */\n\tmultiple?: boolean;\n\t/** Custom menu item renderer */\n\tonRenderMenuItem?: React.ComponentType<{\n\t\tassistiveText?: ComboboxAssistiveText;\n\t\tselected: boolean;\n\t\toption: ComboboxOption;\n\t}>;\n\t/** Menu options */\n\toptions?: ComboboxOption[];\n\t/** Options to add items */\n\toptionsAddItem?: Array<{ id?: string; icon?: ReactNode; label?: string | ((searchTerm: string) => ReactNode) }>;\n\t/** Options for search entity */\n\toptionsSearchEntity?: Array<{ id?: string; icon?: ReactNode; label?: string | ((searchTerm: string) => ReactNode) }>;\n\t/** Popover component for popover variant */\n\tpopover?: ReactElement;\n\t/** Whether only predefined options are allowed */\n\tpredefinedOptionsOnly?: boolean;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Callback to get selected listbox ref */\n\tselectedListboxRef?: (ref: HTMLUListElement | null) => void;\n\t/** Whether single input is disabled */\n\tsingleInputDisabled?: boolean;\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement;\n\t/** Input value (controlled) */\n\tvalue?: string;\n\t/** Combobox variant */\n\tvariant?: 'base' | 'inline-listbox' | 'popover' | 'readonly';\n\t/** @deprecated Use menuItem instead */\n\tmenuItem?: React.ComponentType<{\n\t\tassistiveText?: ComboboxAssistiveText;\n\t\tselected: boolean;\n\t\toption: ComboboxOption;\n\t}>;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<ComboboxAssistiveText> = {\n\tlabel: '',\n\tloadingMenuItems: 'Loading',\n\toptionSelectedInMenu: 'Current Selection:',\n\tpopoverLabel: '',\n\tremoveSingleSelectedOption: 'Remove selected option',\n\tremovePill: ', Press delete or backspace to remove',\n\tselectedListboxLabel: 'Selected Options:',\n};\n\nconst defaultLabels: Required<ComboboxLabels> = {\n\tdeselectOption: 'None',\n\tlabel: '',\n\tcancelButton: 'Cancel',\n\tdoneButton: 'Done',\n\tmultipleOptionsSelected: '',\n\tnoOptionsFound: 'No matches found.',\n\tplaceholder: '',\n\tplaceholderReadOnly: 'Select an Option',\n\tremovePillTitle: 'Remove',\n\toptionDisabledTooltipLabel: 'This option is disabled.',\n\tinputIconTitle: '',\n};\n\nconst defaultEvents: ComboboxEvents = {};\n\n// ===== Component =====\n\nconst Combobox: React.FC<ComboboxProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\t'aria-describedby': ariaDescribedby,\n\t\tclassName,\n\t\tclassNameContainer,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\tentityCombobox,\n\t\terrorText,\n\t\tevents: eventsProp = {},\n\t\tfieldLevelHelpTooltip,\n\t\thasDeselect,\n\t\thasInputSpinner,\n\t\thasMenuSpinner,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinheritWidthOf = 'target',\n\t\tinput,\n\t\tinputRef: inputRefCallback,\n\t\tisOpen: isOpenProp,\n\t\tlabels: labelsProp = {},\n\t\tmenuItemVisibleLength,\n\t\tmenuMaxWidth,\n\t\tmenuPosition = 'absolute',\n\t\tmultiple,\n\t\tonRenderMenuItem,\n\t\toptions = [],\n\t\toptionsAddItem = [],\n\t\toptionsSearchEntity = [],\n\t\tpopover,\n\t\tpredefinedOptionsOnly,\n\t\trequired = false,\n\t\tselection = [],\n\t\tselectedListboxRef: selectedListboxRefCallback,\n\t\tsingleInputDisabled = false,\n\t\ttooltipMenuItemDisabled,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\tmenuItem,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\tconst events = assign({}, defaultEvents, eventsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst menuRef = useRef<HTMLUListElement | null>(null);\n\tconst selectedListboxRef = useRef<HTMLUListElement | null>(null);\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst buttonRef = useRef<HTMLButtonElement | null>(null);\n\tconst menuKeyBuffer = useRef(new KeyBuffer());\n\n\t// Generated IDs\n\tconst generatedId = useRef(generateId());\n\tconst generatedErrorId = useRef(generateId());\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\tconst deselectId = `${getId()}-deselect`;\n\n\t// State\n\tconst [activeOption, setActiveOption] = useState<ComboboxOption | undefined>(undefined);\n\tconst [activeOptionIndex, setActiveOptionIndex] = useState(-1);\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<ComboboxOption | undefined>(\n\t\tselection?.[0]\n\t);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\tconst [isOpenState, setIsOpenState] = useState(typeof isOpenProp === 'boolean' ? isOpenProp : false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\tcheckProps(COMBOBOX, props as unknown as Record<string, unknown>, componentDoc);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getIsActiveOption = useCallback(() => {\n\t\treturn activeOption && activeOptionIndex !== -1;\n\t}, [activeOption, activeOptionIndex]);\n\n\tconst getErrorId = useCallback(() => {\n\t\treturn ariaDescribedby || (errorText && generatedErrorId.current);\n\t}, [ariaDescribedby, errorText]);\n\n\t// Build options list\n\tconst getOptions = useCallback(() => {\n\t\tconst deselectOption: ComboboxOption = {\n\t\t\tid: deselectId,\n\t\t\tlabel: labels.deselectOption,\n\t\t\tvalue: '',\n\t\t\ttype: 'deselect',\n\t\t};\n\n\t\tconst localOptionsSearchEntity = optionsSearchEntity.map((entity) => ({\n\t\t\t...entity,\n\t\t\ttype: 'header' as const,\n\t\t\tid: entity.id || '',\n\t\t}));\n\n\t\tconst localOptionsAddItem = optionsAddItem.map((entity) => ({\n\t\t\t...entity,\n\t\t\ttype: 'footer' as const,\n\t\t\tid: entity.id || '',\n\t\t}));\n\n\t\treturn [\n\t\t\t...(localOptionsSearchEntity.length > 0 ? localOptionsSearchEntity : []),\n\t\t\t...(hasDeselect ? [deselectOption] : []),\n\t\t\t...(options && options.length > 0 ? options : []),\n\t\t\t...(localOptionsAddItem.length > 0 ? localOptionsAddItem : []),\n\t\t];\n\t}, [deselectId, labels.deselectOption, optionsSearchEntity, optionsAddItem, hasDeselect, options]);\n\n\tconst isSelected = useCallback(({ selection: sel, option }: { selection: ComboboxOption[]; option: ComboboxOption }) => {\n\t\treturn !!find(sel, option);\n\t}, []);\n\n\t// Get new active option index (for navigation)\n\tconst getNewActiveOptionIndex = useCallback(({\n\t\tactiveOptionIndex: currentIndex,\n\t\toffset,\n\t\toptions: opts,\n\t}: {\n\t\tactiveOptionIndex: number;\n\t\toffset: number;\n\t\toptions: ComboboxOption[];\n\t}) => {\n\t\tconst nextIndex = currentIndex + offset;\n\t\tconst skipIndex =\n\t\t\topts.length > nextIndex &&\n\t\t\tnextIndex >= 0 &&\n\t\t\topts[nextIndex].type === 'separator';\n\t\tconst newIndex = skipIndex ? nextIndex + offset : nextIndex;\n\t\tconst hasNewIndex = opts.length > nextIndex && nextIndex >= 0;\n\t\treturn hasNewIndex ? newIndex : currentIndex;\n\t}, []);\n\n\t// ===== Event Handlers =====\n\n\tconst handleClose = useCallback((event?: React.SyntheticEvent, { trigger }: { trigger?: string } = {}) => {\n\t\tconst isOpen = getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tif (currentOpenDropdown && currentOpenDropdown.handleClose === handleClose) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t\tsetIsOpenState(false);\n\n\t\t\tif (variant === 'popover' && trigger === 'cancel') {\n\t\t\t\tconst popoverProps = popover?.props as { onClose?: (event: unknown, data: { trigger: string }) => void } | undefined;\n\t\t\t\tif (popoverProps?.onClose) {\n\t\t\t\t\tpopoverProps.onClose(event, { trigger });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (events.onClose) {\n\t\t\t\tevents.onClose(event, {});\n\t\t\t}\n\t\t}\n\t}, [getIsOpen, variant, popover, events]);\n\n\tconst handleOpen = useCallback((event?: React.SyntheticEvent, data?: Record<string, unknown>) => {\n\t\tconst isOpen = getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentOpenDropdown = { handleClose };\n\n\t\t\tsetIsOpenState(true);\n\n\t\t\tif (events.onOpen) {\n\t\t\t\tevents.onOpen(event, data || {});\n\t\t\t}\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tconst opts = getOptions();\n\t\t\t\tconst idx = findIndex(opts, (item) => isEqual(item, selection[0]));\n\n\t\t\t\tsetActiveOptionIndex(idx);\n\t\t\t\tsetActiveOption(selection[0]);\n\n\t\t\t\tif (menuRef.current !== null) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: idx,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [getIsOpen, handleClose, events, variant, getOptions, selection]);\n\n\tconst handleRequestClose = useCallback((event: React.SyntheticEvent, data: Record<string, unknown>) => {\n\t\tif (events.onRequestClose) {\n\t\t\tevents.onRequestClose(event, data);\n\t\t}\n\t\tif (getIsOpen()) {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t}\n\t}, [events, getIsOpen, handleClose]);\n\n\tconst openDialog = useCallback(() => {\n\t\tif (events.onRequestOpen) {\n\t\t\tevents.onRequestOpen();\n\t\t} else {\n\t\t\tsetIsOpenState(true);\n\t\t}\n\t}, [events]);\n\n\tconst requestOpenMenu = useCallback(() => {\n\t\tconst isInlineSingleSelectionAndIsNotSelected =\n\t\t\t!multiple &&\n\t\t\tselection.length === 0 &&\n\t\t\tvariant === 'inline-listbox';\n\n\t\tif (\n\t\t\tisInlineSingleSelectionAndIsNotSelected ||\n\t\t\tmultiple ||\n\t\t\tvariant === 'readonly'\n\t\t) {\n\t\t\topenDialog();\n\t\t}\n\t}, [multiple, selection.length, variant, openDialog]);\n\n\tconst handleClickOutside = useCallback((event: MouseEvent | TouchEvent) => {\n\t\thandleRequestClose(event as unknown as React.SyntheticEvent, {});\n\t}, [handleRequestClose]);\n\n\tconst handleSelect = useCallback((event: React.SyntheticEvent, { selection: sel, option }: { selection: ComboboxOption[]; option: ComboboxOption }) => {\n\t\tlet newSelection: ComboboxOption[];\n\t\tconst selected = isSelected({ selection: sel, option });\n\t\tconst singleSelectAndSelectedWasNotClicked = !multiple && !selected;\n\t\tconst multiSelectAndSelectedWasNotClicked = multiple && !selected;\n\t\tconst deselectWasClicked = option.id === deselectId;\n\n\t\tif (deselectWasClicked) {\n\t\t\tnewSelection = [];\n\t\t} else if (singleSelectAndSelectedWasNotClicked) {\n\t\t\tnewSelection = [option];\n\t\t} else if (multiSelectAndSelectedWasNotClicked) {\n\t\t\tnewSelection = [...selection, option];\n\t\t} else {\n\t\t\tnewSelection = reject(selection, option);\n\t\t}\n\n\t\tif (events.onSelect) {\n\t\t\tevents.onSelect(event, { selection: newSelection });\n\t\t}\n\n\t\thandleClose();\n\t}, [isSelected, multiple, deselectId, selection, events, handleClose]);\n\n\tconst handleInputBlur = useCallback((event: React.FocusEvent) => {\n\t\tsetTimeout(() => {\n\t\t\tconst activeElement = documentDefined ? document.activeElement : null;\n\t\t\tif (\n\t\t\t\tactiveElement &&\n\t\t\t\tactiveElement.tagName === 'DIV' &&\n\t\t\t\tactiveElement.id === `${getId()}-listbox`\n\t\t\t) {\n\t\t\t\tif (inputRef.current) {\n\t\t\t\t\tinputRef.current.focus();\n\t\t\t\t}\n\t\t\t} else if (!popover) {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t}, 200);\n\n\t\tif (events.onBlur) {\n\t\t\tevents.onBlur(event);\n\t\t}\n\t}, [getId, popover, handleClose, events]);\n\n\tconst handleInputChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n\t\trequestOpenMenu();\n\t\tif (events.onChange) {\n\t\t\tevents.onChange(event, { value: event.target.value });\n\t\t}\n\t}, [requestOpenMenu, events]);\n\n\tconst handleInputFocus = useCallback((event: React.FocusEvent) => {\n\t\tif (events.onFocus) {\n\t\t\tevents.onFocus(event, {});\n\t\t}\n\t}, [events]);\n\n\tconst handleInputSubmit = useCallback((event: React.KeyboardEvent) => {\n\t\tif (activeOption === undefined && activeOptionIndex === -1) {\n\t\t\tif (!isOpenState) {\n\t\t\t\tif (!event.shiftKey) {\n\t\t\t\t\topenDialog();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandleRequestClose(event, {});\n\t\t\t}\n\t\t}\n\n\t\tif (activeOption?.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tactiveOption &&\n\t\t\t(activeOption.type === 'header' || activeOption.type === 'footer')\n\t\t) {\n\t\t\tactiveOption.onClick?.(event as unknown as React.MouseEvent);\n\t\t\treturn;\n\t\t}\n\n\t\tif (getIsActiveOption()) {\n\t\t\thandleSelect(event, {\n\t\t\t\toption: activeOption!,\n\t\t\t\tselection,\n\t\t\t});\n\t\t} else if (\n\t\t\t!predefinedOptionsOnly &&\n\t\t\t(event.target as HTMLInputElement).value !== '' &&\n\t\t\tevents.onSubmit\n\t\t) {\n\t\t\tevents.onSubmit(event, {\n\t\t\t\tvalue: (event.target as HTMLInputElement).value,\n\t\t\t});\n\t\t}\n\t}, [activeOption, activeOptionIndex, isOpenState, openDialog, handleRequestClose, getIsActiveOption, handleSelect, selection, predefinedOptionsOnly, events]);\n\n\tconst handleNavigateListboxMenu = useCallback((event: React.KeyboardEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\tconst offsets = { next: 1, previous: -1 };\n\t\tconst opts = getOptions();\n\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\tactiveOptionIndex,\n\t\t\toffset: offsets[direction],\n\t\t\toptions: opts,\n\t\t});\n\n\t\tif (getIsOpen() && menuRef.current) {\n\t\t\tmenuItemSelectScroll({\n\t\t\t\tcontainer: menuRef.current,\n\t\t\t\tfocusedIndex: newIndex,\n\t\t\t});\n\t\t}\n\n\t\tsetActiveOption(opts[newIndex]);\n\t\tsetActiveOptionIndex(newIndex);\n\t}, [getOptions, getNewActiveOptionIndex, activeOptionIndex, getIsOpen]);\n\n\tconst handleNavigateSelectedListbox = useCallback((event: React.SyntheticEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\tconst offsets = { next: 1, previous: -1 };\n\t\tconst isLastOptionAndRightIsPressed =\n\t\t\tactiveSelectedOptionIndex + 1 === selection.length && direction === 'next';\n\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\tsetActiveSelectedOption(selection[0]);\n\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\tsetActiveSelectedOption(selection[selection.length - 1]);\n\t\t\tsetActiveSelectedOptionIndex(selection.length - 1);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else {\n\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\tactiveOptionIndex: activeSelectedOptionIndex,\n\t\t\t\toffset: offsets[direction],\n\t\t\t\toptions: selection,\n\t\t\t});\n\t\t\tsetActiveSelectedOption(selection[newIndex]);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, [activeSelectedOptionIndex, selection, getNewActiveOptionIndex]);\n\n\tconst handleKeyDownDown = useCallback((event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey) {\n\t\t\topenDialog();\n\t\t}\n\n\t\tif (variant !== 'popover') {\n\t\t\thandleNavigateListboxMenu(event, { direction: 'next' });\n\t\t}\n\t}, [openDialog, variant, handleNavigateListboxMenu]);\n\n\tconst handleKeyDownUp = useCallback((event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey && getIsOpen()) {\n\t\t\thandleNavigateListboxMenu(event, { direction: 'previous' });\n\t\t}\n\t}, [getIsOpen, handleNavigateListboxMenu]);\n\n\tconst handleKeyDownTab = useCallback(() => {\n\t\tif (selectedListboxRef.current) {\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, []);\n\n\tconst handleKeyDownOther = useCallback((event: React.KeyboardEvent) => {\n\t\tconst opts = getOptions();\n\t\tconst newActiveOptionIndex = keyLetterMenuItemSelect({\n\t\t\tkey: event.key,\n\t\t\tkeyBuffer: menuKeyBuffer.current,\n\t\t\tkeyCode: event.keyCode,\n\t\t\toptions: opts,\n\t\t});\n\n\t\tif (newActiveOptionIndex !== undefined) {\n\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\tfocusedIndex: newActiveOptionIndex,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetActiveOption(opts[newActiveOptionIndex]);\n\t\t\tsetActiveOptionIndex(newActiveOptionIndex);\n\t\t}\n\t}, [getOptions, getIsOpen]);\n\n\tconst handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n\t\tconst callbacks: Record<number | string, { callback: (e: React.KeyboardEvent) => void; stopPropagation?: boolean } | undefined> = {\n\t\t\t[KEYS.DOWN]: { callback: handleKeyDownDown },\n\t\t\t[KEYS.ENTER]: { callback: handleInputSubmit },\n\t\t\t[KEYS.ESCAPE]: { callback: handleClose as (e: React.KeyboardEvent) => void },\n\t\t\t[KEYS.UP]: { callback: handleKeyDownUp },\n\t\t};\n\n\t\tif (variant === 'readonly') {\n\t\t\tif (selection.length > 2) {\n\t\t\t\tcallbacks[KEYS.TAB] = { callback: handleKeyDownTab };\n\t\t\t} else {\n\t\t\t\tcallbacks[KEYS.TAB] = undefined;\n\t\t\t}\n\t\t\tcallbacks.other = {\n\t\t\t\tcallback: handleKeyDownOther,\n\t\t\t\tstopPropagation: false,\n\t\t\t};\n\t\t}\n\n\t\tconst stopPropagation = getIsOpen();\n\n\t\tmapKeyEventCallbacks(event, { callbacks, stopPropagation });\n\t}, [handleKeyDownDown, handleInputSubmit, handleClose, handleKeyDownUp, variant, selection.length, handleKeyDownTab, handleKeyDownOther, getIsOpen]);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tsetListboxHasFocus(false);\n\t}, []);\n\n\tconst handlePillFocus = useCallback((event: React.FocusEvent, { option, index }: { option: ComboboxOption; index: number }) => {\n\t\tif (!listboxHasFocus) {\n\t\t\tsetActiveSelectedOption(option);\n\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, [listboxHasFocus]);\n\n\tconst handleRemoveSelectedOption = useCallback((event: React.SyntheticEvent, { option, index }: { option: ComboboxOption; index?: number }) => {\n\t\tevent.preventDefault();\n\t\tconst onlyOnePillAndInputExists = selection.length === 1;\n\t\tconst isReadOnlyAndTwoPillsExists =\n\t\t\tselection.length === 2 && variant === 'readonly' && multiple;\n\t\tconst lastPillWasRemoved = index !== undefined && index + 1 === selection.length;\n\n\t\tif (\n\t\t\t(onlyOnePillAndInputExists || isReadOnlyAndTwoPillsExists) &&\n\t\t\tinputRef.current\n\t\t) {\n\t\t\tinputRef.current.focus();\n\t\t} else if (lastPillWasRemoved && index !== undefined) {\n\t\t\tsetActiveSelectedOption(selection[index - 1]);\n\t\t\tsetActiveSelectedOptionIndex(index - 1);\n\t\t\tsetListboxHasFocus(true);\n\t\t} else if (index !== undefined) {\n\t\t\tsetActiveSelectedOption(selection[index + 1]);\n\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\n\t\tif (events.onRequestRemoveSelectedOption) {\n\t\t\tevents.onRequestRemoveSelectedOption(event, {\n\t\t\t\tselection: reject(selection, option),\n\t\t\t});\n\t\t}\n\t}, [selection, variant, multiple, events]);\n\n\tconst handleRequestFocusSelectedListbox = useCallback((event: React.SyntheticEvent, { ref }: { ref: HTMLElement | null }) => {\n\t\tif (ref) {\n\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t}\n\t}, []);\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback((component: HTMLInputElement | null) => {\n\t\tinputRef.current = component;\n\t\tif (!inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t\tif (inputRefCallback) {\n\t\t\tinputRefCallback(component);\n\t\t}\n\t}, [inputRendered, inputRefCallback]);\n\n\tconst setSelectedListboxRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tselectedListboxRef.current = ref;\n\t\tif (selectedListboxRefCallback) {\n\t\t\tselectedListboxRefCallback(ref);\n\t\t}\n\t}, [selectedListboxRefCallback]);\n\n\tconst setMenuRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tmenuRef.current = ref;\n\t}, []);\n\n\tconst getTargetElement = useCallback(() => inputRef.current, []);\n\n\t// ===== Effects =====\n\n\t// Sync controlled isOpen prop\n\tuseEffect(() => {\n\t\tif (typeof isOpenProp === 'boolean') {\n\t\t\tsetIsOpenState(isOpenProp);\n\t\t\tif (!isOpenProp) {\n\t\t\t\tsetActiveOption(undefined);\n\t\t\t\tsetActiveOptionIndex(-1);\n\t\t\t}\n\t\t}\n\t}, [isOpenProp]);\n\n\t// Handle options change - maintain active highlight\n\tuseEffect(() => {\n\t\tconst opts = getOptions();\n\t\tif (activeOption) {\n\t\t\tconst index = findIndex(opts, (item) => isEqual(item, activeOption));\n\t\t\tif (index !== -1) {\n\t\t\t\tsetActiveOptionIndex(index);\n\t\t\t} else {\n\t\t\t\tsetActiveOption(undefined);\n\t\t\t\tsetActiveOptionIndex(-1);\n\t\t\t}\n\t\t}\n\t}, [options, getOptions, activeOption]);\n\n\t// Handle selection change - keep the active selected option and its roving\n\t// tabindex in sync with `selection`. Besides seeding the initial active\n\t// pill, this clamps the active index when `selection` shrinks. Without the\n\t// clamp, a controlled parent removing a pill through any path other than\n\t// the built-in remove handler could leave the active index pointing past\n\t// the end of `selection`, so no pill receives tabindex=0 and the selected-\n\t// pill listbox becomes unreachable by keyboard (WCAG 2.1.1 / 2.4.3).\n\tuseEffect(() => {\n\t\tif (selection.length === 0) {\n\t\t\tif (activeSelectedOption !== undefined) {\n\t\t\t\tsetActiveSelectedOption(undefined);\n\t\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!activeSelectedOption || !selection[activeSelectedOptionIndex]) {\n\t\t\tconst clampedIndex =\n\t\t\t\tactiveSelectedOptionIndex >= selection.length\n\t\t\t\t\t? selection.length - 1\n\t\t\t\t\t: activeSelectedOptionIndex;\n\t\t\tsetActiveSelectedOption(selection[clampedIndex]);\n\t\t\tsetActiveSelectedOptionIndex(clampedIndex);\n\t\t}\n\t}, [selection, activeSelectedOption, activeSelectedOptionIndex]);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (currentOpenDropdown && currentOpenDropdown.handleClose === handleClose) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t};\n\t}, [handleClose]);\n\n\t// ===== Render Helpers =====\n\n\tconst getCustomPopoverProps = useCallback((body: ReactNode) => {\n\t\tconst popoverBody = (\n\t\t\t<div>\n\t\t\t\t<div className=\"slds-assistive-text\" id={`${getId()}-label`}>\n\t\t\t\t\t{assistiveText.popoverLabel}\n\t\t\t\t</div>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\n\t\tconst popoverFooter = (\n\t\t\t<div>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\thandleClose(e, { trigger: 'cancel' });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.doneButton}\n\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\tonClick={handleClose as unknown as (event: React.MouseEvent<HTMLButtonElement>) => void}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\n\t\tconst defaultPopoverProps: Record<string, unknown> = {\n\t\t\tariaLabelledby: `${getId()}-label`,\n\t\t\talign: 'bottom',\n\t\t\tbody: popoverBody,\n\t\t\tclassName: 'slds-popover_full-width',\n\t\t\tfooter: popoverFooter,\n\t\t\tfooterClassName: 'slds-popover__footer_form',\n\t\t\thasNoNubbin: true,\n\t\t\tid: getId(),\n\t\t\tisOpen: isOpenState,\n\t\t\thasNoTriggerStyles: true,\n\t\t\tonOpen: handleOpen,\n\t\t\tonClose: handleClose,\n\t\t\tonRequestClose: handleClose,\n\t\t};\n\n\t\tconst popoverPropsFromProp = popover?.props as Record<string, unknown> | undefined;\n\t\tconst popoverProps = assign(\n\t\t\tdefaultPopoverProps,\n\t\t\tpopoverPropsFromProp || {}\n\t\t);\n\t\tpopoverProps.body = popoverBody;\n\n\t\tdelete popoverProps.children;\n\t\treturn popoverProps;\n\t}, [getId, assistiveText.popoverLabel, labels.cancelButton, labels.doneButton, handleClose, isOpenState, handleOpen, popover]);\n\n\tconst getDialog = useCallback(({ menuRenderer }: { menuRenderer: ReactNode }) => {\n\t\tconst position = menuPosition;\n\n\t\tif (!disabled && getIsOpen()) {\n\t\t\tconst dialogProps = {\n\t\t\t\talign: 'bottom left' as const,\n\t\t\t\tcontext: iconSettingsContext,\n\t\t\t\thasStaticAlignment,\n\t\t\t\tinheritWidthOf,\n\t\t\t\tonClose: handleClose,\n\t\t\t\tonMouseDown: (event: React.MouseEvent) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t\tonOpen: handleOpen,\n\t\t\t\tonRequestTargetElement: getTargetElement,\n\t\t\t\tposition,\n\t\t\t\tcontainerProps: {\n\t\t\t\t\tid: `${getId()}-listbox`,\n\t\t\t\t\trole: 'listbox',\n\t\t\t\t},\n\t\t\t};\n\t\t\treturn (\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t<Dialog {...(dialogProps as any)}>\n\t\t\t\t\t{menuRenderer}\n\t\t\t\t</Dialog>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}, [menuPosition, disabled, getIsOpen, iconSettingsContext, hasStaticAlignment, inheritWidthOf, handleClose, handleOpen, getTargetElement, getId]);\n\n\tconst renderMenu = useCallback(() => {\n\t\tconst menuVariant: Record<string, 'icon-title-subtitle' | 'checkbox'> = {\n\t\t\tbase: 'icon-title-subtitle',\n\t\t\t'inline-listbox': 'icon-title-subtitle',\n\t\t\treadonly: 'checkbox',\n\t\t};\n\n\t\tconst readonlyItemVisibleLength = variant === 'readonly' ? 5 : null;\n\n\t\treturn (\n\t\t\t<Menu\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tactiveOption={activeOption}\n\t\t\t\tactiveOptionIndex={activeOptionIndex}\n\t\t\t\tclassNameMenu={classNameMenu}\n\t\t\t\tclassNameMenuSubHeader={classNameMenuSubHeader}\n\t\t\t\tinheritWidthOf={inheritWidthOf}\n\t\t\t\tinputId={getId()}\n\t\t\t\tinputValue={value}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\titemVisibleLength={menuItemVisibleLength || readonlyItemVisibleLength}\n\t\t\t\tlabels={{ noOptionsFound: labels.noOptionsFound || '' }}\n\t\t\t\thasMenuSpinner={hasMenuSpinner}\n\t\t\t\tmenuPosition={menuPosition}\n\t\t\t\tmenuRef={setMenuRefCallback}\n\t\t\t\tmaxWidth={menuMaxWidth}\n\t\t\t\toptions={getOptions()}\n\t\t\t\tonSelect={handleSelect as (event: React.MouseEvent, data: { option: ComboboxOption; selection?: ComboboxOption[] }) => void}\n\t\t\t\tonRenderMenuItem={onRenderMenuItem || menuItem}\n\t\t\t\tselection={selection}\n\t\t\t\ttooltipMenuItemDisabled={tooltipMenuItemDisabled}\n\t\t\t\tvariant={menuVariant[variant]}\n\t\t\t/>\n\t\t);\n\t}, [variant, assistiveText, activeOption, activeOptionIndex, classNameMenu, classNameMenuSubHeader, inheritWidthOf, getId, value, isSelected, menuItemVisibleLength, labels.noOptionsFound, hasMenuSpinner, menuPosition, setMenuRefCallback, menuMaxWidth, getOptions, handleSelect, onRenderMenuItem, menuItem, selection, tooltipMenuItemDisabled]);\n\n\t// User defined props from input\n\tconst userDefinedInputProps = input?.props || {};\n\n\t// ===== Sub-renders =====\n\n\tconst renderBase = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-owns={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<SelectedListBox\n\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\tevents={{\n\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t}}\n\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\tlabels={labels}\n\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\tmultiselectable={multiple}\n\t\t\t/>\n\t\t\t{errorText && (\n\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\tconst renderInlineMultiple = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selection.length ? (\n\t\t\t\t\t<SelectedListBox\n\t\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\t\t\tcontainerRole=\"listbox\"\n\t\t\t\t\t\tcontainerAriaOrientation=\"horizontal\"\n\t\t\t\t\t\tlistboxRole=\"group\"\n\t\t\t\t\t\tlistboxAriaOrientation={null}\n\t\t\t\t\t\tevents={{\n\t\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\t\tlabels={labels}\n\t\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tconst renderInlineSingle = () => {\n\t\tconst selectedIcon = selection[0]?.icon;\n\t\tconst iconLeft =\n\t\t\tselectedIcon && React.isValidElement(selectedIcon)\n\t\t\t\t? React.cloneElement(selectedIcon, {\n\t\t\t\t\t\tcontainerClassName: 'slds-combobox__input-entity-icon',\n\t\t\t\t } as Record<string, unknown>)\n\t\t\t\t: null;\n\n\t\tconst inputValue =\n\t\t\tselection[0]?.label\n\t\t\t\t? selection[0].label as string\n\t\t\t\t: value;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={singleInputDisabled}\n\t\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\tselection.length ? (\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\t\t\t\ticon: assistiveText.removeSingleSelectedOption,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tbuttonRef={(component: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\t\t\t\tbuttonRef.current = component;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\thandleRemoveSelectedOption(event, {\n\t\t\t\t\t\t\t\t\t\t\t\toption: selection[0],\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"search\" />\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\treadOnly={\n\t\t\t\t\t\t\t\t!!(predefinedOptionsOnly && activeOption) ||\n\t\t\t\t\t\t\t\t!!selection.length\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t\t? (activeOption?.label as string) || value\n\t\t\t\t\t\t\t\t\t: inputValue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderPopover = () => {\n\t\tconst popoverPropsFromProp = popover?.props as { body?: ReactNode } | undefined;\n\t\tconst popoverProps = getCustomPopoverProps(popoverPropsFromProp?.body);\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* @ts-expect-error - popoverProps contains body from getCustomPopoverProps */}\n\t\t\t\t\t<Popover {...popoverProps}>\n\t\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\t\t\t\taria-controls={\n\t\t\t\t\t\t\t\t\tgetIsOpen() ? `${getId()}-popover` : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"combobox\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\t\tonClick={() => openDialog()}\n\t\t\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlyMultiple = () => {\n\t\tconst displayValue =\n\t\t\tselection.length > 1\n\t\t\t\t? labels.multipleOptionsSelected ||\n\t\t\t\t `${selection.length} options selected`\n\t\t\t\t: (selection[0]?.label as string) || '';\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<SelectedListBox\n\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\tassistiveText={assistiveText as unknown as { removePill?: string; selectedListboxLabel?: string; [key: string]: unknown }}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\tonPillFocus: handlePillFocus as (event: React.FocusEvent, data: { index: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (event: unknown, data: { ref: HTMLElement | null }) => void,\n\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (event: React.SyntheticEvent, data: { direction: 'next' | 'previous' }) => void,\n\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (event: React.MouseEvent | React.KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: SelectedListBoxOption }) => void,\n\t\t\t\t\t}}\n\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\trenderAtSelectionLength={2}\n\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t/>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlySingle = () => {\n\t\tconst activeOptionLabel = activeOption?.label as string | undefined;\n\t\tconst selectedOptionLabel = selection[0]?.label as string | undefined;\n\t\tlet inputValue = activeOptionLabel || selectedOptionLabel || '';\n\n\t\tif (selection[0]?.value === '') {\n\t\t\tinputValue = '';\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\taria-controls={getIsOpen() ? `${getId()}-listbox` : undefined}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={singleInputDisabled}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={() => requestOpenMenu()}\n\t\t\t\t\t\t\tonChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\tif (!selection.length) {\n\t\t\t\t\t\t\t\t\thandleInputChange(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// ===== Main Render =====\n\n\tconst hasRenderedLabel = labels.label || assistiveText?.label;\n\n\tconst subRenders: Record<string, Record<string, () => ReactNode>> = {\n\t\tbase: {\n\t\t\tmultiple: renderBase,\n\t\t\tsingle: renderBase,\n\t\t},\n\t\t'inline-listbox': {\n\t\t\tmultiple: renderInlineMultiple,\n\t\t\tsingle: renderInlineSingle,\n\t\t},\n\t\tpopover: {\n\t\t\tmultiple: renderPopover,\n\t\t\tsingle: renderPopover,\n\t\t},\n\t\treadonly: {\n\t\t\tmultiple: renderReadOnlyMultiple,\n\t\t\tsingle: renderReadOnlySingle,\n\t\t},\n\t};\n\n\tconst multipleOrSingle = multiple ? 'multiple' : 'single';\n\tconst variantRenderer = subRenders[variant]?.[multipleOrSingle];\n\n\tconst mainCombobox = (\n\t\t<div\n\t\t\tclassName={classNames('slds-form-element', classNameContainer)}\n\t\t>\n\t\t\t{entityCombobox ? null : (\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText as unknown as { label?: string; [key: string]: unknown }}\n\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\tlabel={labels.label}\n\t\t\t\t\trequired={required}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip as any}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{variantRenderer\n\t\t\t\t? variantRenderer()\n\t\t\t\t: subRenders.base.multiple()}\n\t\t</div>\n\t);\n\n\treturn entityCombobox ? (\n\t\t<div className=\"slds-form-element\">\n\t\t\t<Label\n\t\t\t\tassistiveText={assistiveText as unknown as { label?: string; [key: string]: unknown }}\n\t\t\t\thtmlFor={getId()}\n\t\t\t\tlabel={labels.label}\n\t\t\t\trequired={required}\n\t\t\t/>\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox-group\">\n\t\t\t\t\t<div className=\"slds-combobox_object-switcher slds-combobox-addon_start\">\n\t\t\t\t\t\t{entityCombobox}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"slds-combobox_container slds-combobox-addon_end\">\n\t\t\t\t\t\t{mainCombobox}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t) : (\n\t\tmainCombobox\n\t);\n};\n\nCombobox.displayName = COM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AD,CAEwB,wBACvB,CAAA,EACE,KACH,GACE,GAAgB,EAChB,GAAW,KAAK,SAAS,CACxB,IAGN,OAAO,IACN,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACgB,gBACf,QAAS,EAAM,EACf,MAAO,EAAO,MACJ,UACV,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACd,UAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sBAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0DACb,SAAA,EACG,CAAA,GAEL,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,kDACb,SAAA,EACG,CAAA,CACD,GACD,CAAA,CACD,CAEL,CAAA,EAAA,EAEF,EAEA,GAAS,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../utilities/highlighter/index.cjs"),r=require("./cell.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=e=>(0,a.jsx)(r.default,{...e,children:(0,a.jsx)(n.default,{search:e.search,children:e.children})});o.displayName=t.DATA_TABLE_CELL,exports.default=o;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./cell.cjs"),r=require("../utilities/highlighter/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=e=>(0,a.jsx)(n.default,{...e,children:(0,a.jsx)(r.default,{search:e.search,children:e.children})});o.displayName=t.DATA_TABLE_CELL,exports.default=o;
2
2
  //# sourceMappingURL=highlight-cell.cjs.map
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/generate-id.cjs"),r=require("../../utilities/key-code.cjs"),i=require("../../utilities/execution-environment.cjs"),a=require("../spinner/index.cjs"),o=require("../../utilities/key-callbacks.cjs"),s=require("./check-props.cjs"),c=require("./component.cjs"),l=require("../../utilities/design-tokens/dist/palette-colors.common.cjs"),u=require("../../utilities/design-tokens/dist/salesforce-skin.common.cjs"),d=require("./private/table-context.cjs"),f=require("./cell.cjs"),p=require("./column.cjs"),m=require("./private/mode.cjs"),h=require("./private/head.cjs"),g=require("./private/row.cjs"),_=require("./row-actions.cjs");let v=require("react");v=e.__toESM(v,1);let y=require("classnames");y=e.__toESM(y,1);let b=require("react/jsx-runtime"),x=require("dequal"),S=require("memoize-one");S=e.__toESM(S,1);let C=require("lodash.assign");C=e.__toESM(C,1);let w=require("lodash.reject");w=e.__toESM(w,1);let T=require("column-resizer");T=e.__toESM(T,1);var{tableBorderRadius:E}=u.default,D=e=>Array.isArray(e)?e.length:0,O={assistiveText:{actionsHeader:`Actions`,columnSort:`Sort by: `,columnSortedAscending:`Sorted Ascending`,columnSortedDescending:`Sorted Descending`,selectAllRows:`Select all rows`,selectRow:`Select row`,selectRowGroup:`Choose a row to select`,loadingMore:`Loading more`},selection:[],disabledSelection:[],hasMore:!1,loadMoreOffset:20,resizable:!1,resizableOptions:{resizeMode:`fit`,draggingClass:`slds-table-column-resizer`}},k=(0,S.default)((e,t,n,r,i,a,o)=>{let s={...O.assistiveText,...e};return t&&(s.actionsHeader=t),a&&(s.selectAllRows=a),r&&(s.columnSortedAscending=r),i&&(s.columnSortedDescending=i),n&&(s.columnSort=n),o&&(s.selectRow=o),s},x.dequal),A=(0,S.default)((e,t,n,r,i,a)=>{let o=[],s=null;return v.default.Children.forEach(e,e=>{let c=e,l=c?.type;if(c&&l?.displayName===p.default.displayName){let{children:e,...n}=c.props,s={fixedLayout:r,search:a,items:i,...n};t&&(s.id=t);let l,u=e,d=u?.type;u&&d?.displayName===`SLDSDataTableCell`?(l=u.type,(0,C.default)(s,u.props)):l=f.default,o.push({Cell:l,props:s})}else if(c&&l?.displayName===_.default.displayName){let{dropdown:e}=c.props,t={};n&&(t.menuPosition=`overflowBoundaryElement`),s=v.default.cloneElement(c,{dropdown:e?v.default.cloneElement(e,t):null})}}),{columns:o,RowActions:s}},x.dequal),j=class extends v.default.Component{static displayName=t.DATA_TABLE;static defaultProps=O;generatedId;headerRefs;gripRefs;scrollerRef;fixedHeaderContainer;interactiveElements;tableRef;resizer;constructor(e){super(e),this.generatedId=n.default(),this.headerRefs={action:[],column:[],select:[]},this.gripRefs=[],this.scrollerRef=null,this.fixedHeaderContainer=null,this.state={activeCell:{rowIndex:1,columnIndex:+!!this.props.selectRows},activeElement:null,mode:m.default.NAVIGATION,tableHasFocus:!1,allowKeyboardNavigation:e.keyboardNavigation},this.interactiveElements={},this.changeActiveCell=this.changeActiveCell.bind(this),this.changeActiveElement=this.changeActiveElement.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.registerInteractiveElement=this.registerInteractiveElement.bind(this),s.default(t.DATA_TABLE,e,c.default)}componentDidMount(){this.getFixedHeader()&&(this.toggleFixedHeaderListeners(!0),this.resizeFixedHeaders()),this.isResizable()&&this.enableResize()}componentDidUpdate(e,t){this.getFixedHeader()&&(this.resizeFixedHeaders(),this.loadMoreIfNeeded()),this.state.allowKeyboardNavigation&&!t.allowKeyboardNavigation&&this.setState({tableHasFocus:!0}),this.isResizable()?this.enableResize():this.resizer&&this.disableResize()}componentWillUnmount(){this.toggleFixedHeaderListeners(!1),this.isResizable()&&this.disableResize()}onResize(){let e=this.tableRef;if(e){let t=this.getFixedHeader()?e.getElementsByClassName(`slds-cell-fixed`):e.getElementsByTagName(`th`);return Array.from(t).map((e,t)=>{let{id:n,style:r}=e;return{id:n,index:t,width:parseInt(r.width,10)}})}return[]}getId(){return this.props.id||this.generatedId}getFixedHeader(){return this.props.fixedHeader||this.props.resizable}getKeyboardNavigation(){return this.props.keyboardNavigation||this.props.resizable}getFixedLayout(){return this.props.fixedLayout||this.props.resizable}getFirstInteractiveElement(e,t){return this.state.mode===m.default.ACTIONABLE&&this.interactiveElements[e]&&this.interactiveElements[e][t]?this.interactiveElements[e][t][0]:null}getTableContext=(0,S.default)((e,t)=>({activeCell:e.activeCell,activeElement:e.activeElement,mode:e.mode,tableHasFocus:e.tableHasFocus,changeActiveCell:this.changeActiveCell,changeActiveElement:this.changeActiveElement,handleKeyDown:this.handleKeyDown,registerInteractiveElement:this.registerInteractiveElement,allowKeyboardNavigation:e.allowKeyboardNavigation??!1,setAllowKeyboardNavigation:e=>{t&&this.setState({allowKeyboardNavigation:e})}}));handleToggleAll=(e,{checked:t})=>{let n=this.props.selection??[],r=this.props.disabledSelection??[],i=n.filter(e=>r.includes(e)),a=this.props.items.filter(e=>!r.includes(e)),o=(t?[...a,...i]:[...i]).filter(e=>e.type!==`header-row`);typeof this.props.onChange==`function`&&this.props.onChange(o,e),typeof this.props.onRowChange==`function`&&this.props.onRowChange(e,{selection:o})};handleRowToggle=(e,t,n)=>{if(typeof this.props.onChange==`function`){let r;r=t?this.props.selectRows===`radio`?[e]:[...this.props.selection??[],e]:(0,w.default)(this.props.selection??[],e),this.props.onChange(r,n)}if(typeof this.props.onRowChange==`function`){let r;r=t?this.props.selectRows===`radio`?[e]:[...this.props.selection??[],e]:(0,w.default)(this.props.selection??[],e),this.props.onRowChange(n,{selection:r})}};repositionResizers=()=>{let e=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.gripRefs&&this.tableRef){let t=this.tableRef.getBoundingClientRect();this.gripRefs.forEach((n,r)=>{let i=e[r];if(!i)return;let a=i.getBoundingClientRect(),o=a.left-t.left+a.width;n.style.left=`${o}px`})}};resizeFixedHeaders=e=>{let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.props.onFixedHeaderResize)this.props.onFixedHeaderResize(e??null,{headerRefs:t.filter(Boolean),scrollerRef:this.scrollerRef});else if(t.length>0){let e=0;i.canUseDOM&&(e=document.documentElement.scrollLeft),t.forEach(t=>{if(t&&i.canUseDOM){let n=t.getBoundingClientRect().left+e,r=0;this.scrollerRef&&(r=this.scrollerRef.getBoundingClientRect().left+e);let i=t.querySelector(`.slds-cell-fixed`);i&&(i.style.left=`${n-r}px`,i.style.width=`${t.offsetWidth}px`)}})}};loadMoreIfNeeded=()=>{if(this.props.hasMore&&this.props.onLoadMore&&this.scrollerRef){let{scrollTop:e,offsetHeight:t,scrollHeight:n}=this.scrollerRef;e+t>n-(this.props.loadMoreOffset??0)&&this.props.onLoadMore()}};toggleFixedHeaderListeners=e=>{if(this.props.onToggleFixedHeaderListeners)this.props.onToggleFixedHeaderListeners({},{attach:e,resizeHandler:this.resizeFixedHeaders,scrollerRef:this.scrollerRef});else{let t=e?`addEventListener`:`removeEventListener`;i.canUseEventListeners&&(window[t](`resize`,this.resizeFixedHeaders),window[t](`resize`,this.loadMoreIfNeeded)),i.canUseEventListeners&&this.scrollerRef&&(this.scrollerRef[t](`scroll`,this.resizeFixedHeaders),this.scrollerRef[t](`scroll`,this.loadMoreIfNeeded),this.scrollerRef[t](`scroll`,this.repositionResizers))}};UNSAFE_componentWillUpdate(e){this.props.items!==e.items&&(this.interactiveElements={})}isResizable(){return this.props.fixedLayout&&this.props.resizable}resizeGrips(){let e=this.fixedHeaderContainer;if(e){let t=Array.from(e.getElementsByClassName(`grip-handle`));t.length&&(this.gripRefs=t,this.gripRefs.forEach(e=>{e.style.height=`${parseInt(e.style.height,10)+33}px`}))}}enableResize(){if(i.canUseDOM){let e=this.tableRef,t=this.getFixedHeader(),n=[];if(this.props.selectRows&&n.push(0),!this.resizer){let r={...O.resizableOptions,disabledColumns:n,...this.props.resizableOptions},i=this.props.resizableOptions?.onResize;r.onResize=e=>{t&&(this.resizeFixedHeaders(e),this.repositionResizers());let n=this.onResize();i&&i(n),this.resizeGrips()},e&&(this.resizer=new T.default(e,r),e.classList.remove(`grip-padding`),t&&this.resizeFixedHeaders(),this.resizeGrips(),this.repositionResizers()),this.setState({},()=>this.state)}}}disableResize(){this.resizer&&this.resizer.reset({disable:!0}),this.gripRefs=[]}changeActiveCell(e,t){this.setState({tableHasFocus:!0,activeCell:{rowIndex:e,columnIndex:t}})}changeActiveElement(e){this.setState({activeElement:e,mode:m.default.ACTIONABLE})}handleKeyDown(e){o.default(e,{callbacks:{[r.default.UP]:{callback:()=>this.handleKeyDownUp()},[r.default.DOWN]:{callback:()=>this.handleKeyDownDown()},[r.default.LEFT]:{callback:()=>this.handleKeyDownLeft()},[r.default.RIGHT]:{callback:()=>this.handleKeyDownRight()},[r.default.ENTER]:{callback:()=>this.handleKeyDownEnter()},[r.default.ESCAPE]:{callback:()=>this.handleKeyDownEscape()},[r.default.TAB]:this.state.mode===m.default.ACTIONABLE?{callback:e=>this.handleKeyTabPress(e)}:null}})}handleKeyDownUp(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.max(this.state.activeCell.rowIndex-1,0),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&(this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t})),this.state.mode===m.default.ACTIONABLE&&e===0&&!t&&this.makeGripVisible(this.state.activeCell.columnIndex))}}handleKeyDownDown(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.min(this.state.activeCell.rowIndex+1,this.props.items.length),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}}displaceByArrowKey(e){if(this.state.mode===m.default.ACTIONABLE){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(t===0&&this.tableRef){let t=this.tableRef.getElementsByTagName(`th`);t[n].style.width=`${parseInt(t[n].style.width,10)+e}px`,this.resizeFixedHeaders(),this.repositionResizers(),this.resizeGrips()}}}makeGripVisible(e){this.gripRefs.forEach((t,n)=>{n===e?t.classList.add(`grip-handle-active`):t.classList.remove(`grip-handle-active`)})}handleKeyDownLeft(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.max(this.state.activeCell.columnIndex-1,0),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}else this.displaceByArrowKey(-10)}handleKeyDownRight(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.min(this.state.activeCell.columnIndex+1,v.default.Children.count(this.props.children)-+!this.props.selectRows),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}else this.displaceByArrowKey(10)}handleKeyDownEnter(){if(this.state.mode===m.default.NAVIGATION){let{rowIndex:e,columnIndex:t}=this.state.activeCell,n=null;this.interactiveElements[e]&&this.interactiveElements[e][t]&&([n]=this.interactiveElements[e][t]),this.setState({mode:m.default.ACTIONABLE,activeElement:n}),e===0&&!n&&this.makeGripVisible(t)}}handleKeyDownEscape(){this.state.mode===m.default.ACTIONABLE&&(this.setState({mode:m.default.NAVIGATION,activeElement:null}),this.makeGripVisible(null))}moveNext(e,t,n){let r=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],i=0,a=0;e.shiftKey?n-1>=0?(a=n-1,i=t):(i=t>0?t-1:this.props.items.length,a=r.length-1):n+1<r.length?(a=n+1,i=t):(i=t<this.props.items.length?t+1:0,a=0),this.changeActiveCell(i,a)}handleNextActionable(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell,r=this.state.activeElement,i=this.interactiveElements[t]&&this.interactiveElements[t][n]?this.interactiveElements[t][n]:null;if(i){if(r){let t=i.indexOf(r);return e.shiftKey?t>0?i[t-1]:null:t<i.length-1?i[t+1]:null}return e.shiftKey?i[i.length-1]:i[0]}return null}handleKeyTabPress(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(this.state.mode===m.default.ACTIONABLE){let r=this.handleNextActionable(e);if(r)this.setState({activeElement:r}),this.isResizable()&&this.makeGripVisible(null);else if(t===0){let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],r=0;r=e.shiftKey?n-1>=0?n-1:t.length-1:n+1<t.length?n+1:0,this.setState({mode:m.default.ACTIONABLE,activeElement:null}),t.forEach((e,t)=>{e&&(t===r?(e.tabIndex=0,e.focus()):e.tabIndex=-1)}),this.isResizable()&&this.makeGripVisible(r)}else this.moveNext(e,t,n),this.setState({mode:m.default.ACTIONABLE,activeElement:null})}}registerInteractiveElement(e,t,n){this.interactiveElements[e]||(this.interactiveElements[e]={});let r=this.interactiveElements[e][t]||[];r.includes(n)||(this.interactiveElements[e][t]=[...r,n])}render(){let e={},r=this.props.selection??[],i=this.props.disabledSelection??[],o=D(this.props.items),s=D(r.filter(e=>!i.includes(e))),c=D(this.props.items.filter(e=>e.type!==`header-row`&&!i.includes(e))),u=this.props.selectRows&&c>0?this.props.selectRows:!1,f=u&&c===s,p=u&&c!==s&&s!==0,{columns:_,RowActions:x}=A(this.props.children,this.props.id,this.getFixedHeader(),this.props.fixedLayout,this.props.items,this.props.search),S=k(this.props.assistiveText,this.props.assistiveTextForActionsHeader,this.props.assistiveTextForSelectAllRows,this.props.assistiveTextForColumnSortedAscending,this.props.assistiveTextForColumnSortedDescending,this.props.assistiveTextForColumnSort,this.props.assistiveTextForSelectRow);this.props.selectRows&&this.props.selectRows!==`radio`&&(e[`aria-multiselectable`]=`true`),this.headerRefs={action:x?this.headerRefs.action:[],column:this.headerRefs.column.slice(0,_.length),select:u?this.headerRefs.select:[]};let C=(0,b.jsxs)(v.default.Fragment,{children:[(0,b.jsx)(d.default.Provider,{value:this.getTableContext(this.state,this.getKeyboardNavigation()),children:(0,b.jsxs)(`table`,{...e,className:(0,y.default)(`slds-table`,{"slds-table_fixed-layout":this.getFixedLayout(),"slds-table_header-fixed":this.getFixedHeader(),"slds-table_resizable-cols":this.getFixedLayout(),"slds-table_bordered":!this.props.unborderedRow,"slds-table_cell-buffer":!this.getFixedLayout()&&!this.props.unbufferedCell,"slds-max-medium-table_stacked":this.props.stacked,"slds-max-medium-table_stacked-horizontal":this.props.stackedHorizontal,"slds-table_striped":this.props.striped,"slds-table_col-bordered":this.props.columnBordered,"slds-no-row-hover":this.props.noRowHover,"slds-table_header-hidden":this.props.isHeadless},this.props.className),id:this.getId(),ref:e=>{e&&(this.tableRef=e)},role:this.getFixedLayout()?`grid`:void 0,onBlur:e=>{this.tableRef&&!this.tableRef.contains(e.relatedTarget)&&(this.setState({tableHasFocus:!1,mode:m.default.NAVIGATION,activeElement:null}),this.makeGripVisible(null))},style:this.props.style,children:[(0,b.jsx)(h.default,{assistiveText:S,allSelected:f,fixedHeader:this.getFixedHeader(),fixedLayout:this.getFixedLayout(),headerRefs:(e,t)=>{t===`action`||t===`select`?e?this.headerRefs[t][0]=e:this.headerRefs[t]=[]:this.headerRefs.column[t]=e},isHidden:this.props.isHeadless,indeterminateSelected:p,canSelectRows:u,columns:_,id:`${this.getId()}-${t.DATA_TABLE_HEAD}`,onToggleAll:this.handleToggleAll,onSort:this.props.onSort,showRowActions:!!x}),(0,b.jsx)(`tbody`,{children:o>0?this.props.items.map((e,r)=>{let i=this.getId()&&e.id?`${this.getId()}-${t.DATA_TABLE_ROW}-${e.id}`:n.default();return this.props.onRenderSubHeadingRow&&e.type===`header-row`?this.props.onRenderSubHeadingRow({assistiveText:S,classNameRow:e.classNameRow,columns:_,key:i,id:i,tableId:this.getId(),item:e}):(0,b.jsx)(g.default,{assistiveText:S,canSelectRows:u,className:e.classNameRow,columns:_,fixedLayout:this.getFixedLayout(),id:i,index:r,item:e,onToggle:this.handleRowToggle,selection:this.props.selection,disabledSelection:this.props.disabledSelection,rowActions:x,tableId:this.getId(),rowIndex:r+1},i)}):null})]})}),this.getFixedHeader()&&this.props.hasMore&&(0,b.jsx)(`div`,{className:`slds-is-relative slds-p-around_large`,children:(0,b.jsx)(a.default,{assistiveText:{label:this.props.assistiveText?.loadingMore},hasContainer:!1,size:`small`,variant:`brand`})})]});if(this.getFixedHeader()){let e=`1px solid ${l.colorGray5}`,t={borderTop:e,height:`100%`};this.props.joined&&(t.borderBottom=e,t.borderLeft=e,t.borderRight=e,t.borderTop=`none`,t.borderRadius=E);let n={height:`100%`};this.props.resizable?(n.overflowY=`auto`,n.overflowX=`hidden`):n.overflow=`auto`,C=(0,b.jsx)(`div`,{className:`slds-table_header-fixed_container`,ref:e=>{this.fixedHeaderContainer=e},style:t,onScroll:e=>{let t=e.target.scrollLeft;t>0&&(e.target.scrollLeft=0,this.scrollerRef&&(this.scrollerRef.scrollLeft=t))},children:(0,b.jsx)(`div`,{className:`slds-table_header-fixed_scroller`,ref:e=>{this.scrollerRef=e},style:n,children:C})})}return C}};exports.default=j;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/generate-id.cjs"),r=require("../../utilities/key-code.cjs"),i=require("../../utilities/execution-environment.cjs"),a=require("../spinner/index.cjs"),o=require("../../utilities/key-callbacks.cjs"),s=require("./check-props.cjs"),c=require("./component.cjs"),l=require("../../utilities/design-tokens/dist/palette-colors.common.cjs"),u=require("../../utilities/design-tokens/dist/salesforce-skin.common.cjs"),d=require("./private/table-context.cjs"),f=require("./cell.cjs"),p=require("./column.cjs"),m=require("./private/mode.cjs"),h=require("./private/head.cjs"),g=require("./private/row.cjs"),_=require("./row-actions.cjs");let v=require("react");v=e.__toESM(v,1);let y=require("classnames");y=e.__toESM(y,1);let b=require("react/jsx-runtime"),x=require("dequal"),S=require("lodash.assign");S=e.__toESM(S,1);let C=require("lodash.reject");C=e.__toESM(C,1);let w=require("memoize-one");w=e.__toESM(w,1);let T=require("column-resizer");T=e.__toESM(T,1);var{tableBorderRadius:E}=u.default,D=e=>Array.isArray(e)?e.length:0,O={assistiveText:{actionsHeader:`Actions`,columnSort:`Sort by: `,columnSortedAscending:`Sorted Ascending`,columnSortedDescending:`Sorted Descending`,selectAllRows:`Select all rows`,selectRow:`Select row`,selectRowGroup:`Choose a row to select`,loadingMore:`Loading more`},selection:[],disabledSelection:[],hasMore:!1,loadMoreOffset:20,resizable:!1,resizableOptions:{resizeMode:`fit`,draggingClass:`slds-table-column-resizer`}},k=(0,w.default)((e,t,n,r,i,a,o)=>{let s={...O.assistiveText,...e};return t&&(s.actionsHeader=t),a&&(s.selectAllRows=a),r&&(s.columnSortedAscending=r),i&&(s.columnSortedDescending=i),n&&(s.columnSort=n),o&&(s.selectRow=o),s},x.dequal),A=(0,w.default)((e,t,n,r,i,a)=>{let o=[],s=null;return v.default.Children.forEach(e,e=>{let c=e,l=c?.type;if(c&&l?.displayName===p.default.displayName){let{children:e,...n}=c.props,s={fixedLayout:r,search:a,items:i,...n};t&&(s.id=t);let l,u=e,d=u?.type;u&&d?.displayName===`SLDSDataTableCell`?(l=u.type,(0,S.default)(s,u.props)):l=f.default,o.push({Cell:l,props:s})}else if(c&&l?.displayName===_.default.displayName){let{dropdown:e}=c.props,t={};n&&(t.menuPosition=`overflowBoundaryElement`),s=v.default.cloneElement(c,{dropdown:e?v.default.cloneElement(e,t):null})}}),{columns:o,RowActions:s}},x.dequal),j=class extends v.default.Component{static displayName=t.DATA_TABLE;static defaultProps=O;generatedId;headerRefs;gripRefs;scrollerRef;fixedHeaderContainer;interactiveElements;tableRef;resizer;constructor(e){super(e),this.generatedId=n.default(),this.headerRefs={action:[],column:[],select:[]},this.gripRefs=[],this.scrollerRef=null,this.fixedHeaderContainer=null,this.state={activeCell:{rowIndex:1,columnIndex:+!!this.props.selectRows},activeElement:null,mode:m.default.NAVIGATION,tableHasFocus:!1,allowKeyboardNavigation:e.keyboardNavigation},this.interactiveElements={},this.changeActiveCell=this.changeActiveCell.bind(this),this.changeActiveElement=this.changeActiveElement.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.registerInteractiveElement=this.registerInteractiveElement.bind(this),s.default(t.DATA_TABLE,e,c.default)}componentDidMount(){this.getFixedHeader()&&(this.toggleFixedHeaderListeners(!0),this.resizeFixedHeaders()),this.isResizable()&&this.enableResize()}componentDidUpdate(e,t){this.getFixedHeader()&&(this.resizeFixedHeaders(),this.loadMoreIfNeeded()),this.state.allowKeyboardNavigation&&!t.allowKeyboardNavigation&&this.setState({tableHasFocus:!0}),this.isResizable()?this.enableResize():this.resizer&&this.disableResize()}componentWillUnmount(){this.toggleFixedHeaderListeners(!1),this.isResizable()&&this.disableResize()}onResize(){let e=this.tableRef;if(e){let t=this.getFixedHeader()?e.getElementsByClassName(`slds-cell-fixed`):e.getElementsByTagName(`th`);return Array.from(t).map((e,t)=>{let{id:n,style:r}=e;return{id:n,index:t,width:parseInt(r.width,10)}})}return[]}getId(){return this.props.id||this.generatedId}getFixedHeader(){return this.props.fixedHeader||this.props.resizable}getKeyboardNavigation(){return this.props.keyboardNavigation||this.props.resizable}getFixedLayout(){return this.props.fixedLayout||this.props.resizable}getFirstInteractiveElement(e,t){return this.state.mode===m.default.ACTIONABLE&&this.interactiveElements[e]&&this.interactiveElements[e][t]?this.interactiveElements[e][t][0]:null}getTableContext=(0,w.default)((e,t)=>({activeCell:e.activeCell,activeElement:e.activeElement,mode:e.mode,tableHasFocus:e.tableHasFocus,changeActiveCell:this.changeActiveCell,changeActiveElement:this.changeActiveElement,handleKeyDown:this.handleKeyDown,registerInteractiveElement:this.registerInteractiveElement,allowKeyboardNavigation:e.allowKeyboardNavigation??!1,setAllowKeyboardNavigation:e=>{t&&this.setState({allowKeyboardNavigation:e})}}));handleToggleAll=(e,{checked:t})=>{let n=this.props.selection??[],r=this.props.disabledSelection??[],i=n.filter(e=>r.includes(e)),a=this.props.items.filter(e=>!r.includes(e)),o=(t?[...a,...i]:[...i]).filter(e=>e.type!==`header-row`);typeof this.props.onChange==`function`&&this.props.onChange(o,e),typeof this.props.onRowChange==`function`&&this.props.onRowChange(e,{selection:o})};handleRowToggle=(e,t,n)=>{if(typeof this.props.onChange==`function`){let r;r=t?this.props.selectRows===`radio`?[e]:[...this.props.selection??[],e]:(0,C.default)(this.props.selection??[],e),this.props.onChange(r,n)}if(typeof this.props.onRowChange==`function`){let r;r=t?this.props.selectRows===`radio`?[e]:[...this.props.selection??[],e]:(0,C.default)(this.props.selection??[],e),this.props.onRowChange(n,{selection:r})}};repositionResizers=()=>{let e=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.gripRefs&&this.tableRef){let t=this.tableRef.getBoundingClientRect();this.gripRefs.forEach((n,r)=>{let i=e[r];if(!i)return;let a=i.getBoundingClientRect(),o=a.left-t.left+a.width;n.style.left=`${o}px`})}};resizeFixedHeaders=e=>{let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.props.onFixedHeaderResize)this.props.onFixedHeaderResize(e??null,{headerRefs:t.filter(Boolean),scrollerRef:this.scrollerRef});else if(t.length>0){let e=0;i.canUseDOM&&(e=document.documentElement.scrollLeft),t.forEach(t=>{if(t&&i.canUseDOM){let n=t.getBoundingClientRect().left+e,r=0;this.scrollerRef&&(r=this.scrollerRef.getBoundingClientRect().left+e);let i=t.querySelector(`.slds-cell-fixed`);i&&(i.style.left=`${n-r}px`,i.style.width=`${t.offsetWidth}px`)}})}};loadMoreIfNeeded=()=>{if(this.props.hasMore&&this.props.onLoadMore&&this.scrollerRef){let{scrollTop:e,offsetHeight:t,scrollHeight:n}=this.scrollerRef;e+t>n-(this.props.loadMoreOffset??0)&&this.props.onLoadMore()}};toggleFixedHeaderListeners=e=>{if(this.props.onToggleFixedHeaderListeners)this.props.onToggleFixedHeaderListeners({},{attach:e,resizeHandler:this.resizeFixedHeaders,scrollerRef:this.scrollerRef});else{let t=e?`addEventListener`:`removeEventListener`;i.canUseEventListeners&&(window[t](`resize`,this.resizeFixedHeaders),window[t](`resize`,this.loadMoreIfNeeded)),i.canUseEventListeners&&this.scrollerRef&&(this.scrollerRef[t](`scroll`,this.resizeFixedHeaders),this.scrollerRef[t](`scroll`,this.loadMoreIfNeeded),this.scrollerRef[t](`scroll`,this.repositionResizers))}};UNSAFE_componentWillUpdate(e){this.props.items!==e.items&&(this.interactiveElements={})}isResizable(){return this.props.fixedLayout&&this.props.resizable}resizeGrips(){let e=this.fixedHeaderContainer;if(e){let t=Array.from(e.getElementsByClassName(`grip-handle`));t.length&&(this.gripRefs=t,this.gripRefs.forEach(e=>{e.style.height=`${parseInt(e.style.height,10)+33}px`}))}}enableResize(){if(i.canUseDOM){let e=this.tableRef,t=this.getFixedHeader(),n=[];if(this.props.selectRows&&n.push(0),!this.resizer){let r={...O.resizableOptions,disabledColumns:n,...this.props.resizableOptions},i=this.props.resizableOptions?.onResize;r.onResize=e=>{t&&(this.resizeFixedHeaders(e),this.repositionResizers());let n=this.onResize();i&&i(n),this.resizeGrips()},e&&(this.resizer=new T.default(e,r),e.classList.remove(`grip-padding`),t&&this.resizeFixedHeaders(),this.resizeGrips(),this.repositionResizers()),this.setState({},()=>this.state)}}}disableResize(){this.resizer&&this.resizer.reset({disable:!0}),this.gripRefs=[]}changeActiveCell(e,t){this.setState({tableHasFocus:!0,activeCell:{rowIndex:e,columnIndex:t}})}changeActiveElement(e){this.setState({activeElement:e,mode:m.default.ACTIONABLE})}handleKeyDown(e){o.default(e,{callbacks:{[r.default.UP]:{callback:()=>this.handleKeyDownUp()},[r.default.DOWN]:{callback:()=>this.handleKeyDownDown()},[r.default.LEFT]:{callback:()=>this.handleKeyDownLeft()},[r.default.RIGHT]:{callback:()=>this.handleKeyDownRight()},[r.default.ENTER]:{callback:()=>this.handleKeyDownEnter()},[r.default.ESCAPE]:{callback:()=>this.handleKeyDownEscape()},[r.default.TAB]:this.state.mode===m.default.ACTIONABLE?{callback:e=>this.handleKeyTabPress(e)}:null}})}handleKeyDownUp(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.max(this.state.activeCell.rowIndex-1,0),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&(this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t})),this.state.mode===m.default.ACTIONABLE&&e===0&&!t&&this.makeGripVisible(this.state.activeCell.columnIndex))}}handleKeyDownDown(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.min(this.state.activeCell.rowIndex+1,this.props.items.length),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}}displaceByArrowKey(e){if(this.state.mode===m.default.ACTIONABLE){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(t===0&&this.tableRef){let t=this.tableRef.getElementsByTagName(`th`);t[n].style.width=`${parseInt(t[n].style.width,10)+e}px`,this.resizeFixedHeaders(),this.repositionResizers(),this.resizeGrips()}}}makeGripVisible(e){this.gripRefs.forEach((t,n)=>{n===e?t.classList.add(`grip-handle-active`):t.classList.remove(`grip-handle-active`)})}handleKeyDownLeft(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.max(this.state.activeCell.columnIndex-1,0),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}else this.displaceByArrowKey(-10)}handleKeyDownRight(){if(this.state.mode===m.default.NAVIGATION||this.state.activeCell.rowIndex>0||!this.isResizable()){let e=Math.min(this.state.activeCell.columnIndex+1,v.default.Children.count(this.props.children)-+!this.props.selectRows),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}else this.displaceByArrowKey(10)}handleKeyDownEnter(){if(this.state.mode===m.default.NAVIGATION){let{rowIndex:e,columnIndex:t}=this.state.activeCell,n=null;this.interactiveElements[e]&&this.interactiveElements[e][t]&&([n]=this.interactiveElements[e][t]),this.setState({mode:m.default.ACTIONABLE,activeElement:n}),e===0&&!n&&this.makeGripVisible(t)}}handleKeyDownEscape(){this.state.mode===m.default.ACTIONABLE&&(this.setState({mode:m.default.NAVIGATION,activeElement:null}),this.makeGripVisible(null))}moveNext(e,t,n){let r=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],i=0,a=0;e.shiftKey?n-1>=0?(a=n-1,i=t):(i=t>0?t-1:this.props.items.length,a=r.length-1):n+1<r.length?(a=n+1,i=t):(i=t<this.props.items.length?t+1:0,a=0),this.changeActiveCell(i,a)}handleNextActionable(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell,r=this.state.activeElement,i=this.interactiveElements[t]&&this.interactiveElements[t][n]?this.interactiveElements[t][n]:null;if(i){if(r){let t=i.indexOf(r);return e.shiftKey?t>0?i[t-1]:null:t<i.length-1?i[t+1]:null}return e.shiftKey?i[i.length-1]:i[0]}return null}handleKeyTabPress(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(this.state.mode===m.default.ACTIONABLE){let r=this.handleNextActionable(e);if(r)this.setState({activeElement:r}),this.isResizable()&&this.makeGripVisible(null);else if(t===0){let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],r=0;r=e.shiftKey?n-1>=0?n-1:t.length-1:n+1<t.length?n+1:0,this.setState({mode:m.default.ACTIONABLE,activeElement:null}),t.forEach((e,t)=>{e&&(t===r?(e.tabIndex=0,e.focus()):e.tabIndex=-1)}),this.isResizable()&&this.makeGripVisible(r)}else this.moveNext(e,t,n),this.setState({mode:m.default.ACTIONABLE,activeElement:null})}}registerInteractiveElement(e,t,n){this.interactiveElements[e]||(this.interactiveElements[e]={});let r=this.interactiveElements[e][t]||[];r.includes(n)||(this.interactiveElements[e][t]=[...r,n])}render(){let e={},r=this.props.selection??[],i=this.props.disabledSelection??[],o=D(this.props.items),s=D(r.filter(e=>!i.includes(e))),c=D(this.props.items.filter(e=>e.type!==`header-row`&&!i.includes(e))),u=this.props.selectRows&&c>0?this.props.selectRows:!1,f=u&&c===s,p=u&&c!==s&&s!==0,{columns:_,RowActions:x}=A(this.props.children,this.props.id,this.getFixedHeader(),this.props.fixedLayout,this.props.items,this.props.search),S=k(this.props.assistiveText,this.props.assistiveTextForActionsHeader,this.props.assistiveTextForSelectAllRows,this.props.assistiveTextForColumnSortedAscending,this.props.assistiveTextForColumnSortedDescending,this.props.assistiveTextForColumnSort,this.props.assistiveTextForSelectRow);this.props.selectRows&&this.props.selectRows!==`radio`&&(e[`aria-multiselectable`]=`true`),this.headerRefs={action:x?this.headerRefs.action:[],column:this.headerRefs.column.slice(0,_.length),select:u?this.headerRefs.select:[]};let C=(0,b.jsxs)(v.default.Fragment,{children:[(0,b.jsx)(d.default.Provider,{value:this.getTableContext(this.state,this.getKeyboardNavigation()),children:(0,b.jsxs)(`table`,{...e,className:(0,y.default)(`slds-table`,{"slds-table_fixed-layout":this.getFixedLayout(),"slds-table_header-fixed":this.getFixedHeader(),"slds-table_resizable-cols":this.getFixedLayout(),"slds-table_bordered":!this.props.unborderedRow,"slds-table_cell-buffer":!this.getFixedLayout()&&!this.props.unbufferedCell,"slds-max-medium-table_stacked":this.props.stacked,"slds-max-medium-table_stacked-horizontal":this.props.stackedHorizontal,"slds-table_striped":this.props.striped,"slds-table_col-bordered":this.props.columnBordered,"slds-no-row-hover":this.props.noRowHover,"slds-table_header-hidden":this.props.isHeadless},this.props.className),id:this.getId(),ref:e=>{e&&(this.tableRef=e)},role:this.getFixedLayout()?`grid`:void 0,onBlur:e=>{this.tableRef&&!this.tableRef.contains(e.relatedTarget)&&(this.setState({tableHasFocus:!1,mode:m.default.NAVIGATION,activeElement:null}),this.makeGripVisible(null))},style:this.props.style,children:[(0,b.jsx)(h.default,{assistiveText:S,allSelected:f,fixedHeader:this.getFixedHeader(),fixedLayout:this.getFixedLayout(),headerRefs:(e,t)=>{t===`action`||t===`select`?e?this.headerRefs[t][0]=e:this.headerRefs[t]=[]:this.headerRefs.column[t]=e},isHidden:this.props.isHeadless,indeterminateSelected:p,canSelectRows:u,columns:_,id:`${this.getId()}-${t.DATA_TABLE_HEAD}`,onToggleAll:this.handleToggleAll,onSort:this.props.onSort,showRowActions:!!x}),(0,b.jsx)(`tbody`,{children:o>0?this.props.items.map((e,r)=>{let i=this.getId()&&e.id?`${this.getId()}-${t.DATA_TABLE_ROW}-${e.id}`:n.default();return this.props.onRenderSubHeadingRow&&e.type===`header-row`?this.props.onRenderSubHeadingRow({assistiveText:S,classNameRow:e.classNameRow,columns:_,key:i,id:i,tableId:this.getId(),item:e}):(0,b.jsx)(g.default,{assistiveText:S,canSelectRows:u,className:e.classNameRow,columns:_,fixedLayout:this.getFixedLayout(),id:i,index:r,item:e,onToggle:this.handleRowToggle,selection:this.props.selection,disabledSelection:this.props.disabledSelection,rowActions:x,tableId:this.getId(),rowIndex:r+1},i)}):null})]})}),this.getFixedHeader()&&this.props.hasMore&&(0,b.jsx)(`div`,{className:`slds-is-relative slds-p-around_large`,children:(0,b.jsx)(a.default,{assistiveText:{label:this.props.assistiveText?.loadingMore},hasContainer:!1,size:`small`,variant:`brand`})})]});if(this.getFixedHeader()){let e=`1px solid ${l.colorGray5}`,t={borderTop:e,height:`100%`};this.props.joined&&(t.borderBottom=e,t.borderLeft=e,t.borderRight=e,t.borderTop=`none`,t.borderRadius=E);let n={height:`100%`};this.props.resizable?(n.overflowY=`auto`,n.overflowX=`hidden`):n.overflow=`auto`,C=(0,b.jsx)(`div`,{className:`slds-table_header-fixed_container`,ref:e=>{this.fixedHeaderContainer=e},style:t,onScroll:e=>{let t=e.target.scrollLeft;t>0&&(e.target.scrollLeft=0,this.scrollerRef&&(this.scrollerRef.scrollLeft=t))},children:(0,b.jsx)(`div`,{className:`slds-table_header-fixed_scroller`,ref:e=>{this.scrollerRef=e},style:n,children:C})})}return C}};exports.default=j;
2
2
  //# sourceMappingURL=index.cjs.map