@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.
- package/components/Dialog/Dialog.js +3 -1
- package/components/Downshift/Downshift.d.ts +1 -1
- package/components/Downshift/Downshift.js +1 -2
- package/components/Downshift/SuggestionList/SuggestionList.js +4 -5
- package/components/Downshift/SuggestionList/utils/useSuggestionList.d.ts +20 -7
- package/components/Downshift/SuggestionList/utils/useSuggestionList.js +88 -70
- package/components/Downshift/utils/DownshiftUtils.d.ts +2 -0
- package/components/Downshift/utils/DownshiftUtils.js +6 -0
- package/components/Downshift/utils/SelectItem.d.ts +3 -1
- package/components/Downshift/utils/index.d.ts +2 -0
- package/components/Downshift/utils/index.js +2 -0
- package/components/Downshift/utils/useDownshift.d.ts +13 -272
- package/components/Downshift/utils/useDownshift.js +132 -429
- package/components/Downshift/utils/useDownshiftGroup.js +1 -0
- package/components/Downshift/utils/useDownshiftTag.d.ts +554 -0
- package/components/Downshift/utils/useDownshiftTag.js +229 -0
- package/components/Forms/TextField/styles/OutlineTextFieldStyle.js +2 -2
- package/components/Forms/TextField/utils/OutlineTextFieldUtils.d.ts +1 -0
- package/components/Forms/TextField/utils/OutlineTextFieldUtils.js +3 -0
- package/components/Forms/Textarea/Textarea.d.ts +2 -2
- package/components/Icon/assets/icon-0.svg +2 -2
- package/components/Icon/assets/icon-2.svg +2 -2
- package/components/Icon/assets/icon-3.svg +2 -2
- package/components/Icon/assets/icon-4.svg +2 -2
- package/components/Icon/assets/icon-5.svg +2 -2
- package/components/Icon/assets/icon-6.svg +2 -2
- package/components/Icon/assets/icon-7.svg +2 -2
- package/components/Icon/assets/icon-8.svg +2 -2
- package/components/Icon/assets/icon-9.svg +2 -2
- package/components/Icon/assets/icon-Announcement.svg +8 -0
- package/components/Icon/assets/icon-Call-queue.svg +14 -0
- package/components/Icon/assets/icon-Limited.svg +7 -0
- package/components/Icon/assets/icon-Message.svg +6 -0
- package/components/Icon/assets/icon-Paging.svg +6 -0
- package/components/Icon/assets/icon-Shared-line.svg +8 -0
- package/components/Icon/assets/icon-avatar_rooms.svg +5 -0
- package/components/Icon/assets/icon-box.svg +1 -1
- package/components/Icon/assets/icon-box1.svg +5 -0
- package/components/Icon/assets/icon-default-file-D.svg +3 -3
- package/components/Icon/assets/icon-default-file.svg +4 -4
- package/components/Icon/assets/icon-default-gdrive-D.svg +4 -4
- package/components/Icon/assets/icon-default-gdrive.svg +5 -5
- package/components/Icon/assets/icon-default-music-D.svg +3 -3
- package/components/Icon/assets/icon-default-music.svg +3 -3
- package/components/Icon/assets/icon-default-video-D.svg +3 -3
- package/components/Icon/assets/icon-default-video.svg +3 -3
- package/components/Icon/assets/icon-deleted_file.svg +2 -2
- package/components/Icon/assets/icon-deleted_file_D.svg +2 -2
- package/components/Icon/assets/icon-doc-D.svg +3 -3
- package/components/Icon/assets/icon-doc.svg +3 -3
- package/components/Icon/assets/icon-end--answer.svg +2 -2
- package/components/Icon/assets/icon-excel-D.svg +3 -3
- package/components/Icon/assets/icon-excel.svg +3 -3
- package/components/Icon/assets/icon-font-color.svg +2 -2
- package/components/Icon/assets/icon-gdrive-logo.svg +6 -6
- package/components/Icon/assets/icon-gif-file-D.svg +3 -3
- package/components/Icon/assets/icon-gif-file.svg +4 -4
- package/components/Icon/assets/icon-gmail.svg +5 -5
- package/components/Icon/assets/icon-google-calendar-2019.svg +6 -6
- package/components/Icon/assets/icon-google-doc-D.svg +3 -3
- package/components/Icon/assets/icon-google-doc.svg +3 -3
- package/components/Icon/assets/icon-google-logo.svg +4 -4
- package/components/Icon/assets/icon-google-sheet-D.svg +3 -3
- package/components/Icon/assets/icon-google-sheet.svg +3 -3
- package/components/Icon/assets/icon-google-slide-D.svg +3 -3
- package/components/Icon/assets/icon-google-slide.svg +3 -3
- package/components/Icon/assets/icon-hold-answer.svg +2 -2
- package/components/Icon/assets/icon-image-broken-D.svg +3 -3
- package/components/Icon/assets/icon-image-broken.svg +4 -4
- package/components/Icon/assets/icon-image-preview-D.svg +3 -3
- package/components/Icon/assets/icon-image-preview.svg +3 -3
- package/components/Icon/assets/icon-item-list-selected.svg +1 -1
- package/components/Icon/assets/icon-mac-keynote-D.svg +3 -3
- package/components/Icon/assets/icon-mac-keynote.svg +6 -6
- package/components/Icon/assets/icon-mac-numbers-D.svg +3 -3
- package/components/Icon/assets/icon-mac-numbers.svg +3 -3
- package/components/Icon/assets/icon-mac-pages-D.svg +3 -3
- package/components/Icon/assets/icon-mac-pages.svg +3 -3
- package/components/Icon/assets/icon-marker_m.svg +2 -2
- package/components/Icon/assets/icon-marker_s.svg +2 -2
- package/components/Icon/assets/icon-microsoft-logo.svg +4 -4
- package/components/Icon/assets/icon-microsoft-outlook-2019.svg +15 -15
- package/components/Icon/assets/icon-mobile.svg +5 -0
- package/components/Icon/assets/icon-no-connection.svg +2 -2
- package/components/Icon/assets/icon-pdf-D.svg +3 -3
- package/components/Icon/assets/icon-pdf.svg +3 -3
- package/components/Icon/assets/icon-poor-connection.svg +2 -2
- package/components/Icon/assets/icon-ppt-D.svg +3 -3
- package/components/Icon/assets/icon-ppt.svg +3 -3
- package/components/Icon/assets/icon-rc_contact.svg +1 -1
- package/components/Icon/assets/icon-rcv_mic-off.svg +2 -2
- package/components/Icon/assets/icon-rcv_videocam-off.svg +2 -2
- package/components/Icon/assets/icon-sort.svg +2 -2
- package/components/Icon/assets/icon-stop-record.svg +1 -1
- package/components/Icon/assets/icon-weak-connection.svg +2 -2
- package/components/Icon/assets/icon-zip-D.svg +3 -3
- package/components/Icon/assets/icon-zip.svg +3 -3
- package/components/Icon/icon-symbol.d.ts +1 -1
- package/components/Icon/icon-symbol.js +1 -1
- package/es6/components/Dialog/Dialog.js +3 -1
- package/es6/components/Downshift/Downshift.js +1 -2
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +4 -5
- package/es6/components/Downshift/SuggestionList/utils/useSuggestionList.js +90 -72
- package/es6/components/Downshift/utils/DownshiftUtils.js +5 -0
- package/es6/components/Downshift/utils/index.js +2 -0
- package/es6/components/Downshift/utils/useDownshift.js +135 -432
- package/es6/components/Downshift/utils/useDownshiftGroup.js +1 -0
- package/es6/components/Downshift/utils/useDownshiftTag.js +227 -0
- package/es6/components/Forms/TextField/styles/OutlineTextFieldStyle.js +2 -2
- package/es6/components/Forms/TextField/utils/OutlineTextFieldUtils.js +3 -0
- package/es6/components/Icon/assets/icon-0.svg +2 -2
- package/es6/components/Icon/assets/icon-2.svg +2 -2
- package/es6/components/Icon/assets/icon-3.svg +2 -2
- package/es6/components/Icon/assets/icon-4.svg +2 -2
- package/es6/components/Icon/assets/icon-5.svg +2 -2
- package/es6/components/Icon/assets/icon-6.svg +2 -2
- package/es6/components/Icon/assets/icon-7.svg +2 -2
- package/es6/components/Icon/assets/icon-8.svg +2 -2
- package/es6/components/Icon/assets/icon-9.svg +2 -2
- package/es6/components/Icon/assets/icon-Announcement.svg +8 -0
- package/es6/components/Icon/assets/icon-Call-queue.svg +14 -0
- package/es6/components/Icon/assets/icon-Limited.svg +7 -0
- package/es6/components/Icon/assets/icon-Message.svg +6 -0
- package/es6/components/Icon/assets/icon-Paging.svg +6 -0
- package/es6/components/Icon/assets/icon-Shared-line.svg +8 -0
- package/es6/components/Icon/assets/icon-avatar_rooms.svg +5 -0
- package/es6/components/Icon/assets/icon-box.svg +1 -1
- package/es6/components/Icon/assets/icon-box1.svg +5 -0
- package/es6/components/Icon/assets/icon-default-file-D.svg +3 -3
- package/es6/components/Icon/assets/icon-default-file.svg +4 -4
- package/es6/components/Icon/assets/icon-default-gdrive-D.svg +4 -4
- package/es6/components/Icon/assets/icon-default-gdrive.svg +5 -5
- package/es6/components/Icon/assets/icon-default-music-D.svg +3 -3
- package/es6/components/Icon/assets/icon-default-music.svg +3 -3
- package/es6/components/Icon/assets/icon-default-video-D.svg +3 -3
- package/es6/components/Icon/assets/icon-default-video.svg +3 -3
- package/es6/components/Icon/assets/icon-deleted_file.svg +2 -2
- package/es6/components/Icon/assets/icon-deleted_file_D.svg +2 -2
- package/es6/components/Icon/assets/icon-doc-D.svg +3 -3
- package/es6/components/Icon/assets/icon-doc.svg +3 -3
- package/es6/components/Icon/assets/icon-end--answer.svg +2 -2
- package/es6/components/Icon/assets/icon-excel-D.svg +3 -3
- package/es6/components/Icon/assets/icon-excel.svg +3 -3
- package/es6/components/Icon/assets/icon-font-color.svg +2 -2
- package/es6/components/Icon/assets/icon-gdrive-logo.svg +6 -6
- package/es6/components/Icon/assets/icon-gif-file-D.svg +3 -3
- package/es6/components/Icon/assets/icon-gif-file.svg +4 -4
- package/es6/components/Icon/assets/icon-gmail.svg +5 -5
- package/es6/components/Icon/assets/icon-google-calendar-2019.svg +6 -6
- package/es6/components/Icon/assets/icon-google-doc-D.svg +3 -3
- package/es6/components/Icon/assets/icon-google-doc.svg +3 -3
- package/es6/components/Icon/assets/icon-google-logo.svg +4 -4
- package/es6/components/Icon/assets/icon-google-sheet-D.svg +3 -3
- package/es6/components/Icon/assets/icon-google-sheet.svg +3 -3
- package/es6/components/Icon/assets/icon-google-slide-D.svg +3 -3
- package/es6/components/Icon/assets/icon-google-slide.svg +3 -3
- package/es6/components/Icon/assets/icon-hold-answer.svg +2 -2
- package/es6/components/Icon/assets/icon-image-broken-D.svg +3 -3
- package/es6/components/Icon/assets/icon-image-broken.svg +4 -4
- package/es6/components/Icon/assets/icon-image-preview-D.svg +3 -3
- package/es6/components/Icon/assets/icon-image-preview.svg +3 -3
- package/es6/components/Icon/assets/icon-item-list-selected.svg +1 -1
- package/es6/components/Icon/assets/icon-mac-keynote-D.svg +3 -3
- package/es6/components/Icon/assets/icon-mac-keynote.svg +6 -6
- package/es6/components/Icon/assets/icon-mac-numbers-D.svg +3 -3
- package/es6/components/Icon/assets/icon-mac-numbers.svg +3 -3
- package/es6/components/Icon/assets/icon-mac-pages-D.svg +3 -3
- package/es6/components/Icon/assets/icon-mac-pages.svg +3 -3
- package/es6/components/Icon/assets/icon-marker_m.svg +2 -2
- package/es6/components/Icon/assets/icon-marker_s.svg +2 -2
- package/es6/components/Icon/assets/icon-microsoft-logo.svg +4 -4
- package/es6/components/Icon/assets/icon-microsoft-outlook-2019.svg +15 -15
- package/es6/components/Icon/assets/icon-mobile.svg +5 -0
- package/es6/components/Icon/assets/icon-no-connection.svg +2 -2
- package/es6/components/Icon/assets/icon-pdf-D.svg +3 -3
- package/es6/components/Icon/assets/icon-pdf.svg +3 -3
- package/es6/components/Icon/assets/icon-poor-connection.svg +2 -2
- package/es6/components/Icon/assets/icon-ppt-D.svg +3 -3
- package/es6/components/Icon/assets/icon-ppt.svg +3 -3
- package/es6/components/Icon/assets/icon-rc_contact.svg +1 -1
- package/es6/components/Icon/assets/icon-rcv_mic-off.svg +2 -2
- package/es6/components/Icon/assets/icon-rcv_videocam-off.svg +2 -2
- package/es6/components/Icon/assets/icon-sort.svg +2 -2
- package/es6/components/Icon/assets/icon-stop-record.svg +1 -1
- package/es6/components/Icon/assets/icon-weak-connection.svg +2 -2
- package/es6/components/Icon/assets/icon-zip-D.svg +3 -3
- package/es6/components/Icon/assets/icon-zip.svg +3 -3
- package/es6/components/Icon/icon-symbol.js +1 -1
- package/es6/foundation/hooks/useRefState/useRefState.js +6 -1
- package/es6/foundation/theme/ThemeProvider.js +22 -6
- package/es6/icon/0.js +2 -2
- package/es6/icon/2.js +2 -2
- package/es6/icon/3.js +2 -2
- package/es6/icon/4.js +2 -2
- package/es6/icon/5.js +2 -2
- package/es6/icon/6.js +2 -2
- package/es6/icon/7.js +2 -2
- package/es6/icon/8.js +2 -2
- package/es6/icon/9.js +2 -2
- package/es6/icon/Announcement.js +8 -0
- package/es6/icon/AvatarRooms.js +7 -0
- package/es6/icon/Box.js +1 -1
- package/es6/icon/Box1.js +7 -0
- package/es6/icon/CallQueue.js +14 -0
- package/es6/icon/DefaultFile.js +4 -4
- package/es6/icon/DefaultFileD.js +3 -3
- package/es6/icon/DefaultGdrive.js +5 -5
- package/es6/icon/DefaultGdriveD.js +4 -4
- package/es6/icon/DefaultMusic.js +3 -3
- package/es6/icon/DefaultMusicD.js +3 -3
- package/es6/icon/DefaultVideo.js +3 -3
- package/es6/icon/DefaultVideoD.js +3 -3
- package/es6/icon/DeletedFile.js +2 -2
- package/es6/icon/DeletedFileD.js +2 -2
- package/es6/icon/Doc.js +3 -3
- package/es6/icon/DocD.js +3 -3
- package/es6/icon/EndAnswer.js +2 -2
- package/es6/icon/Excel.js +3 -3
- package/es6/icon/ExcelD.js +3 -3
- package/es6/icon/FontColor.js +2 -2
- package/es6/icon/GdriveLogo.js +6 -6
- package/es6/icon/GifFile.js +4 -4
- package/es6/icon/GifFileD.js +3 -3
- package/es6/icon/Gmail.js +5 -5
- package/es6/icon/GoogleCalendar2019.js +6 -6
- package/es6/icon/GoogleDoc.js +3 -3
- package/es6/icon/GoogleDocD.js +3 -3
- package/es6/icon/GoogleLogo.js +4 -4
- package/es6/icon/GoogleSheet.js +3 -3
- package/es6/icon/GoogleSheetD.js +3 -3
- package/es6/icon/GoogleSlide.js +3 -3
- package/es6/icon/GoogleSlideD.js +3 -3
- package/es6/icon/HoldAnswer.js +2 -2
- package/es6/icon/ImageBroken.js +4 -4
- package/es6/icon/ImageBrokenD.js +3 -3
- package/es6/icon/ImagePreview.js +3 -3
- package/es6/icon/ImagePreviewD.js +3 -3
- package/es6/icon/ItemListSelected.js +1 -1
- package/es6/icon/Limited.js +8 -0
- package/es6/icon/MacKeynote.js +4 -4
- package/es6/icon/MacKeynoteD.js +3 -3
- package/es6/icon/MacNumbers.js +3 -3
- package/es6/icon/MacNumbersD.js +3 -3
- package/es6/icon/MacPages.js +3 -3
- package/es6/icon/MacPagesD.js +3 -3
- package/es6/icon/MarkerM.js +2 -2
- package/es6/icon/MarkerS.js +2 -2
- package/es6/icon/Message.js +8 -0
- package/es6/icon/MicrosoftLogo.js +4 -4
- package/es6/icon/MicrosoftOutlook2019.js +15 -15
- package/es6/icon/Mobile.js +7 -0
- package/es6/icon/NoConnection.js +2 -2
- package/es6/icon/Paging.js +8 -0
- package/es6/icon/Pdf.js +3 -3
- package/es6/icon/PdfD.js +3 -3
- package/es6/icon/PoorConnection.js +2 -2
- package/es6/icon/Ppt.js +3 -3
- package/es6/icon/PptD.js +3 -3
- package/es6/icon/RcContact.js +1 -1
- package/es6/icon/RcvMicOff.js +2 -2
- package/es6/icon/RcvVideocamOff.js +2 -2
- package/es6/icon/SharedLine.js +9 -0
- package/es6/icon/Sort.js +2 -2
- package/es6/icon/StopRecord.js +1 -1
- package/es6/icon/WeakConnection.js +2 -2
- package/es6/icon/Zip.js +3 -3
- package/es6/icon/ZipD.js +3 -3
- package/es6/icon/index.js +10 -1
- package/es6/icons/icon-0.svg +2 -2
- package/es6/icons/icon-2.svg +2 -2
- package/es6/icons/icon-3.svg +2 -2
- package/es6/icons/icon-4.svg +2 -2
- package/es6/icons/icon-5.svg +2 -2
- package/es6/icons/icon-6.svg +2 -2
- package/es6/icons/icon-7.svg +2 -2
- package/es6/icons/icon-8.svg +2 -2
- package/es6/icons/icon-9.svg +2 -2
- package/es6/icons/icon-Announcement.svg +8 -0
- package/es6/icons/icon-Call-queue.svg +14 -0
- package/es6/icons/icon-Limited.svg +7 -0
- package/es6/icons/icon-Message.svg +6 -0
- package/es6/icons/icon-Paging.svg +6 -0
- package/es6/icons/icon-Shared-line.svg +8 -0
- package/es6/icons/icon-avatar_rooms.svg +5 -0
- package/es6/icons/icon-box.svg +1 -1
- package/es6/icons/icon-box1.svg +5 -0
- package/es6/icons/icon-default-file-D.svg +3 -3
- package/es6/icons/icon-default-file.svg +4 -4
- package/es6/icons/icon-default-gdrive-D.svg +4 -4
- package/es6/icons/icon-default-gdrive.svg +5 -5
- package/es6/icons/icon-default-music-D.svg +3 -3
- package/es6/icons/icon-default-music.svg +3 -3
- package/es6/icons/icon-default-video-D.svg +3 -3
- package/es6/icons/icon-default-video.svg +3 -3
- package/es6/icons/icon-deleted_file.svg +2 -2
- package/es6/icons/icon-deleted_file_D.svg +2 -2
- package/es6/icons/icon-doc-D.svg +3 -3
- package/es6/icons/icon-doc.svg +3 -3
- package/es6/icons/icon-end--answer.svg +2 -2
- package/es6/icons/icon-excel-D.svg +3 -3
- package/es6/icons/icon-excel.svg +3 -3
- package/es6/icons/icon-font-color.svg +2 -2
- package/es6/icons/icon-gdrive-logo.svg +6 -6
- package/es6/icons/icon-gif-file-D.svg +3 -3
- package/es6/icons/icon-gif-file.svg +4 -4
- package/es6/icons/icon-gmail.svg +5 -5
- package/es6/icons/icon-google-calendar-2019.svg +6 -6
- package/es6/icons/icon-google-doc-D.svg +3 -3
- package/es6/icons/icon-google-doc.svg +3 -3
- package/es6/icons/icon-google-logo.svg +4 -4
- package/es6/icons/icon-google-sheet-D.svg +3 -3
- package/es6/icons/icon-google-sheet.svg +3 -3
- package/es6/icons/icon-google-slide-D.svg +3 -3
- package/es6/icons/icon-google-slide.svg +3 -3
- package/es6/icons/icon-hold-answer.svg +2 -2
- package/es6/icons/icon-image-broken-D.svg +3 -3
- package/es6/icons/icon-image-broken.svg +4 -4
- package/es6/icons/icon-image-preview-D.svg +3 -3
- package/es6/icons/icon-image-preview.svg +3 -3
- package/es6/icons/icon-item-list-selected.svg +1 -1
- package/es6/icons/icon-mac-keynote-D.svg +3 -3
- package/es6/icons/icon-mac-keynote.svg +6 -6
- package/es6/icons/icon-mac-numbers-D.svg +3 -3
- package/es6/icons/icon-mac-numbers.svg +3 -3
- package/es6/icons/icon-mac-pages-D.svg +3 -3
- package/es6/icons/icon-mac-pages.svg +3 -3
- package/es6/icons/icon-marker_m.svg +2 -2
- package/es6/icons/icon-marker_s.svg +2 -2
- package/es6/icons/icon-microsoft-logo.svg +4 -4
- package/es6/icons/icon-microsoft-outlook-2019.svg +15 -15
- package/es6/icons/icon-mobile.svg +5 -0
- package/es6/icons/icon-no-connection.svg +2 -2
- package/es6/icons/icon-pdf-D.svg +3 -3
- package/es6/icons/icon-pdf.svg +3 -3
- package/es6/icons/icon-poor-connection.svg +2 -2
- package/es6/icons/icon-ppt-D.svg +3 -3
- package/es6/icons/icon-ppt.svg +3 -3
- package/es6/icons/icon-rc_contact.svg +1 -1
- package/es6/icons/icon-rcv_mic-off.svg +2 -2
- package/es6/icons/icon-rcv_videocam-off.svg +2 -2
- package/es6/icons/icon-sort.svg +2 -2
- package/es6/icons/icon-stop-record.svg +1 -1
- package/es6/icons/icon-weak-connection.svg +2 -2
- package/es6/icons/icon-zip-D.svg +3 -3
- package/es6/icons/icon-zip.svg +3 -3
- package/foundation/hooks/useRefState/useRefState.js +6 -1
- package/foundation/theme/ThemeProvider.d.ts +11 -11
- package/foundation/theme/ThemeProvider.js +22 -6
- package/icon/0.js +2 -2
- package/icon/2.js +2 -2
- package/icon/3.js +2 -2
- package/icon/4.js +2 -2
- package/icon/5.js +2 -2
- package/icon/6.js +2 -2
- package/icon/7.js +2 -2
- package/icon/8.js +2 -2
- package/icon/9.js +2 -2
- package/icon/Announcement.d.ts +3 -0
- package/icon/Announcement.js +10 -0
- package/icon/AvatarRooms.d.ts +3 -0
- package/icon/AvatarRooms.js +9 -0
- package/icon/Box.js +1 -1
- package/icon/Box1.d.ts +3 -0
- package/icon/Box1.js +9 -0
- package/icon/CallQueue.d.ts +3 -0
- package/icon/CallQueue.js +16 -0
- package/icon/DefaultFile.js +4 -4
- package/icon/DefaultFileD.js +3 -3
- package/icon/DefaultGdrive.js +5 -5
- package/icon/DefaultGdriveD.js +4 -4
- package/icon/DefaultMusic.js +3 -3
- package/icon/DefaultMusicD.js +3 -3
- package/icon/DefaultVideo.js +3 -3
- package/icon/DefaultVideoD.js +3 -3
- package/icon/DeletedFile.js +2 -2
- package/icon/DeletedFileD.js +2 -2
- package/icon/Doc.js +3 -3
- package/icon/DocD.js +3 -3
- package/icon/EndAnswer.js +2 -2
- package/icon/Excel.js +3 -3
- package/icon/ExcelD.js +3 -3
- package/icon/FontColor.js +2 -2
- package/icon/GdriveLogo.js +6 -6
- package/icon/GifFile.js +4 -4
- package/icon/GifFileD.js +3 -3
- package/icon/Gmail.js +5 -5
- package/icon/GoogleCalendar2019.js +6 -6
- package/icon/GoogleDoc.js +3 -3
- package/icon/GoogleDocD.js +3 -3
- package/icon/GoogleLogo.js +4 -4
- package/icon/GoogleSheet.js +3 -3
- package/icon/GoogleSheetD.js +3 -3
- package/icon/GoogleSlide.js +3 -3
- package/icon/GoogleSlideD.js +3 -3
- package/icon/HoldAnswer.js +2 -2
- package/icon/ImageBroken.js +4 -4
- package/icon/ImageBrokenD.js +3 -3
- package/icon/ImagePreview.js +3 -3
- package/icon/ImagePreviewD.js +3 -3
- package/icon/ItemListSelected.js +1 -1
- package/icon/Limited.d.ts +3 -0
- package/icon/Limited.js +10 -0
- package/icon/MacKeynote.js +4 -4
- package/icon/MacKeynoteD.js +3 -3
- package/icon/MacNumbers.js +3 -3
- package/icon/MacNumbersD.js +3 -3
- package/icon/MacPages.js +3 -3
- package/icon/MacPagesD.js +3 -3
- package/icon/MarkerM.js +2 -2
- package/icon/MarkerS.js +2 -2
- package/icon/Message.d.ts +3 -0
- package/icon/Message.js +10 -0
- package/icon/MicrosoftLogo.js +4 -4
- package/icon/MicrosoftOutlook2019.js +15 -15
- package/icon/Mobile.d.ts +3 -0
- package/icon/Mobile.js +9 -0
- package/icon/NoConnection.js +2 -2
- package/icon/Paging.d.ts +3 -0
- package/icon/Paging.js +10 -0
- package/icon/Pdf.js +3 -3
- package/icon/PdfD.js +3 -3
- package/icon/PoorConnection.js +2 -2
- package/icon/Ppt.js +3 -3
- package/icon/PptD.js +3 -3
- package/icon/RcContact.js +1 -1
- package/icon/RcvMicOff.js +2 -2
- package/icon/RcvVideocamOff.js +2 -2
- package/icon/SharedLine.d.ts +3 -0
- package/icon/SharedLine.js +11 -0
- package/icon/Sort.js +2 -2
- package/icon/StopRecord.js +1 -1
- package/icon/WeakConnection.js +2 -2
- package/icon/Zip.js +3 -3
- package/icon/ZipD.js +3 -3
- package/icon/index.d.ts +10 -1
- package/icon/index.js +20 -2
- package/icons/icon-0.svg +2 -2
- package/icons/icon-2.svg +2 -2
- package/icons/icon-3.svg +2 -2
- package/icons/icon-4.svg +2 -2
- package/icons/icon-5.svg +2 -2
- package/icons/icon-6.svg +2 -2
- package/icons/icon-7.svg +2 -2
- package/icons/icon-8.svg +2 -2
- package/icons/icon-9.svg +2 -2
- package/icons/icon-Announcement.svg +8 -0
- package/icons/icon-Call-queue.svg +14 -0
- package/icons/icon-Limited.svg +7 -0
- package/icons/icon-Message.svg +6 -0
- package/icons/icon-Paging.svg +6 -0
- package/icons/icon-Shared-line.svg +8 -0
- package/icons/icon-avatar_rooms.svg +5 -0
- package/icons/icon-box.svg +1 -1
- package/icons/icon-box1.svg +5 -0
- package/icons/icon-default-file-D.svg +3 -3
- package/icons/icon-default-file.svg +4 -4
- package/icons/icon-default-gdrive-D.svg +4 -4
- package/icons/icon-default-gdrive.svg +5 -5
- package/icons/icon-default-music-D.svg +3 -3
- package/icons/icon-default-music.svg +3 -3
- package/icons/icon-default-video-D.svg +3 -3
- package/icons/icon-default-video.svg +3 -3
- package/icons/icon-deleted_file.svg +2 -2
- package/icons/icon-deleted_file_D.svg +2 -2
- package/icons/icon-doc-D.svg +3 -3
- package/icons/icon-doc.svg +3 -3
- package/icons/icon-end--answer.svg +2 -2
- package/icons/icon-excel-D.svg +3 -3
- package/icons/icon-excel.svg +3 -3
- package/icons/icon-font-color.svg +2 -2
- package/icons/icon-gdrive-logo.svg +6 -6
- package/icons/icon-gif-file-D.svg +3 -3
- package/icons/icon-gif-file.svg +4 -4
- package/icons/icon-gmail.svg +5 -5
- package/icons/icon-google-calendar-2019.svg +6 -6
- package/icons/icon-google-doc-D.svg +3 -3
- package/icons/icon-google-doc.svg +3 -3
- package/icons/icon-google-logo.svg +4 -4
- package/icons/icon-google-sheet-D.svg +3 -3
- package/icons/icon-google-sheet.svg +3 -3
- package/icons/icon-google-slide-D.svg +3 -3
- package/icons/icon-google-slide.svg +3 -3
- package/icons/icon-hold-answer.svg +2 -2
- package/icons/icon-image-broken-D.svg +3 -3
- package/icons/icon-image-broken.svg +4 -4
- package/icons/icon-image-preview-D.svg +3 -3
- package/icons/icon-image-preview.svg +3 -3
- package/icons/icon-item-list-selected.svg +1 -1
- package/icons/icon-mac-keynote-D.svg +3 -3
- package/icons/icon-mac-keynote.svg +6 -6
- package/icons/icon-mac-numbers-D.svg +3 -3
- package/icons/icon-mac-numbers.svg +3 -3
- package/icons/icon-mac-pages-D.svg +3 -3
- package/icons/icon-mac-pages.svg +3 -3
- package/icons/icon-marker_m.svg +2 -2
- package/icons/icon-marker_s.svg +2 -2
- package/icons/icon-microsoft-logo.svg +4 -4
- package/icons/icon-microsoft-outlook-2019.svg +15 -15
- package/icons/icon-mobile.svg +5 -0
- package/icons/icon-no-connection.svg +2 -2
- package/icons/icon-pdf-D.svg +3 -3
- package/icons/icon-pdf.svg +3 -3
- package/icons/icon-poor-connection.svg +2 -2
- package/icons/icon-ppt-D.svg +3 -3
- package/icons/icon-ppt.svg +3 -3
- package/icons/icon-rc_contact.svg +1 -1
- package/icons/icon-rcv_mic-off.svg +2 -2
- package/icons/icon-rcv_videocam-off.svg +2 -2
- package/icons/icon-sort.svg +2 -2
- package/icons/icon-stop-record.svg +1 -1
- package/icons/icon-weak-connection.svg +2 -2
- package/icons/icon-zip-D.svg +3 -3
- package/icons/icon-zip.svg +3 -3
- 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({
|
|
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.
|
|
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
|
|
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
|
-
|
|
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 = !
|
|
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), {
|
|
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,
|
|
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
|
|
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
|
|
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
|
-
}, [
|
|
46
|
+
}, [getFilteredItems, inputValue, options, processFilteredResult]);
|
|
47
47
|
var _d = useDownshiftGroup({
|
|
48
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
93
|
+
clearInput();
|
|
94
94
|
onInputChangeProp === null || onInputChangeProp === void 0 ? void 0 : onInputChangeProp('');
|
|
95
95
|
if (isFocus)
|
|
96
96
|
focusInput();
|
|
97
97
|
};
|
|
98
|
-
var
|
|
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,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
125
|
-
|
|
123
|
+
}, onMouseOver: function () {
|
|
124
|
+
if (highlightedIndexRef.current !== index &&
|
|
125
|
+
getIsItemCanSelected(item)) {
|
|
126
126
|
setHighlightedIndex(index, { reason: 'mouse', reRender: true });
|
|
127
127
|
}
|
|
128
|
-
},
|
|
129
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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':
|
|
196
|
+
'aria-owns': currUniqueId + "-menu",
|
|
188
197
|
'aria-activedescendant': highlightedIndexRef.current > -1
|
|
189
|
-
?
|
|
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:
|
|
196
|
-
id:
|
|
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':
|
|
202
|
-
id:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
forceUpdate: forceUpdate,
|
|
247
|
+
changeHighlightedIndexReasonRef: changeHighlightedIndexReasonRef,
|
|
248
|
+
changeHighlightedIndexReason: changeHighlightedIndexReasonRef.current,
|
|
231
249
|
optionsGroupList: optionsGroupList,
|
|
232
|
-
/** current
|
|
233
|
-
id:
|
|
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
|
+
}
|