@ringcentral/juno 1.12.4-beta.5873-31100a7c → 1.12.5-beta.5896-ded29c04

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 (514) hide show
  1. package/components/Dialog/Dialog.js +3 -1
  2. package/components/Downshift/Downshift.d.ts +1 -1
  3. package/components/Downshift/Downshift.js +1 -2
  4. package/components/Downshift/SuggestionList/SuggestionList.js +4 -5
  5. package/components/Downshift/SuggestionList/utils/useSuggestionList.d.ts +20 -7
  6. package/components/Downshift/SuggestionList/utils/useSuggestionList.js +88 -70
  7. package/components/Downshift/utils/DownshiftUtils.d.ts +2 -0
  8. package/components/Downshift/utils/DownshiftUtils.js +6 -0
  9. package/components/Downshift/utils/SelectItem.d.ts +3 -1
  10. package/components/Downshift/utils/index.d.ts +2 -0
  11. package/components/Downshift/utils/index.js +2 -0
  12. package/components/Downshift/utils/useDownshift.d.ts +13 -272
  13. package/components/Downshift/utils/useDownshift.js +132 -429
  14. package/components/Downshift/utils/useDownshiftGroup.js +1 -0
  15. package/components/Downshift/utils/useDownshiftTag.d.ts +554 -0
  16. package/components/Downshift/utils/useDownshiftTag.js +229 -0
  17. package/components/Forms/TextField/styles/OutlineTextFieldStyle.js +2 -2
  18. package/components/Forms/TextField/utils/OutlineTextFieldUtils.d.ts +1 -0
  19. package/components/Forms/TextField/utils/OutlineTextFieldUtils.js +3 -0
  20. package/components/Forms/Textarea/Textarea.d.ts +2 -2
  21. package/components/Icon/assets/icon-0.svg +2 -2
  22. package/components/Icon/assets/icon-2.svg +2 -2
  23. package/components/Icon/assets/icon-3.svg +2 -2
  24. package/components/Icon/assets/icon-4.svg +2 -2
  25. package/components/Icon/assets/icon-5.svg +2 -2
  26. package/components/Icon/assets/icon-6.svg +2 -2
  27. package/components/Icon/assets/icon-7.svg +2 -2
  28. package/components/Icon/assets/icon-8.svg +2 -2
  29. package/components/Icon/assets/icon-9.svg +2 -2
  30. package/components/Icon/assets/icon-Announcement.svg +8 -0
  31. package/components/Icon/assets/icon-Call-queue.svg +14 -0
  32. package/components/Icon/assets/icon-Limited.svg +7 -0
  33. package/components/Icon/assets/icon-Message.svg +6 -0
  34. package/components/Icon/assets/icon-Paging.svg +6 -0
  35. package/components/Icon/assets/icon-Shared-line.svg +8 -0
  36. package/components/Icon/assets/icon-avatar_rooms.svg +5 -0
  37. package/components/Icon/assets/icon-box.svg +1 -1
  38. package/components/Icon/assets/icon-box1.svg +5 -0
  39. package/components/Icon/assets/icon-default-file-D.svg +3 -3
  40. package/components/Icon/assets/icon-default-file.svg +4 -4
  41. package/components/Icon/assets/icon-default-gdrive-D.svg +4 -4
  42. package/components/Icon/assets/icon-default-gdrive.svg +5 -5
  43. package/components/Icon/assets/icon-default-music-D.svg +3 -3
  44. package/components/Icon/assets/icon-default-music.svg +3 -3
  45. package/components/Icon/assets/icon-default-video-D.svg +3 -3
  46. package/components/Icon/assets/icon-default-video.svg +3 -3
  47. package/components/Icon/assets/icon-deleted_file.svg +2 -2
  48. package/components/Icon/assets/icon-deleted_file_D.svg +2 -2
  49. package/components/Icon/assets/icon-doc-D.svg +3 -3
  50. package/components/Icon/assets/icon-doc.svg +3 -3
  51. package/components/Icon/assets/icon-end--answer.svg +2 -2
  52. package/components/Icon/assets/icon-excel-D.svg +3 -3
  53. package/components/Icon/assets/icon-excel.svg +3 -3
  54. package/components/Icon/assets/icon-font-color.svg +2 -2
  55. package/components/Icon/assets/icon-gdrive-logo.svg +6 -6
  56. package/components/Icon/assets/icon-gif-file-D.svg +3 -3
  57. package/components/Icon/assets/icon-gif-file.svg +4 -4
  58. package/components/Icon/assets/icon-gmail.svg +5 -5
  59. package/components/Icon/assets/icon-google-calendar-2019.svg +6 -6
  60. package/components/Icon/assets/icon-google-doc-D.svg +3 -3
  61. package/components/Icon/assets/icon-google-doc.svg +3 -3
  62. package/components/Icon/assets/icon-google-logo.svg +4 -4
  63. package/components/Icon/assets/icon-google-sheet-D.svg +3 -3
  64. package/components/Icon/assets/icon-google-sheet.svg +3 -3
  65. package/components/Icon/assets/icon-google-slide-D.svg +3 -3
  66. package/components/Icon/assets/icon-google-slide.svg +3 -3
  67. package/components/Icon/assets/icon-hold-answer.svg +2 -2
  68. package/components/Icon/assets/icon-image-broken-D.svg +3 -3
  69. package/components/Icon/assets/icon-image-broken.svg +4 -4
  70. package/components/Icon/assets/icon-image-preview-D.svg +3 -3
  71. package/components/Icon/assets/icon-image-preview.svg +3 -3
  72. package/components/Icon/assets/icon-item-list-selected.svg +1 -1
  73. package/components/Icon/assets/icon-mac-keynote-D.svg +3 -3
  74. package/components/Icon/assets/icon-mac-keynote.svg +6 -6
  75. package/components/Icon/assets/icon-mac-numbers-D.svg +3 -3
  76. package/components/Icon/assets/icon-mac-numbers.svg +3 -3
  77. package/components/Icon/assets/icon-mac-pages-D.svg +3 -3
  78. package/components/Icon/assets/icon-mac-pages.svg +3 -3
  79. package/components/Icon/assets/icon-marker_m.svg +2 -2
  80. package/components/Icon/assets/icon-marker_s.svg +2 -2
  81. package/components/Icon/assets/icon-microsoft-logo.svg +4 -4
  82. package/components/Icon/assets/icon-microsoft-outlook-2019.svg +15 -15
  83. package/components/Icon/assets/icon-mobile.svg +5 -0
  84. package/components/Icon/assets/icon-no-connection.svg +2 -2
  85. package/components/Icon/assets/icon-pdf-D.svg +3 -3
  86. package/components/Icon/assets/icon-pdf.svg +3 -3
  87. package/components/Icon/assets/icon-poor-connection.svg +2 -2
  88. package/components/Icon/assets/icon-ppt-D.svg +3 -3
  89. package/components/Icon/assets/icon-ppt.svg +3 -3
  90. package/components/Icon/assets/icon-rc_contact.svg +1 -1
  91. package/components/Icon/assets/icon-rcv_mic-off.svg +2 -2
  92. package/components/Icon/assets/icon-rcv_videocam-off.svg +2 -2
  93. package/components/Icon/assets/icon-sort.svg +2 -2
  94. package/components/Icon/assets/icon-stop-record.svg +1 -1
  95. package/components/Icon/assets/icon-weak-connection.svg +2 -2
  96. package/components/Icon/assets/icon-zip-D.svg +3 -3
  97. package/components/Icon/assets/icon-zip.svg +3 -3
  98. package/components/Icon/icon-symbol.d.ts +1 -1
  99. package/components/Icon/icon-symbol.js +1 -1
  100. package/es6/components/Dialog/Dialog.js +3 -1
  101. package/es6/components/Downshift/Downshift.js +1 -2
  102. package/es6/components/Downshift/SuggestionList/SuggestionList.js +4 -5
  103. package/es6/components/Downshift/SuggestionList/utils/useSuggestionList.js +90 -72
  104. package/es6/components/Downshift/utils/DownshiftUtils.js +5 -0
  105. package/es6/components/Downshift/utils/index.js +2 -0
  106. package/es6/components/Downshift/utils/useDownshift.js +135 -432
  107. package/es6/components/Downshift/utils/useDownshiftGroup.js +1 -0
  108. package/es6/components/Downshift/utils/useDownshiftTag.js +227 -0
  109. package/es6/components/Forms/TextField/styles/OutlineTextFieldStyle.js +2 -2
  110. package/es6/components/Forms/TextField/utils/OutlineTextFieldUtils.js +3 -0
  111. package/es6/components/Icon/assets/icon-0.svg +2 -2
  112. package/es6/components/Icon/assets/icon-2.svg +2 -2
  113. package/es6/components/Icon/assets/icon-3.svg +2 -2
  114. package/es6/components/Icon/assets/icon-4.svg +2 -2
  115. package/es6/components/Icon/assets/icon-5.svg +2 -2
  116. package/es6/components/Icon/assets/icon-6.svg +2 -2
  117. package/es6/components/Icon/assets/icon-7.svg +2 -2
  118. package/es6/components/Icon/assets/icon-8.svg +2 -2
  119. package/es6/components/Icon/assets/icon-9.svg +2 -2
  120. package/es6/components/Icon/assets/icon-Announcement.svg +8 -0
  121. package/es6/components/Icon/assets/icon-Call-queue.svg +14 -0
  122. package/es6/components/Icon/assets/icon-Limited.svg +7 -0
  123. package/es6/components/Icon/assets/icon-Message.svg +6 -0
  124. package/es6/components/Icon/assets/icon-Paging.svg +6 -0
  125. package/es6/components/Icon/assets/icon-Shared-line.svg +8 -0
  126. package/es6/components/Icon/assets/icon-avatar_rooms.svg +5 -0
  127. package/es6/components/Icon/assets/icon-box.svg +1 -1
  128. package/es6/components/Icon/assets/icon-box1.svg +5 -0
  129. package/es6/components/Icon/assets/icon-default-file-D.svg +3 -3
  130. package/es6/components/Icon/assets/icon-default-file.svg +4 -4
  131. package/es6/components/Icon/assets/icon-default-gdrive-D.svg +4 -4
  132. package/es6/components/Icon/assets/icon-default-gdrive.svg +5 -5
  133. package/es6/components/Icon/assets/icon-default-music-D.svg +3 -3
  134. package/es6/components/Icon/assets/icon-default-music.svg +3 -3
  135. package/es6/components/Icon/assets/icon-default-video-D.svg +3 -3
  136. package/es6/components/Icon/assets/icon-default-video.svg +3 -3
  137. package/es6/components/Icon/assets/icon-deleted_file.svg +2 -2
  138. package/es6/components/Icon/assets/icon-deleted_file_D.svg +2 -2
  139. package/es6/components/Icon/assets/icon-doc-D.svg +3 -3
  140. package/es6/components/Icon/assets/icon-doc.svg +3 -3
  141. package/es6/components/Icon/assets/icon-end--answer.svg +2 -2
  142. package/es6/components/Icon/assets/icon-excel-D.svg +3 -3
  143. package/es6/components/Icon/assets/icon-excel.svg +3 -3
  144. package/es6/components/Icon/assets/icon-font-color.svg +2 -2
  145. package/es6/components/Icon/assets/icon-gdrive-logo.svg +6 -6
  146. package/es6/components/Icon/assets/icon-gif-file-D.svg +3 -3
  147. package/es6/components/Icon/assets/icon-gif-file.svg +4 -4
  148. package/es6/components/Icon/assets/icon-gmail.svg +5 -5
  149. package/es6/components/Icon/assets/icon-google-calendar-2019.svg +6 -6
  150. package/es6/components/Icon/assets/icon-google-doc-D.svg +3 -3
  151. package/es6/components/Icon/assets/icon-google-doc.svg +3 -3
  152. package/es6/components/Icon/assets/icon-google-logo.svg +4 -4
  153. package/es6/components/Icon/assets/icon-google-sheet-D.svg +3 -3
  154. package/es6/components/Icon/assets/icon-google-sheet.svg +3 -3
  155. package/es6/components/Icon/assets/icon-google-slide-D.svg +3 -3
  156. package/es6/components/Icon/assets/icon-google-slide.svg +3 -3
  157. package/es6/components/Icon/assets/icon-hold-answer.svg +2 -2
  158. package/es6/components/Icon/assets/icon-image-broken-D.svg +3 -3
  159. package/es6/components/Icon/assets/icon-image-broken.svg +4 -4
  160. package/es6/components/Icon/assets/icon-image-preview-D.svg +3 -3
  161. package/es6/components/Icon/assets/icon-image-preview.svg +3 -3
  162. package/es6/components/Icon/assets/icon-item-list-selected.svg +1 -1
  163. package/es6/components/Icon/assets/icon-mac-keynote-D.svg +3 -3
  164. package/es6/components/Icon/assets/icon-mac-keynote.svg +6 -6
  165. package/es6/components/Icon/assets/icon-mac-numbers-D.svg +3 -3
  166. package/es6/components/Icon/assets/icon-mac-numbers.svg +3 -3
  167. package/es6/components/Icon/assets/icon-mac-pages-D.svg +3 -3
  168. package/es6/components/Icon/assets/icon-mac-pages.svg +3 -3
  169. package/es6/components/Icon/assets/icon-marker_m.svg +2 -2
  170. package/es6/components/Icon/assets/icon-marker_s.svg +2 -2
  171. package/es6/components/Icon/assets/icon-microsoft-logo.svg +4 -4
  172. package/es6/components/Icon/assets/icon-microsoft-outlook-2019.svg +15 -15
  173. package/es6/components/Icon/assets/icon-mobile.svg +5 -0
  174. package/es6/components/Icon/assets/icon-no-connection.svg +2 -2
  175. package/es6/components/Icon/assets/icon-pdf-D.svg +3 -3
  176. package/es6/components/Icon/assets/icon-pdf.svg +3 -3
  177. package/es6/components/Icon/assets/icon-poor-connection.svg +2 -2
  178. package/es6/components/Icon/assets/icon-ppt-D.svg +3 -3
  179. package/es6/components/Icon/assets/icon-ppt.svg +3 -3
  180. package/es6/components/Icon/assets/icon-rc_contact.svg +1 -1
  181. package/es6/components/Icon/assets/icon-rcv_mic-off.svg +2 -2
  182. package/es6/components/Icon/assets/icon-rcv_videocam-off.svg +2 -2
  183. package/es6/components/Icon/assets/icon-sort.svg +2 -2
  184. package/es6/components/Icon/assets/icon-stop-record.svg +1 -1
  185. package/es6/components/Icon/assets/icon-weak-connection.svg +2 -2
  186. package/es6/components/Icon/assets/icon-zip-D.svg +3 -3
  187. package/es6/components/Icon/assets/icon-zip.svg +3 -3
  188. package/es6/components/Icon/icon-symbol.js +1 -1
  189. package/es6/foundation/hooks/useRefState/useRefState.js +6 -1
  190. package/es6/foundation/theme/ThemeProvider.js +22 -6
  191. package/es6/icon/0.js +2 -2
  192. package/es6/icon/2.js +2 -2
  193. package/es6/icon/3.js +2 -2
  194. package/es6/icon/4.js +2 -2
  195. package/es6/icon/5.js +2 -2
  196. package/es6/icon/6.js +2 -2
  197. package/es6/icon/7.js +2 -2
  198. package/es6/icon/8.js +2 -2
  199. package/es6/icon/9.js +2 -2
  200. package/es6/icon/Announcement.js +8 -0
  201. package/es6/icon/AvatarRooms.js +7 -0
  202. package/es6/icon/Box.js +1 -1
  203. package/es6/icon/Box1.js +7 -0
  204. package/es6/icon/CallQueue.js +14 -0
  205. package/es6/icon/DefaultFile.js +4 -4
  206. package/es6/icon/DefaultFileD.js +3 -3
  207. package/es6/icon/DefaultGdrive.js +5 -5
  208. package/es6/icon/DefaultGdriveD.js +4 -4
  209. package/es6/icon/DefaultMusic.js +3 -3
  210. package/es6/icon/DefaultMusicD.js +3 -3
  211. package/es6/icon/DefaultVideo.js +3 -3
  212. package/es6/icon/DefaultVideoD.js +3 -3
  213. package/es6/icon/DeletedFile.js +2 -2
  214. package/es6/icon/DeletedFileD.js +2 -2
  215. package/es6/icon/Doc.js +3 -3
  216. package/es6/icon/DocD.js +3 -3
  217. package/es6/icon/EndAnswer.js +2 -2
  218. package/es6/icon/Excel.js +3 -3
  219. package/es6/icon/ExcelD.js +3 -3
  220. package/es6/icon/FontColor.js +2 -2
  221. package/es6/icon/GdriveLogo.js +6 -6
  222. package/es6/icon/GifFile.js +4 -4
  223. package/es6/icon/GifFileD.js +3 -3
  224. package/es6/icon/Gmail.js +5 -5
  225. package/es6/icon/GoogleCalendar2019.js +6 -6
  226. package/es6/icon/GoogleDoc.js +3 -3
  227. package/es6/icon/GoogleDocD.js +3 -3
  228. package/es6/icon/GoogleLogo.js +4 -4
  229. package/es6/icon/GoogleSheet.js +3 -3
  230. package/es6/icon/GoogleSheetD.js +3 -3
  231. package/es6/icon/GoogleSlide.js +3 -3
  232. package/es6/icon/GoogleSlideD.js +3 -3
  233. package/es6/icon/HoldAnswer.js +2 -2
  234. package/es6/icon/ImageBroken.js +4 -4
  235. package/es6/icon/ImageBrokenD.js +3 -3
  236. package/es6/icon/ImagePreview.js +3 -3
  237. package/es6/icon/ImagePreviewD.js +3 -3
  238. package/es6/icon/ItemListSelected.js +1 -1
  239. package/es6/icon/Limited.js +8 -0
  240. package/es6/icon/MacKeynote.js +4 -4
  241. package/es6/icon/MacKeynoteD.js +3 -3
  242. package/es6/icon/MacNumbers.js +3 -3
  243. package/es6/icon/MacNumbersD.js +3 -3
  244. package/es6/icon/MacPages.js +3 -3
  245. package/es6/icon/MacPagesD.js +3 -3
  246. package/es6/icon/MarkerM.js +2 -2
  247. package/es6/icon/MarkerS.js +2 -2
  248. package/es6/icon/Message.js +8 -0
  249. package/es6/icon/MicrosoftLogo.js +4 -4
  250. package/es6/icon/MicrosoftOutlook2019.js +15 -15
  251. package/es6/icon/Mobile.js +7 -0
  252. package/es6/icon/NoConnection.js +2 -2
  253. package/es6/icon/Paging.js +8 -0
  254. package/es6/icon/Pdf.js +3 -3
  255. package/es6/icon/PdfD.js +3 -3
  256. package/es6/icon/PoorConnection.js +2 -2
  257. package/es6/icon/Ppt.js +3 -3
  258. package/es6/icon/PptD.js +3 -3
  259. package/es6/icon/RcContact.js +1 -1
  260. package/es6/icon/RcvMicOff.js +2 -2
  261. package/es6/icon/RcvVideocamOff.js +2 -2
  262. package/es6/icon/SharedLine.js +9 -0
  263. package/es6/icon/Sort.js +2 -2
  264. package/es6/icon/StopRecord.js +1 -1
  265. package/es6/icon/WeakConnection.js +2 -2
  266. package/es6/icon/Zip.js +3 -3
  267. package/es6/icon/ZipD.js +3 -3
  268. package/es6/icon/index.js +10 -1
  269. package/es6/icons/icon-0.svg +2 -2
  270. package/es6/icons/icon-2.svg +2 -2
  271. package/es6/icons/icon-3.svg +2 -2
  272. package/es6/icons/icon-4.svg +2 -2
  273. package/es6/icons/icon-5.svg +2 -2
  274. package/es6/icons/icon-6.svg +2 -2
  275. package/es6/icons/icon-7.svg +2 -2
  276. package/es6/icons/icon-8.svg +2 -2
  277. package/es6/icons/icon-9.svg +2 -2
  278. package/es6/icons/icon-Announcement.svg +8 -0
  279. package/es6/icons/icon-Call-queue.svg +14 -0
  280. package/es6/icons/icon-Limited.svg +7 -0
  281. package/es6/icons/icon-Message.svg +6 -0
  282. package/es6/icons/icon-Paging.svg +6 -0
  283. package/es6/icons/icon-Shared-line.svg +8 -0
  284. package/es6/icons/icon-avatar_rooms.svg +5 -0
  285. package/es6/icons/icon-box.svg +1 -1
  286. package/es6/icons/icon-box1.svg +5 -0
  287. package/es6/icons/icon-default-file-D.svg +3 -3
  288. package/es6/icons/icon-default-file.svg +4 -4
  289. package/es6/icons/icon-default-gdrive-D.svg +4 -4
  290. package/es6/icons/icon-default-gdrive.svg +5 -5
  291. package/es6/icons/icon-default-music-D.svg +3 -3
  292. package/es6/icons/icon-default-music.svg +3 -3
  293. package/es6/icons/icon-default-video-D.svg +3 -3
  294. package/es6/icons/icon-default-video.svg +3 -3
  295. package/es6/icons/icon-deleted_file.svg +2 -2
  296. package/es6/icons/icon-deleted_file_D.svg +2 -2
  297. package/es6/icons/icon-doc-D.svg +3 -3
  298. package/es6/icons/icon-doc.svg +3 -3
  299. package/es6/icons/icon-end--answer.svg +2 -2
  300. package/es6/icons/icon-excel-D.svg +3 -3
  301. package/es6/icons/icon-excel.svg +3 -3
  302. package/es6/icons/icon-font-color.svg +2 -2
  303. package/es6/icons/icon-gdrive-logo.svg +6 -6
  304. package/es6/icons/icon-gif-file-D.svg +3 -3
  305. package/es6/icons/icon-gif-file.svg +4 -4
  306. package/es6/icons/icon-gmail.svg +5 -5
  307. package/es6/icons/icon-google-calendar-2019.svg +6 -6
  308. package/es6/icons/icon-google-doc-D.svg +3 -3
  309. package/es6/icons/icon-google-doc.svg +3 -3
  310. package/es6/icons/icon-google-logo.svg +4 -4
  311. package/es6/icons/icon-google-sheet-D.svg +3 -3
  312. package/es6/icons/icon-google-sheet.svg +3 -3
  313. package/es6/icons/icon-google-slide-D.svg +3 -3
  314. package/es6/icons/icon-google-slide.svg +3 -3
  315. package/es6/icons/icon-hold-answer.svg +2 -2
  316. package/es6/icons/icon-image-broken-D.svg +3 -3
  317. package/es6/icons/icon-image-broken.svg +4 -4
  318. package/es6/icons/icon-image-preview-D.svg +3 -3
  319. package/es6/icons/icon-image-preview.svg +3 -3
  320. package/es6/icons/icon-item-list-selected.svg +1 -1
  321. package/es6/icons/icon-mac-keynote-D.svg +3 -3
  322. package/es6/icons/icon-mac-keynote.svg +6 -6
  323. package/es6/icons/icon-mac-numbers-D.svg +3 -3
  324. package/es6/icons/icon-mac-numbers.svg +3 -3
  325. package/es6/icons/icon-mac-pages-D.svg +3 -3
  326. package/es6/icons/icon-mac-pages.svg +3 -3
  327. package/es6/icons/icon-marker_m.svg +2 -2
  328. package/es6/icons/icon-marker_s.svg +2 -2
  329. package/es6/icons/icon-microsoft-logo.svg +4 -4
  330. package/es6/icons/icon-microsoft-outlook-2019.svg +15 -15
  331. package/es6/icons/icon-mobile.svg +5 -0
  332. package/es6/icons/icon-no-connection.svg +2 -2
  333. package/es6/icons/icon-pdf-D.svg +3 -3
  334. package/es6/icons/icon-pdf.svg +3 -3
  335. package/es6/icons/icon-poor-connection.svg +2 -2
  336. package/es6/icons/icon-ppt-D.svg +3 -3
  337. package/es6/icons/icon-ppt.svg +3 -3
  338. package/es6/icons/icon-rc_contact.svg +1 -1
  339. package/es6/icons/icon-rcv_mic-off.svg +2 -2
  340. package/es6/icons/icon-rcv_videocam-off.svg +2 -2
  341. package/es6/icons/icon-sort.svg +2 -2
  342. package/es6/icons/icon-stop-record.svg +1 -1
  343. package/es6/icons/icon-weak-connection.svg +2 -2
  344. package/es6/icons/icon-zip-D.svg +3 -3
  345. package/es6/icons/icon-zip.svg +3 -3
  346. package/foundation/hooks/useRefState/useRefState.js +6 -1
  347. package/foundation/theme/ThemeProvider.d.ts +11 -11
  348. package/foundation/theme/ThemeProvider.js +22 -6
  349. package/icon/0.js +2 -2
  350. package/icon/2.js +2 -2
  351. package/icon/3.js +2 -2
  352. package/icon/4.js +2 -2
  353. package/icon/5.js +2 -2
  354. package/icon/6.js +2 -2
  355. package/icon/7.js +2 -2
  356. package/icon/8.js +2 -2
  357. package/icon/9.js +2 -2
  358. package/icon/Announcement.d.ts +3 -0
  359. package/icon/Announcement.js +10 -0
  360. package/icon/AvatarRooms.d.ts +3 -0
  361. package/icon/AvatarRooms.js +9 -0
  362. package/icon/Box.js +1 -1
  363. package/icon/Box1.d.ts +3 -0
  364. package/icon/Box1.js +9 -0
  365. package/icon/CallQueue.d.ts +3 -0
  366. package/icon/CallQueue.js +16 -0
  367. package/icon/DefaultFile.js +4 -4
  368. package/icon/DefaultFileD.js +3 -3
  369. package/icon/DefaultGdrive.js +5 -5
  370. package/icon/DefaultGdriveD.js +4 -4
  371. package/icon/DefaultMusic.js +3 -3
  372. package/icon/DefaultMusicD.js +3 -3
  373. package/icon/DefaultVideo.js +3 -3
  374. package/icon/DefaultVideoD.js +3 -3
  375. package/icon/DeletedFile.js +2 -2
  376. package/icon/DeletedFileD.js +2 -2
  377. package/icon/Doc.js +3 -3
  378. package/icon/DocD.js +3 -3
  379. package/icon/EndAnswer.js +2 -2
  380. package/icon/Excel.js +3 -3
  381. package/icon/ExcelD.js +3 -3
  382. package/icon/FontColor.js +2 -2
  383. package/icon/GdriveLogo.js +6 -6
  384. package/icon/GifFile.js +4 -4
  385. package/icon/GifFileD.js +3 -3
  386. package/icon/Gmail.js +5 -5
  387. package/icon/GoogleCalendar2019.js +6 -6
  388. package/icon/GoogleDoc.js +3 -3
  389. package/icon/GoogleDocD.js +3 -3
  390. package/icon/GoogleLogo.js +4 -4
  391. package/icon/GoogleSheet.js +3 -3
  392. package/icon/GoogleSheetD.js +3 -3
  393. package/icon/GoogleSlide.js +3 -3
  394. package/icon/GoogleSlideD.js +3 -3
  395. package/icon/HoldAnswer.js +2 -2
  396. package/icon/ImageBroken.js +4 -4
  397. package/icon/ImageBrokenD.js +3 -3
  398. package/icon/ImagePreview.js +3 -3
  399. package/icon/ImagePreviewD.js +3 -3
  400. package/icon/ItemListSelected.js +1 -1
  401. package/icon/Limited.d.ts +3 -0
  402. package/icon/Limited.js +10 -0
  403. package/icon/MacKeynote.js +4 -4
  404. package/icon/MacKeynoteD.js +3 -3
  405. package/icon/MacNumbers.js +3 -3
  406. package/icon/MacNumbersD.js +3 -3
  407. package/icon/MacPages.js +3 -3
  408. package/icon/MacPagesD.js +3 -3
  409. package/icon/MarkerM.js +2 -2
  410. package/icon/MarkerS.js +2 -2
  411. package/icon/Message.d.ts +3 -0
  412. package/icon/Message.js +10 -0
  413. package/icon/MicrosoftLogo.js +4 -4
  414. package/icon/MicrosoftOutlook2019.js +15 -15
  415. package/icon/Mobile.d.ts +3 -0
  416. package/icon/Mobile.js +9 -0
  417. package/icon/NoConnection.js +2 -2
  418. package/icon/Paging.d.ts +3 -0
  419. package/icon/Paging.js +10 -0
  420. package/icon/Pdf.js +3 -3
  421. package/icon/PdfD.js +3 -3
  422. package/icon/PoorConnection.js +2 -2
  423. package/icon/Ppt.js +3 -3
  424. package/icon/PptD.js +3 -3
  425. package/icon/RcContact.js +1 -1
  426. package/icon/RcvMicOff.js +2 -2
  427. package/icon/RcvVideocamOff.js +2 -2
  428. package/icon/SharedLine.d.ts +3 -0
  429. package/icon/SharedLine.js +11 -0
  430. package/icon/Sort.js +2 -2
  431. package/icon/StopRecord.js +1 -1
  432. package/icon/WeakConnection.js +2 -2
  433. package/icon/Zip.js +3 -3
  434. package/icon/ZipD.js +3 -3
  435. package/icon/index.d.ts +10 -1
  436. package/icon/index.js +20 -2
  437. package/icons/icon-0.svg +2 -2
  438. package/icons/icon-2.svg +2 -2
  439. package/icons/icon-3.svg +2 -2
  440. package/icons/icon-4.svg +2 -2
  441. package/icons/icon-5.svg +2 -2
  442. package/icons/icon-6.svg +2 -2
  443. package/icons/icon-7.svg +2 -2
  444. package/icons/icon-8.svg +2 -2
  445. package/icons/icon-9.svg +2 -2
  446. package/icons/icon-Announcement.svg +8 -0
  447. package/icons/icon-Call-queue.svg +14 -0
  448. package/icons/icon-Limited.svg +7 -0
  449. package/icons/icon-Message.svg +6 -0
  450. package/icons/icon-Paging.svg +6 -0
  451. package/icons/icon-Shared-line.svg +8 -0
  452. package/icons/icon-avatar_rooms.svg +5 -0
  453. package/icons/icon-box.svg +1 -1
  454. package/icons/icon-box1.svg +5 -0
  455. package/icons/icon-default-file-D.svg +3 -3
  456. package/icons/icon-default-file.svg +4 -4
  457. package/icons/icon-default-gdrive-D.svg +4 -4
  458. package/icons/icon-default-gdrive.svg +5 -5
  459. package/icons/icon-default-music-D.svg +3 -3
  460. package/icons/icon-default-music.svg +3 -3
  461. package/icons/icon-default-video-D.svg +3 -3
  462. package/icons/icon-default-video.svg +3 -3
  463. package/icons/icon-deleted_file.svg +2 -2
  464. package/icons/icon-deleted_file_D.svg +2 -2
  465. package/icons/icon-doc-D.svg +3 -3
  466. package/icons/icon-doc.svg +3 -3
  467. package/icons/icon-end--answer.svg +2 -2
  468. package/icons/icon-excel-D.svg +3 -3
  469. package/icons/icon-excel.svg +3 -3
  470. package/icons/icon-font-color.svg +2 -2
  471. package/icons/icon-gdrive-logo.svg +6 -6
  472. package/icons/icon-gif-file-D.svg +3 -3
  473. package/icons/icon-gif-file.svg +4 -4
  474. package/icons/icon-gmail.svg +5 -5
  475. package/icons/icon-google-calendar-2019.svg +6 -6
  476. package/icons/icon-google-doc-D.svg +3 -3
  477. package/icons/icon-google-doc.svg +3 -3
  478. package/icons/icon-google-logo.svg +4 -4
  479. package/icons/icon-google-sheet-D.svg +3 -3
  480. package/icons/icon-google-sheet.svg +3 -3
  481. package/icons/icon-google-slide-D.svg +3 -3
  482. package/icons/icon-google-slide.svg +3 -3
  483. package/icons/icon-hold-answer.svg +2 -2
  484. package/icons/icon-image-broken-D.svg +3 -3
  485. package/icons/icon-image-broken.svg +4 -4
  486. package/icons/icon-image-preview-D.svg +3 -3
  487. package/icons/icon-image-preview.svg +3 -3
  488. package/icons/icon-item-list-selected.svg +1 -1
  489. package/icons/icon-mac-keynote-D.svg +3 -3
  490. package/icons/icon-mac-keynote.svg +6 -6
  491. package/icons/icon-mac-numbers-D.svg +3 -3
  492. package/icons/icon-mac-numbers.svg +3 -3
  493. package/icons/icon-mac-pages-D.svg +3 -3
  494. package/icons/icon-mac-pages.svg +3 -3
  495. package/icons/icon-marker_m.svg +2 -2
  496. package/icons/icon-marker_s.svg +2 -2
  497. package/icons/icon-microsoft-logo.svg +4 -4
  498. package/icons/icon-microsoft-outlook-2019.svg +15 -15
  499. package/icons/icon-mobile.svg +5 -0
  500. package/icons/icon-no-connection.svg +2 -2
  501. package/icons/icon-pdf-D.svg +3 -3
  502. package/icons/icon-pdf.svg +3 -3
  503. package/icons/icon-poor-connection.svg +2 -2
  504. package/icons/icon-ppt-D.svg +3 -3
  505. package/icons/icon-ppt.svg +3 -3
  506. package/icons/icon-rc_contact.svg +1 -1
  507. package/icons/icon-rcv_mic-off.svg +2 -2
  508. package/icons/icon-rcv_videocam-off.svg +2 -2
  509. package/icons/icon-sort.svg +2 -2
  510. package/icons/icon-stop-record.svg +1 -1
  511. package/icons/icon-weak-connection.svg +2 -2
  512. package/icons/icon-zip-D.svg +3 -3
  513. package/icons/icon-zip.svg +3 -3
  514. package/package.json +1 -1
@@ -29,7 +29,9 @@ var _RcDialog = forwardRef(function (inProps, ref) {
29
29
  }, [maxWidthProp, size]);
30
30
  var contextValue = useMemo(function () { return ({ size: childrenSize }); }, [childrenSize]);
31
31
  var onExited = useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
32
- var TransitionProps = __assign(__assign({}, TransitionPropsProp), { onExited: onExited });
32
+ var TransitionProps = __assign(__assign({
33
+ // TODO: remove after upgrade to mui v5
34
+ role: 'presentation' }, TransitionPropsProp), { onExited: onExited });
33
35
  return (React.createElement(MuiDialog, __assign({ ref: ref, fullWidth: fullWidth, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, maxWidth: maxWidth, fullScreen: size === 'fullScreen' ? true : undefined, classes: classes, TransitionProps: TransitionProps }, rest),
34
36
  React.createElement(RcDialogContext.Provider, { value: contextValue }, children)));
35
37
  });
@@ -62,7 +62,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
62
62
  onKeyDown: onKeyDownProp,
63
63
  disabledItemsHighlightable: disabledItemsHighlightable,
64
64
  onGroupExpanded: onGroupExpanded,
65
- }), focusInput = _z.focusInput, optionItems = _z.optionItems, optionsGroupList = _z.optionsGroupList, selectedItems = _z.selectedItems, highlightedIndex = _z.highlightedIndex, getToggleButtonProps = _z.getToggleButtonProps, getTagProps = _z.getTagProps, getTagListBoxProps = _z.getTagListBoxProps, getMenuProps = _z.getMenuProps, getPopperProps = _z.getPopperProps, getInputProps = _z.getInputProps, getInputAriaProps = _z.getInputAriaProps, getLabelProps = _z.getLabelProps, getItemProps = _z.getItemProps, isOpen = _z.isOpen, inputValue = _z.inputValue, isTagsFocus = _z.isTagsFocus, activeIndex = _z.activeIndex, setActiveIndex = _z.setActiveIndex, setHighlightedIndex = _z.setHighlightedIndex, onInputChange = _z.onInputChange, keepHighlightedIndex = _z.keepHighlightedIndex, changeHighlightedIndexReason = _z.changeHighlightedIndexReason, closeMenu = _z.closeMenu, openMenu = _z.openMenu, reset = _z.reset, getClearButtonProps = _z.getClearButtonProps, noOptionItem = _z.noOptionItem, getNoOptionsProps = _z.getNoOptionsProps, isKeepHighlightedIndex = _z.isKeepHighlightedIndex, isFocused = _z.isFocused;
65
+ }), focusInput = _z.focusInput, optionItems = _z.optionItems, optionsGroupList = _z.optionsGroupList, selectedItems = _z.tags, highlightedIndex = _z.highlightedIndex, getToggleButtonProps = _z.getToggleButtonProps, getTagProps = _z.getTagProps, getTagListBoxProps = _z.getTagListBoxProps, getMenuProps = _z.getMenuProps, getPopperProps = _z.getPopperProps, getInputProps = _z.getInputProps, getInputAriaProps = _z.getInputAriaProps, getLabelProps = _z.getLabelProps, getItemProps = _z.getItemProps, isOpen = _z.isOpen, inputValue = _z.inputValue, activeIndex = _z.activeIndex, setActiveIndex = _z.setActiveIndex, setHighlightedIndex = _z.setHighlightedIndex, onInputChange = _z.onInputChange, keepHighlightedIndex = _z.keepHighlightedIndex, changeHighlightedIndexReason = _z.changeHighlightedIndexReason, closeMenu = _z.closeMenu, openMenu = _z.openMenu, reset = _z.reset, getClearButtonProps = _z.getClearButtonProps, noOptionItem = _z.noOptionItem, getNoOptionsProps = _z.getNoOptionsProps, isKeepHighlightedIndex = _z.isKeepHighlightedIndex, isDownshiftFocused = _z.focused;
66
66
  var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
67
67
  var _0 = getInputProps(), onBlur = _0.onBlur, InputProps = __rest(_0, ["onBlur"]);
68
68
  var helperText = isNew
@@ -124,7 +124,6 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
124
124
  } })));
125
125
  });
126
126
  })();
127
- var isDownshiftFocused = focused !== null && focused !== void 0 ? focused : (isTagsFocus || isFocused ? true : undefined);
128
127
  var endAdornment = (toggleButton || clearBtn) && (React.createElement(EndAdornment, null,
129
128
  clearBtn && (React.createElement(ClearIconButton, __assign({}, getClearButtonProps(clearButtonProps)))),
130
129
  toggleButton && (React.createElement(ArrowDownButton, __assign({ variant: "plain", "aria-hidden": true, color: isDownshiftFocused
@@ -21,7 +21,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
21
21
  var highlightedIndex = props.highlightedIndex, options = props.options, getItemProps = props.getItemProps, getMenuProps = props.getMenuProps, renderOption = props.renderOption, inputValue = props.inputValue, groupVariant = props.groupVariant, groupExpanded = props.groupExpanded, renderGroup = props.renderGroup, optionsGroupList = props.optionsGroupList, getOptionDisabled = props.getOptionDisabled, MenuItem = props.MenuItem, changeHighlightedIndexReason = props.changeHighlightedIndexReason, isKeepHighlightedIndex = props.isKeepHighlightedIndex, componentsProp = props.components, onUpdatePopper = props.onUpdatePopper, getOptionLabel = props.getOptionLabel, padding = props.padding, _a = props.maxContainerHeight, maxContainerHeight = _a === void 0 ? '100%' : _a, classNameProp = props.className, classesProp = props.classes, rest = __rest(props, ["highlightedIndex", "options", "getItemProps", "getMenuProps", "renderOption", "inputValue", "groupVariant", "groupExpanded", "renderGroup", "optionsGroupList", "getOptionDisabled", "MenuItem", "changeHighlightedIndexReason", "isKeepHighlightedIndex", "components", "onUpdatePopper", "getOptionLabel", "padding", "maxContainerHeight", "className", "classes"]);
22
22
  var vlRef = useRef(null);
23
23
  var forkVlRef = useForkRef(ref, vlRef);
24
- var isTitleGroup = groupVariant === 'normal';
24
+ var isTitleMode = groupVariant === 'normal';
25
25
  var listRef = useRef(null);
26
26
  var itemData = options;
27
27
  var itemCount = options.length;
@@ -79,7 +79,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
79
79
  changeHighlightedIndexReason !== 'mouse') {
80
80
  scrollToHighlightedIndex(prevHighlightedIndex, highlightedIndex,
81
81
  // when title group topHighlightIndex to be 1, first item is group title
82
- isTitleGroup ? 1 : 0);
82
+ isTitleMode ? 1 : 0);
83
83
  }
84
84
  });
85
85
  var handleScrolling = function (scrolling) {
@@ -98,9 +98,8 @@ var SuggestionList = forwardRef(function (inProps, ref) {
98
98
  var _b, _c, _d, _e;
99
99
  var currGroup = option.group;
100
100
  var isGroupTitle = option === (currGroup === null || currGroup === void 0 ? void 0 : currGroup.options[0]);
101
- var groupIndex = (optionsGroupList === null || optionsGroupList === void 0 ? void 0 : optionsGroupList.findIndex(function (x) { return x.group === (currGroup === null || currGroup === void 0 ? void 0 : currGroup.group); })) || 0;
102
101
  var isFixedGroupExpanded = typeof groupExpanded === 'boolean';
103
- var expandIconProps = !isTitleGroup && !isFixedGroupExpanded && isGroupTitle
102
+ var expandIconProps = !isTitleMode && !isFixedGroupExpanded && isGroupTitle
104
103
  ? (_c = (_b = option.group) === null || _b === void 0 ? void 0 : _b.getExpandIconProps) === null || _c === void 0 ? void 0 : _c.call(_b, {
105
104
  className: clsx(classes.toggle, (_a = {},
106
105
  _a[classes.expanded] = (_d = option.group) === null || _d === void 0 ? void 0 : _d.expanded,
@@ -112,7 +111,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
112
111
  className: isGroupTitle ? classes.groupTitle : undefined,
113
112
  });
114
113
  var selected = highlightedIndex === index;
115
- var resultProps = __assign(__assign(__assign({}, option), itemProps), { 'aria-setsize': itemCount - (isTitleGroup ? (optionsGroupList === null || optionsGroupList === void 0 ? void 0 : optionsGroupList.length) || 0 : 0), 'aria-posinset': index - (isTitleGroup ? groupIndex : 0), key: itemProps.id });
114
+ var resultProps = __assign(__assign(__assign({}, option), itemProps), { key: itemProps.id });
116
115
  var indexInOwnGroup = resultProps.indexInOwnGroup;
117
116
  delete resultProps.indexInOwnGroup;
118
117
  // * when item is not disabled, that should check outside is that disabled
@@ -1,9 +1,8 @@
1
- import { __read, __rest } from "tslib";
2
- import { useMemo, useRef } from 'react';
3
- import uniqueId from 'lodash/uniqueId';
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import { useCallback, useEffect, useMemo, useRef, } from 'react';
4
3
  import { useControlled } from '@material-ui/core/utils';
5
- import { combineProps, useForceUpdate, useKeyboardMoveFocus, useResultRef, } from '../../../../foundation';
6
- import { DEFAULT_GET_OPTION_LABEL, isItemCanSelected, } from '../../utils';
4
+ import { combineProps, useForceUpdate, useId, useKeyboardMoveFocus, } from '../../../../foundation';
5
+ import { DEFAULT_GET_OPTION_LABEL, isItemCanSelected, } from '../../utils/DownshiftUtils';
7
6
  import { useDownshiftGroup } from '../../utils/useDownshiftGroup';
8
7
  var DEFAULT_HIGHLIGHTED_INDEX = -1;
9
8
  var componentName = 'useSuggestionList';
@@ -11,7 +10,8 @@ var componentName = 'useSuggestionList';
11
10
  * provide suggestion list with search function and expandable group with virtualized list
12
11
  */
13
12
  export var useSuggestionList = function (_a) {
14
- var inputValueProp = _a.inputValue, _b = _a.getOptionLabel, getOptionLabel = _b === void 0 ? DEFAULT_GET_OPTION_LABEL : _b, filterOptions = _a.filterOptions, disabledItemsHighlightable = _a.disabledItemsHighlightable, options = _a.options, onInputChangeProp = _a.onInputChange, inputRef = _a.inputRef, onKeyDownProp = _a.onKeyDown, onSelect = _a.onSelect, onClear = _a.onClear, getOptionDisabled = _a.getOptionDisabled, groupBy = _a.groupBy, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, groupExpanded = _a.groupExpanded, groupDefaultExpanded = _a.groupDefaultExpanded, getExpandIconProps = _a.getExpandIconProps;
13
+ var id = _a.id, inputValueProp = _a.inputValue, _b = _a.getOptionLabel, getOptionLabel = _b === void 0 ? DEFAULT_GET_OPTION_LABEL : _b, filterOptions = _a.filterOptions, disabledItemsHighlightable = _a.disabledItemsHighlightable, options = _a.options, onInputChangeProp = _a.onInputChange, inputRef = _a.inputRef, onKeyDownProp = _a.onKeyDown, onSelect = _a.onSelect, onClear = _a.onClear, getOptionDisabled = _a.getOptionDisabled, groupBy = _a.groupBy, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, groupExpanded = _a.groupExpanded, groupDefaultExpanded = _a.groupDefaultExpanded, getExpandIconProps = _a.getExpandIconProps, processFilteredResult = _a.processFilteredResult;
14
+ var isTitleMode = groupVariant === 'normal';
15
15
  var _c = __read(useControlled({
16
16
  controlled: inputValueProp,
17
17
  default: '',
@@ -22,44 +22,44 @@ export var useSuggestionList = function (_a) {
22
22
  setInputValue(newValue);
23
23
  };
24
24
  var focusInput = function () { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
25
- var suggestionListId = useResultRef(function () {
26
- return uniqueId("suggestion-list-");
27
- }).current;
28
- // * use -2 for us know that is init state, for recalculate defaultHighlightedIndex
25
+ var currUniqueId = useId(id || 'suggestion-list', !id);
29
26
  var highlightedIndexRef = useRef(DEFAULT_HIGHLIGHTED_INDEX);
30
- var changeHighlightedIndexReason = useRef();
27
+ var changeHighlightedIndexReasonRef = useRef();
31
28
  var forceUpdate = useForceUpdate();
29
+ var getFilteredItems = useCallback(function (items) {
30
+ if (filterOptions) {
31
+ return filterOptions(items, {
32
+ inputValue: inputValue,
33
+ getOptionLabel: getOptionLabel,
34
+ selectedItems: [],
35
+ });
36
+ }
37
+ return items;
38
+ }, [filterOptions, getOptionLabel, inputValue]);
32
39
  var filteredResult = useMemo(function () {
33
- var getFilteredItems = function (items) {
34
- if (filterOptions) {
35
- return filterOptions(items, {
36
- inputValue: inputValue,
37
- getOptionLabel: getOptionLabel,
38
- selectedItems: [],
39
- });
40
- }
41
- return items;
42
- };
43
40
  // * only when isOpen calculate the filtered result
44
41
  var results = getFilteredItems(options);
42
+ results = processFilteredResult
43
+ ? processFilteredResult(results, inputValue)
44
+ : results;
45
45
  return results;
46
- }, [filterOptions, getOptionLabel, inputValue, options]);
46
+ }, [getFilteredItems, inputValue, options, processFilteredResult]);
47
47
  var _d = useDownshiftGroup({
48
- groupBy: groupBy,
48
+ id: currUniqueId,
49
49
  options: options,
50
50
  filteredResult: filteredResult,
51
- getExpandIconProps: getExpandIconProps,
52
51
  groupExpanded: groupExpanded,
53
52
  groupDefaultExpanded: groupDefaultExpanded,
54
- onGroupExpanded: onGroupExpanded,
55
53
  groupVariant: groupVariant,
54
+ groupBy: groupBy,
55
+ getExpandIconProps: getExpandIconProps,
56
+ onGroupExpanded: onGroupExpanded,
56
57
  getOptionDisabled: getOptionDisabled,
57
- id: suggestionListId,
58
58
  }), groupedResult = _d.groupedResult, handleGroupExpandedChange = _d.handleGroupExpandedChange, optionsGroupList = _d.optionsGroupList;
59
59
  var optionItems = groupBy ? groupedResult : filteredResult;
60
60
  var setHighlightedIndex = function (index, _a) {
61
61
  var _b = _a.reRender, reRender = _b === void 0 ? false : _b, reason = _a.reason;
62
- changeHighlightedIndexReason.current = reason;
62
+ changeHighlightedIndexReasonRef.current = reason;
63
63
  if (highlightedIndexRef.current !== index) {
64
64
  highlightedIndexRef.current = index;
65
65
  if (reRender)
@@ -77,25 +77,25 @@ export var useSuggestionList = function (_a) {
77
77
  return ((!!item && item.freeSolo) ||
78
78
  (isItemCanSelected(item) && !(getOptionDisabled === null || getOptionDisabled === void 0 ? void 0 : getOptionDisabled(item))));
79
79
  };
80
- var selectItemFn = function (e, selectedItem) {
80
+ var selectItem = function (e, selectedItem) {
81
81
  if (getIsItemCanSelected(selectedItem)) {
82
82
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(e, selectedItem);
83
83
  return true;
84
84
  }
85
85
  return false;
86
86
  };
87
- var resetState = function () {
87
+ var clearInput = function () {
88
88
  if (inputRef.current && inputRef.current.value.length > 0) {
89
89
  updateInputValue('');
90
90
  }
91
91
  };
92
92
  var reset = function (isFocus) {
93
- resetState();
93
+ clearInput();
94
94
  onInputChangeProp === null || onInputChangeProp === void 0 ? void 0 : onInputChangeProp('');
95
95
  if (isFocus)
96
96
  focusInput();
97
97
  };
98
- var onKeyFocusedIndexHandle = useKeyboardMoveFocus({
98
+ var _e = useKeyboardMoveFocus({
99
99
  options: optionItems,
100
100
  focusedIndexRef: highlightedIndexRef,
101
101
  infinite: true,
@@ -108,29 +108,44 @@ export var useSuggestionList = function (_a) {
108
108
  : function (child) {
109
109
  return !getIsItemCanSelected(child);
110
110
  },
111
- }).onKeyFocusedIndexHandle;
111
+ }), onKeyFocusedIndexHandle = _e.onKeyFocusedIndexHandle, getNextFocusableOption = _e.getNextFocusableOption;
112
112
  var getItemProps = function (_a) {
113
- var item = _a.item, index = _a.index, itemRest = __rest(_a, ["item", "index"]);
114
- return combineProps({
115
- id: suggestionListId + "-option-" + index,
116
- role: 'option',
117
- onClick: function (e) {
118
- selectItemFn(e, item);
119
- },
120
- onMouseDown: function (e) {
113
+ var item = _a.item, _b = _a.index, index = _b === void 0 ? 0 : _b, itemRest = __rest(_a, ["item", "index"]);
114
+ var currGroup = item.group;
115
+ var isGroupTitle = item === (currGroup === null || currGroup === void 0 ? void 0 : currGroup.options[0]);
116
+ var itemCount = optionItems.length;
117
+ var groupOrder = (currGroup === null || currGroup === void 0 ? void 0 : currGroup.order) || 0;
118
+ return combineProps(__assign({ id: currUniqueId + "-option-" + index, onClick: function (e) {
119
+ selectItem(e, item);
120
+ }, onMouseDown: function (e) {
121
121
  e.preventDefault();
122
122
  e.stopPropagation();
123
- },
124
- onMouseOver: function () {
125
- if (highlightedIndexRef.current !== index) {
123
+ }, onMouseOver: function () {
124
+ if (highlightedIndexRef.current !== index &&
125
+ getIsItemCanSelected(item)) {
126
126
  setHighlightedIndex(index, { reason: 'mouse', reRender: true });
127
127
  }
128
- },
129
- }, itemRest);
128
+ } }, (isTitleMode && isGroupTitle
129
+ ? {}
130
+ : {
131
+ role: 'option',
132
+ 'aria-setsize': itemCount - (isTitleMode ? (optionsGroupList === null || optionsGroupList === void 0 ? void 0 : optionsGroupList.length) || 0 : 0),
133
+ 'aria-posinset': index - (isTitleMode ? groupOrder + 1 : 0),
134
+ })), itemRest);
135
+ };
136
+ var handleF10KeyDown = function (e) {
137
+ var highlightedIndex = highlightedIndexRef.current;
138
+ if (e.shiftKey) {
139
+ var currOption = optionItems[highlightedIndex];
140
+ var currentGroup = currOption.group;
141
+ if (currentGroup && currentGroup.options.length > 1) {
142
+ handleGroupExpandedChange(currentGroup.group);
143
+ }
144
+ }
130
145
  };
131
146
  var getInputProps = function (props) {
132
147
  return combineProps({
133
- id: suggestionListId + "-input",
148
+ id: currUniqueId + "-input",
134
149
  autoComplete: 'off',
135
150
  onChange: function (e) {
136
151
  var changeValue = e.target.value;
@@ -139,18 +154,12 @@ export var useSuggestionList = function (_a) {
139
154
  onKeyDown: function (e) {
140
155
  var _a;
141
156
  onKeyDownProp === null || onKeyDownProp === void 0 ? void 0 : onKeyDownProp(e, highlightedIndexRef.current);
142
- var highlightedIndex = highlightedIndexRef.current;
143
157
  switch (e.key) {
144
158
  case 'F10':
145
- if (e.shiftKey) {
146
- var currOption = optionItems[highlightedIndex];
147
- var currentGroup = currOption.group;
148
- if (currentGroup && currentGroup.options.length > 1) {
149
- handleGroupExpandedChange(currentGroup.group);
150
- }
151
- }
159
+ handleF10KeyDown(e);
152
160
  break;
153
- case 'Enter':
161
+ case 'Enter': {
162
+ var highlightedIndex = highlightedIndexRef.current;
154
163
  if (e.which === 229)
155
164
  return;
156
165
  if (highlightedIndex !== DEFAULT_HIGHLIGHTED_INDEX) {
@@ -161,13 +170,14 @@ export var useSuggestionList = function (_a) {
161
170
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
162
171
  }
163
172
  else {
164
- selectItemFn(e, currOption);
173
+ selectItem(e, currOption);
165
174
  }
166
175
  e.stopPropagation();
167
176
  }
168
177
  // always preventDefault for not inset all enter into textarea
169
178
  e.preventDefault();
170
179
  break;
180
+ }
171
181
  default:
172
182
  onKeyFocusedIndexHandle(e);
173
183
  break;
@@ -181,57 +191,65 @@ export var useSuggestionList = function (_a) {
181
191
  onContainerClick: focusInput,
182
192
  role: 'combobox',
183
193
  'aria-autocomplete': 'list',
184
- // TODO
185
194
  'aria-expanded': true,
186
195
  'aria-haspopup': true,
187
- 'aria-owns': suggestionListId + "-menu",
196
+ 'aria-owns': currUniqueId + "-menu",
188
197
  'aria-activedescendant': highlightedIndexRef.current > -1
189
- ? suggestionListId + "-option-" + highlightedIndexRef.current
198
+ ? currUniqueId + "-option-" + highlightedIndexRef.current
190
199
  : undefined,
191
200
  }, props);
192
201
  };
193
202
  var getLabelProps = function (props) {
194
203
  return combineProps({
195
- htmlFor: suggestionListId + "-input",
196
- id: suggestionListId + "-label",
204
+ htmlFor: currUniqueId + "-input",
205
+ id: currUniqueId + "-label",
197
206
  }, props);
198
207
  };
199
208
  var getMenuProps = function (restMenuProps) {
200
209
  return combineProps({
201
- 'aria-labelledby': suggestionListId + "-label",
202
- id: suggestionListId + "-menu",
210
+ 'aria-labelledby': currUniqueId + "-label",
211
+ id: currUniqueId + "-menu",
203
212
  role: 'listbox',
204
213
  }, restMenuProps);
205
214
  };
206
215
  var getClearButtonProps = function (props) {
207
216
  return combineProps({
208
- id: suggestionListId + "-clear-button",
217
+ id: currUniqueId + "-clear-button",
209
218
  onClick: function (e) {
210
219
  onClear === null || onClear === void 0 ? void 0 : onClear(e);
211
220
  reset(true);
212
221
  },
213
222
  }, props);
214
223
  };
215
- var resultObj = {
224
+ useEffect(function () {
225
+ changeHighlightedIndexReasonRef.current = undefined;
226
+ });
227
+ return {
228
+ reset: reset,
229
+ clearInput: clearInput,
230
+ forceUpdate: forceUpdate,
216
231
  focusInput: focusInput,
232
+ updateInputValue: updateInputValue,
233
+ selectItem: selectItem,
234
+ onKeyFocusedIndexHandle: onKeyFocusedIndexHandle,
217
235
  getClearButtonProps: getClearButtonProps,
218
236
  getLabelProps: getLabelProps,
219
237
  getMenuProps: getMenuProps,
220
238
  getInputProps: getInputProps,
221
239
  getInputAriaProps: getInputAriaProps,
222
240
  getItemProps: getItemProps,
241
+ highlightedIndexRef: highlightedIndexRef,
223
242
  highlightedIndex: highlightedIndexRef.current,
224
243
  optionItems: optionItems,
225
244
  inputValue: inputValue,
226
245
  onInputChange: handleInputChange,
227
246
  setHighlightedIndex: setHighlightedIndex,
228
- changeHighlightedIndexReason: changeHighlightedIndexReason.current,
229
- reset: reset,
230
- forceUpdate: forceUpdate,
247
+ changeHighlightedIndexReasonRef: changeHighlightedIndexReasonRef,
248
+ changeHighlightedIndexReason: changeHighlightedIndexReasonRef.current,
231
249
  optionsGroupList: optionsGroupList,
232
- /** current suggestion list id */
233
- id: suggestionListId,
250
+ /** current unique id */
251
+ id: currUniqueId,
252
+ getNextFocusableOption: getNextFocusableOption,
253
+ handleF10KeyDown: handleF10KeyDown,
234
254
  };
235
- changeHighlightedIndexReason.current = undefined;
236
- return resultObj;
237
255
  };
@@ -38,3 +38,8 @@ export var RcAutocompleteDefaultFilterOptions = function (options, _a) {
38
38
  }
39
39
  return options.filter(function (item) { return getOptionLabel === null || getOptionLabel === void 0 ? void 0 : getOptionLabel(item).toLowerCase().startsWith((inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()) || ''); });
40
40
  };
41
+ export var downshiftComponentName = 'RcDownshift';
42
+ export function stringArrToRegExp(keyToTags) {
43
+ // eslint-disable-next-line security/detect-non-literal-regexp
44
+ return new RegExp((keyToTags === null || keyToTags === void 0 ? void 0 : keyToTags.join('|')) || '', 'g');
45
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './DownshiftUtils';
2
2
  export * from './useDownshift';
3
3
  export * from './useDownshiftError';
4
+ export * from './useDownshiftGroup';
5
+ export * from './useDownshiftTag';