@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 +1 @@
1
- {"version":3,"file":"combobox.js","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAI,GACE,KAAkB,OAAO,WAAa,KAsItC,KAAwD;CAC7D,OAAO;CACP,kBAAkB;CAClB,sBAAsB;CACtB,cAAc;CACd,4BAA4B;CAC5B,YAAY;CACZ,sBAAsB;AACvB,GAEM,KAA0C;CAC/C,gBAAgB;CAChB,OAAO;CACP,cAAc;CACd,YAAY;CACZ,yBAAyB;CACzB,gBAAgB;CAChB,aAAa;CACb,qBAAqB;CACrB,iBAAiB;CACjB,4BAA4B;CAC5B,gBAAgB;AACjB,GAEM,KAAgC,CAAC,GAIjC,MAAqC,OAAU;CACpD,IAAM,EACL,eAAe,KAAoB,CAAC,GACpC,oBAAoB,IACpB,cACA,wBACA,mBACA,4BACA,iBACA,cACA,oBACA,cACA,QAAQ,KAAa,CAAC,GACtB,2BACA,iBACA,qBACA,oBACA,wBACA,IAAI,IACJ,qBAAiB,UACjB,WACA,UAAU,IACV,QAAQ,GACR,QAAQ,KAAa,CAAC,GACtB,2BACA,kBACA,mBAAe,YACf,aACA,sBACA,cAAU,CAAC,GACX,qBAAiB,CAAC,GAClB,0BAAsB,CAAC,GACvB,YACA,0BACA,cAAW,IACX,eAAY,CAAC,GACb,oBAAoB,IACpB,0BAAsB,IACtB,6BACA,UACA,aAAU,QACV,iBACG,IAGE,IAAgB,GAAO,CAAC,GAAG,IAAsB,EAAiB,GAClE,IAAS,GAAO,CAAC,GAAG,IAAe,EAAU,GAC7C,IAAS,GAAO,CAAC,GAAG,IAAe,EAAU,GAG7C,KAAsB,GAAW,CAAmB,GAGpD,IAAW,EAAgC,IAAI,GAC/C,IAAU,EAAgC,IAAI,GAC9C,KAAqB,EAAgC,IAAI,GACzD,KAA0B,EAA2B,IAAI,GACzD,KAAY,EAAiC,IAAI,GACjD,KAAgB,EAAO,IAAI,E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B;;CAGN,OAAO,KACN,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,kBAAC,IAAD;GACgB;GACf,SAAS,EAAM;GACf,OAAO,EAAO;GACJ;EACV,CAAA,GACD,kBAAC,OAAD;GAAK,WAAU;GACd,UAAA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,GAEL,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,CACD;;EACD,CAAA,CACD;CAEL,CAAA,IAAA;AAEF;AAEA,GAAS,cAAc"}
1
+ {"version":3,"file":"combobox.js","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 = COMBOBOX;\n\nexport default Combobox;\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAI,GACE,KAAkB,OAAO,WAAa,KAsItC,KAAwD;CAC7D,OAAO;CACP,kBAAkB;CAClB,sBAAsB;CACtB,cAAc;CACd,4BAA4B;CAC5B,YAAY;CACZ,sBAAsB;AACvB,GAEM,KAA0C;CAC/C,gBAAgB;CAChB,OAAO;CACP,cAAc;CACd,YAAY;CACZ,yBAAyB;CACzB,gBAAgB;CAChB,aAAa;CACb,qBAAqB;CACrB,iBAAiB;CACjB,4BAA4B;CAC5B,gBAAgB;AACjB,GAEM,KAAgC,CAAC,GAIjC,MAAqC,OAAU;CACpD,IAAM,EACL,eAAe,KAAoB,CAAC,GACpC,oBAAoB,IACpB,cACA,wBACA,mBACA,4BACA,iBACA,cACA,oBACA,cACA,QAAQ,KAAa,CAAC,GACtB,2BACA,iBACA,qBACA,oBACA,wBACA,IAAI,IACJ,qBAAiB,UACjB,WACA,UAAU,IACV,QAAQ,GACR,QAAQ,KAAa,CAAC,GACtB,2BACA,kBAC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A;OACU;OACV,MAAK;OACL,OAAO;OACP,GAAI;MACJ,CAAA;MACA,GAAU,EAAE,cAAc,GAAW,EAAE,CAAC;MACxC,KACA,kBAAC,OAAD;OAAK,IAAI,EAAW;OAAG,WAAU;OAC/B,UAAA;MACG,CAAA;KAEF;;GACD,CAAA;EACD,CAAA;CAEP,GAIM,KAAmB,EAAO,SAAS,GAAe,OAElD,KAA8D;EACnE,MAAM;GACL,UAAU;GACV,QAAQ;EACT;EACA,kBAAkB;GACjB,UAAU;GACV,QAAQ;EACT;EACA,SAAS;GACR,UAAU;GACV,QAAQ;EACT;EACA,UAAU;GACT,UAAU;GACV,QAAQ;EACT;CACD,GAEM,KAAmB,IAAW,aAAa,UAC3C,KAAkB,GAAW,EAAQ,GAAG,KAExC,KACL,kBAAC,OAAD;EACC,WAAW,EAAW,qBAAqB,EAAkB;EAD9D,UAAA;GAGE,KAAiB,OACjB,kBAAC,IAAD;IACgB;IACf,SAAS,EAAM;IACf,OAAO,EAAO;IACJ;GACV,CAAA;GAED,MAAyB,KACzB,kBAAC,IAAD,EAEwB,0BACvB,CAAA,IACE;GACH,KACE,GAAgB,IAChB,GAAW,KAAK,SAAS;EACxB;;CAGN,OAAO,KACN,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,kBAAC,IAAD;GACgB;GACf,SAAS,EAAM;GACf,OAAO,EAAO;GACJ;EACV,CAAA,GACD,kBAAC,OAAD;GAAK,WAAU;GACd,UAAA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,GAEL,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,CACD;;EACD,CAAA,CACD;CAEL,CAAA,IAAA;AAEF;AAEA,GAAS,cAAc"}
@@ -1,12 +1,12 @@
1
1
  import { DATA_TABLE_CELL as e } from "../../utilities/constants.js";
2
- import t from "../utilities/highlighter/index.js";
3
- import n from "./cell.js";
2
+ import t from "./cell.js";
3
+ import n from "../utilities/highlighter/index.js";
4
4
  import "react";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region components/data-table/highlight-cell.tsx
7
- var i = (e) => /* @__PURE__ */ r(n, {
7
+ var i = (e) => /* @__PURE__ */ r(t, {
8
8
  ...e,
9
- children: /* @__PURE__ */ r(t, {
9
+ children: /* @__PURE__ */ r(n, {
10
10
  search: e.search,
11
11
  children: e.children
12
12
  })
@@ -19,9 +19,9 @@ import b from "react";
19
19
  import x from "classnames";
20
20
  import { jsx as S, jsxs as C } from "react/jsx-runtime";
21
21
  import { dequal as w } from "dequal";
22
- import T from "memoize-one";
23
- import E from "lodash.assign";
24
- import D from "lodash.reject";
22
+ import T from "lodash.assign";
23
+ import E from "lodash.reject";
24
+ import D from "memoize-one";
25
25
  import O from "column-resizer";
26
26
  //#region components/data-table/index.tsx
27
27
  var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j = {
@@ -44,13 +44,13 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
44
44
  resizeMode: "fit",
45
45
  draggingClass: "slds-table-column-resizer"
46
46
  }
47
- }, M = T((e, t, n, r, i, a, o) => {
47
+ }, M = D((e, t, n, r, i, a, o) => {
48
48
  let s = {
49
49
  ...j.assistiveText,
50
50
  ...e
51
51
  };
52
52
  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;
53
- }, w), N = T((e, t, n, r, i, a) => {
53
+ }, w), N = D((e, t, n, r, i, a) => {
54
54
  let o = [], s = null;
55
55
  return b.Children.forEach(e, (e) => {
56
56
  let c = e, l = c?.type;
@@ -63,7 +63,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
63
63
  };
64
64
  t && (s.id = t);
65
65
  let l, u = e, d = u?.type;
66
- u && d?.displayName === "SLDSDataTableCell" ? (l = u.type, E(s, u.props)) : l = m, o.push({
66
+ u && d?.displayName === "SLDSDataTableCell" ? (l = u.type, T(s, u.props)) : l = m, o.push({
67
67
  Cell: l,
68
68
  props: s
69
69
  });
@@ -141,7 +141,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
141
141
  getFirstInteractiveElement(e, t) {
142
142
  return this.state.mode === g.ACTIONABLE && this.interactiveElements[e] && this.interactiveElements[e][t] ? this.interactiveElements[e][t][0] : null;
143
143
  }
144
- getTableContext = T((e, t) => ({
144
+ getTableContext = D((e, t) => ({
145
145
  activeCell: e.activeCell,
146
146
  activeElement: e.activeElement,
147
147
  mode: e.mode,
@@ -162,11 +162,11 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
162
162
  handleRowToggle = (e, t, n) => {
163
163
  if (typeof this.props.onChange == "function") {
164
164
  let r;
165
- r = t ? this.props.selectRows === "radio" ? [e] : [...this.props.selection ?? [], e] : D(this.props.selection ?? [], e), this.props.onChange(r, n);
165
+ r = t ? this.props.selectRows === "radio" ? [e] : [...this.props.selection ?? [], e] : E(this.props.selection ?? [], e), this.props.onChange(r, n);
166
166
  }
167
167
  if (typeof this.props.onRowChange == "function") {
168
168
  let r;
169
- r = t ? this.props.selectRows === "radio" ? [e] : [...this.props.selection ?? [], e] : D(this.props.selection ?? [], e), this.props.onRowChange(n, { selection: r });
169
+ r = t ? this.props.selectRows === "radio" ? [e] : [...this.props.selection ?? [], e] : E(this.props.selection ?? [], e), this.props.onRowChange(n, { selection: r });
170
170
  }
171
171
  };
172
172
  repositionResizers = () => {