@rh-support/components 2.4.10-beta.6 → 2.5.1
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/README.md +2 -0
- package/lib/esm/AlertMessage/AlertMessage.d.ts +2 -2
- package/lib/esm/AlertMessage/AlertMessage.d.ts.map +1 -1
- package/lib/esm/AlertMessage/AlertMessage.js +1 -1
- package/lib/esm/ConfirmationModal/ConfirmationContext.d.ts +2 -1
- package/lib/esm/ConfirmationModal/ConfirmationContext.d.ts.map +1 -1
- package/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts +2 -1
- package/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts.map +1 -1
- package/lib/esm/CoverSpinner/CoverSpinner.d.ts +2 -1
- package/lib/esm/CoverSpinner/CoverSpinner.d.ts.map +1 -1
- package/lib/esm/CustomContentLoader/CustomContentLoader.d.ts +2 -2
- package/lib/esm/CustomContentLoader/CustomContentLoader.d.ts.map +1 -1
- package/lib/esm/CustomTextInput/CustomTextInput.d.ts +3 -1
- package/lib/esm/CustomTextInput/CustomTextInput.d.ts.map +1 -1
- package/lib/esm/CustomTextInput/CustomTextInput.js +4 -2
- package/lib/esm/DropDownList/AsyncDropDownList.d.ts +1 -1
- package/lib/esm/DropDownList/AsyncDropDownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropDownList.d.ts +2 -1
- package/lib/esm/DropDownList/DropDownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropDownList.js +10 -10
- package/lib/esm/DropDownList/DropdownWrapper.d.ts +1 -1
- package/lib/esm/DropDownList/DropdownWrapper.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropdownWrapper.js +2 -2
- package/lib/esm/DropDownList/MultiSelectDropdownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SearchableList.d.ts +1 -1
- package/lib/esm/DropDownList/SearchableList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SearchableList.js +6 -6
- package/lib/esm/DropDownList/SelectList.d.ts +1 -1
- package/lib/esm/DropDownList/SelectList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SelectList.js +6 -6
- package/lib/esm/DropDownList/async.d.ts +1 -1
- package/lib/esm/DropDownList/async.d.ts.map +1 -1
- package/lib/esm/DropDownList/dropdownList.css +10 -5
- package/lib/esm/DropDownList/types.d.ts +6 -7
- package/lib/esm/DropDownList/types.d.ts.map +1 -1
- package/lib/esm/DropDownList/withMulti.d.ts +1 -1
- package/lib/esm/DropDownList/withMulti.d.ts.map +1 -1
- package/lib/esm/DropDownList/withMulti.js +1 -0
- package/lib/esm/ErrorBoundary/ErrorBoundary.d.ts +2 -1
- package/lib/esm/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts +2 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.js +3 -4
- package/lib/esm/ErrorPages/Generic403.d.ts +2 -1
- package/lib/esm/ErrorPages/Generic403.d.ts.map +1 -1
- package/lib/esm/FeedbackForm/FeedbackForm.d.ts +2 -1
- package/lib/esm/FeedbackForm/FeedbackForm.d.ts.map +1 -1
- package/lib/esm/FeedbackForm/FeedbackForm.js +2 -2
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts +5 -4
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts.map +1 -1
- package/lib/esm/Functional/CaseContactsSelectorExternal.js +9 -8
- package/lib/esm/InlineEdit/InlineEdit.d.ts +2 -2
- package/lib/esm/InlineEdit/InlineEdit.d.ts.map +1 -1
- package/lib/esm/InlineEdit/InlineEdit.js +1 -1
- package/lib/esm/InlineEdit/NewInlineEdit.d.ts +2 -2
- package/lib/esm/InlineEdit/NewInlineEdit.d.ts.map +1 -1
- package/lib/esm/InlineEdit/NewInlineEdit.js +2 -2
- package/lib/esm/InlineEdit/inlineEdit.css +24 -1
- package/lib/esm/InlineEdit/newInlineEdit.css +5 -4
- package/lib/esm/LanguageSelector/LanguageSelector.d.ts +2 -1
- package/lib/esm/LanguageSelector/LanguageSelector.d.ts.map +1 -1
- package/lib/esm/LanguageSelector/LanguageSelector.js +13 -3
- package/lib/esm/LanguageSelector/languageSelector.css +1 -1
- package/lib/esm/LoadingDots/LoadingDots.d.ts +3 -1
- package/lib/esm/LoadingDots/LoadingDots.d.ts.map +1 -1
- package/lib/esm/LoadingDots/LoadingDots.js +2 -2
- package/lib/esm/LoadingIndicator/LoadingIndicator.d.ts +2 -1
- package/lib/esm/LoadingIndicator/LoadingIndicator.d.ts.map +1 -1
- package/lib/esm/LoginModal/LoginModal.d.ts +2 -1
- package/lib/esm/LoginModal/LoginModal.d.ts.map +1 -1
- package/lib/esm/LoginModal/LoginModal.js +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts +5 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.js +272 -86
- package/lib/esm/MarkdownEditor/markdownEditor.css +113 -5
- package/lib/esm/MoreOrLess/MoreOrLess.d.ts +1 -1
- package/lib/esm/MoreOrLess/MoreOrLess.d.ts.map +1 -1
- package/lib/esm/PaginatedList/PaginatedList.d.ts +2 -1
- package/lib/esm/PaginatedList/PaginatedList.d.ts.map +1 -1
- package/lib/esm/PaginatedList/PaginatedList.js +9 -0
- package/lib/esm/PaginationCompact/PaginationCompact.d.ts +2 -1
- package/lib/esm/PaginationCompact/PaginationCompact.d.ts.map +1 -1
- package/lib/esm/PaginationCompact/PaginationCompact.js +4 -4
- package/lib/esm/PaginationCompact/paginationCompact.css +1 -1
- package/lib/esm/PhoneInput/CountryData.d.ts.map +1 -1
- package/lib/esm/PhoneInput/CountryData.js +3 -2
- package/lib/esm/PhoneInput/FlagSvgs.d.ts +3 -0
- package/lib/esm/PhoneInput/FlagSvgs.d.ts.map +1 -0
- package/lib/esm/PhoneInput/FlagSvgs.js +2018 -0
- package/lib/esm/PhoneInput/PhoneInput.d.ts +14 -1
- package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/lib/esm/PhoneInput/PhoneInput.js +121 -120
- package/lib/esm/PhoneInput/PhoneInput.scss +15 -732
- package/lib/esm/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts +2 -1
- package/lib/esm/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts.map +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/Path.d.ts +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/Path.d.ts.map +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/types.d.ts +3 -4
- package/lib/esm/ProgressBar/CircularProgressBar/types.d.ts.map +1 -1
- package/lib/esm/ProgressBar/ProgressBar.d.ts +1 -1
- package/lib/esm/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/esm/PromisifyModal/PromisifyModal.d.ts +6 -9
- package/lib/esm/PromisifyModal/PromisifyModal.d.ts.map +1 -1
- package/lib/esm/PromisifyModal/PromisifyModal.js +21 -18
- package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.d.ts +2 -1
- package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.d.ts.map +1 -1
- package/lib/esm/SubscriptionAbuse/const.d.ts +2 -1
- package/lib/esm/SubscriptionAbuse/const.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackForm.d.ts +2 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackForm.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts +2 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.js +14 -14
- package/lib/esm/Table/PFTable.d.ts +4 -3
- package/lib/esm/Table/PFTable.d.ts.map +1 -1
- package/lib/esm/Table/PFTable.js +6 -6
- package/lib/{cjs/Table/Table.d.ts → esm/Table/TableComponent.d.ts} +2 -2
- package/lib/esm/Table/TableComponent.d.ts.map +1 -0
- package/lib/esm/Table/{Table.js → TableComponent.js} +1 -1
- package/lib/esm/Table/TablePagination.d.ts +2 -1
- package/lib/esm/Table/TablePagination.d.ts.map +1 -1
- package/lib/esm/Table/TablePagination.js +4 -2
- package/lib/esm/Table/index.d.ts +1 -2
- package/lib/esm/Table/index.d.ts.map +1 -1
- package/lib/esm/Table/index.js +1 -2
- package/lib/esm/TagsSelector/TagsSelector.d.ts +14 -0
- package/lib/esm/TagsSelector/TagsSelector.d.ts.map +1 -0
- package/lib/esm/TagsSelector/TagsSelector.js +74 -0
- package/lib/esm/TagsSelector/index.d.ts +2 -0
- package/lib/esm/TagsSelector/index.d.ts.map +1 -0
- package/lib/esm/TagsSelector/index.js +1 -0
- package/lib/esm/TagsSelector/tagSelector.css +15 -0
- package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts +2 -1
- package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
- package/lib/esm/TermsAndConditions/AcceptTermsModal.js +7 -6
- package/lib/esm/TextAreaAutosize/TextAreaAutosize.d.ts +1 -1
- package/lib/esm/TextAreaAutosize/TextAreaAutosize.d.ts.map +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.d.ts +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.d.ts.map +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.js +1 -1
- package/lib/esm/ToastNotification/ToastNotification.d.ts +1 -1
- package/lib/esm/ToastNotification/ToastNotification.d.ts.map +1 -1
- package/lib/esm/ToastNotification/ToastNotification.js +13 -5
- package/lib/esm/ToastNotification/toastNotification.css +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts +5 -1
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts.map +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.js +20 -23
- package/lib/esm/ValueChangedIcon/ValueChangedIcon.d.ts +1 -1
- package/lib/esm/ValueChangedIcon/ValueChangedIcon.d.ts.map +1 -1
- package/lib/esm/helperFunctions/errorMessage.js +2 -2
- package/lib/esm/helperFunctions/errorMessage.scss +1 -1
- package/lib/esm/hooks/index.d.ts +4 -0
- package/lib/esm/hooks/index.d.ts.map +1 -1
- package/lib/esm/hooks/index.js +4 -0
- package/lib/esm/hooks/useBreakpoint.d.ts +2 -2
- package/lib/esm/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/esm/hooks/useBreakpoint.js +2 -0
- package/lib/esm/hooks/useCopyToClipboard.d.ts.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js +1 -0
- package/lib/esm/hooks/useFetch.js +1 -2
- package/lib/esm/hooks/useLocalStorage.d.ts +2 -2
- package/lib/esm/hooks/useLocalStorage.d.ts.map +1 -1
- package/lib/esm/hooks/useSearchDocument.d.ts +7 -0
- package/lib/esm/hooks/useSearchDocument.d.ts.map +1 -0
- package/lib/esm/hooks/useSearchDocument.js +42 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts +13 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts.map +1 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.js +54 -0
- package/lib/esm/hooks/useSessionStorage.d.ts +5 -0
- package/lib/esm/hooks/useSessionStorage.d.ts.map +1 -0
- package/lib/esm/hooks/useSessionStorage.js +30 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -0
- package/package.json +40 -46
- package/lib/cjs/AlertMessage/AlertMessage.css +0 -9
- package/lib/cjs/AlertMessage/AlertMessage.d.ts +0 -24
- package/lib/cjs/AlertMessage/AlertMessage.d.ts.map +0 -1
- package/lib/cjs/AlertMessage/AlertMessage.js +0 -30
- package/lib/cjs/AlertMessage/index.d.ts +0 -2
- package/lib/cjs/AlertMessage/index.d.ts.map +0 -1
- package/lib/cjs/AlertMessage/index.js +0 -14
- package/lib/cjs/ConfirmationModal/ConfirmationContext.d.ts +0 -6
- package/lib/cjs/ConfirmationModal/ConfirmationContext.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationContext.js +0 -53
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.d.ts +0 -29
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.js +0 -28
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.js +0 -36
- package/lib/cjs/ConfirmationModal/index.d.ts +0 -3
- package/lib/cjs/ConfirmationModal/index.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/index.js +0 -14
- package/lib/cjs/CoverSpinner/CoverSpinner.css +0 -16
- package/lib/cjs/CoverSpinner/CoverSpinner.d.ts +0 -3
- package/lib/cjs/CoverSpinner/CoverSpinner.d.ts.map +0 -1
- package/lib/cjs/CoverSpinner/CoverSpinner.js +0 -13
- package/lib/cjs/CoverSpinner/index.d.ts +0 -2
- package/lib/cjs/CoverSpinner/index.d.ts.map +0 -1
- package/lib/cjs/CoverSpinner/index.js +0 -13
- package/lib/cjs/CustomContentLoader/CustomContentLoader.d.ts +0 -15
- package/lib/cjs/CustomContentLoader/CustomContentLoader.d.ts.map +0 -1
- package/lib/cjs/CustomContentLoader/CustomContentLoader.js +0 -62
- package/lib/cjs/CustomContentLoader/index.d.ts +0 -2
- package/lib/cjs/CustomContentLoader/index.d.ts.map +0 -1
- package/lib/cjs/CustomContentLoader/index.js +0 -13
- package/lib/cjs/CustomTextInput/CustomTextInput.d.ts +0 -12
- package/lib/cjs/CustomTextInput/CustomTextInput.d.ts.map +0 -1
- package/lib/cjs/CustomTextInput/CustomTextInput.js +0 -48
- package/lib/cjs/CustomTextInput/index.d.ts +0 -2
- package/lib/cjs/CustomTextInput/index.d.ts.map +0 -1
- package/lib/cjs/CustomTextInput/index.js +0 -13
- package/lib/cjs/DropDownList/AsyncDropDownList.d.ts +0 -6
- package/lib/cjs/DropDownList/AsyncDropDownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/AsyncDropDownList.js +0 -10
- package/lib/cjs/DropDownList/DropDownList.d.ts +0 -8
- package/lib/cjs/DropDownList/DropDownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/DropDownList.js +0 -141
- package/lib/cjs/DropDownList/DropdownWrapper.d.ts +0 -16
- package/lib/cjs/DropDownList/DropdownWrapper.d.ts.map +0 -1
- package/lib/cjs/DropDownList/DropdownWrapper.js +0 -25
- package/lib/cjs/DropDownList/MultiSelectDropdownList.d.ts +0 -4
- package/lib/cjs/DropDownList/MultiSelectDropdownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/MultiSelectDropdownList.js +0 -7
- package/lib/cjs/DropDownList/Readme.md +0 -114
- package/lib/cjs/DropDownList/SearchableList.d.ts +0 -14
- package/lib/cjs/DropDownList/SearchableList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/SearchableList.js +0 -104
- package/lib/cjs/DropDownList/SelectList.d.ts +0 -11
- package/lib/cjs/DropDownList/SelectList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/SelectList.js +0 -41
- package/lib/cjs/DropDownList/async.d.ts +0 -9
- package/lib/cjs/DropDownList/async.d.ts.map +0 -1
- package/lib/cjs/DropDownList/async.js +0 -138
- package/lib/cjs/DropDownList/dropdownList.css +0 -54
- package/lib/cjs/DropDownList/dropdownUtils.d.ts +0 -5
- package/lib/cjs/DropDownList/dropdownUtils.d.ts.map +0 -1
- package/lib/cjs/DropDownList/dropdownUtils.js +0 -29
- package/lib/cjs/DropDownList/index.d.ts +0 -4
- package/lib/cjs/DropDownList/index.d.ts.map +0 -1
- package/lib/cjs/DropDownList/index.js +0 -15
- package/lib/cjs/DropDownList/types.d.ts +0 -54
- package/lib/cjs/DropDownList/types.d.ts.map +0 -1
- package/lib/cjs/DropDownList/types.js +0 -2
- package/lib/cjs/DropDownList/withMulti.d.ts +0 -5
- package/lib/cjs/DropDownList/withMulti.d.ts.map +0 -1
- package/lib/cjs/DropDownList/withMulti.js +0 -69
- package/lib/cjs/ErrorBoundary/ErrorBoundary.d.ts +0 -36
- package/lib/cjs/ErrorBoundary/ErrorBoundary.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/ErrorBoundary.js +0 -62
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts +0 -14
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.js +0 -40
- package/lib/cjs/ErrorBoundary/index.d.ts +0 -2
- package/lib/cjs/ErrorBoundary/index.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/index.js +0 -13
- package/lib/cjs/ErrorPages/Generic403.d.ts +0 -2
- package/lib/cjs/ErrorPages/Generic403.d.ts.map +0 -1
- package/lib/cjs/ErrorPages/Generic403.js +0 -14
- package/lib/cjs/ErrorPages/index.d.ts +0 -2
- package/lib/cjs/ErrorPages/index.d.ts.map +0 -1
- package/lib/cjs/ErrorPages/index.js +0 -13
- package/lib/cjs/FeedbackForm/FeedbackForm.d.ts +0 -11
- package/lib/cjs/FeedbackForm/FeedbackForm.d.ts.map +0 -1
- package/lib/cjs/FeedbackForm/FeedbackForm.js +0 -140
- package/lib/cjs/FeedbackForm/index.d.ts +0 -2
- package/lib/cjs/FeedbackForm/index.d.ts.map +0 -1
- package/lib/cjs/FeedbackForm/index.js +0 -13
- package/lib/cjs/Functional/CaseContactsSelectorExternal.d.ts +0 -30
- package/lib/cjs/Functional/CaseContactsSelectorExternal.d.ts.map +0 -1
- package/lib/cjs/Functional/CaseContactsSelectorExternal.js +0 -223
- package/lib/cjs/Functional/index.d.ts +0 -2
- package/lib/cjs/Functional/index.d.ts.map +0 -1
- package/lib/cjs/Functional/index.js +0 -13
- package/lib/cjs/InlineEdit/InlineEdit.d.ts +0 -37
- package/lib/cjs/InlineEdit/InlineEdit.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/InlineEdit.js +0 -169
- package/lib/cjs/InlineEdit/NewInlineEdit.d.ts +0 -41
- package/lib/cjs/InlineEdit/NewInlineEdit.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/NewInlineEdit.js +0 -178
- package/lib/cjs/InlineEdit/index.d.ts +0 -3
- package/lib/cjs/InlineEdit/index.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/index.js +0 -14
- package/lib/cjs/InlineEdit/inlineEdit.css +0 -29
- package/lib/cjs/InlineEdit/newInlineEdit.css +0 -44
- package/lib/cjs/LanguageSelector/LanguageSelector.d.ts +0 -25
- package/lib/cjs/LanguageSelector/LanguageSelector.d.ts.map +0 -1
- package/lib/cjs/LanguageSelector/LanguageSelector.js +0 -61
- package/lib/cjs/LanguageSelector/index.d.ts +0 -2
- package/lib/cjs/LanguageSelector/index.d.ts.map +0 -1
- package/lib/cjs/LanguageSelector/index.js +0 -13
- package/lib/cjs/LanguageSelector/languageSelector.css +0 -5
- package/lib/cjs/LoadingDots/LoadingDots.css +0 -33
- package/lib/cjs/LoadingDots/LoadingDots.d.ts +0 -11
- package/lib/cjs/LoadingDots/LoadingDots.d.ts.map +0 -1
- package/lib/cjs/LoadingDots/LoadingDots.js +0 -25
- package/lib/cjs/LoadingDots/index.d.ts +0 -2
- package/lib/cjs/LoadingDots/index.d.ts.map +0 -1
- package/lib/cjs/LoadingDots/index.js +0 -14
- package/lib/cjs/LoadingIndicator/LoadingIndicator.d.ts +0 -14
- package/lib/cjs/LoadingIndicator/LoadingIndicator.d.ts.map +0 -1
- package/lib/cjs/LoadingIndicator/LoadingIndicator.js +0 -25
- package/lib/cjs/LoadingIndicator/index.d.ts +0 -2
- package/lib/cjs/LoadingIndicator/index.d.ts.map +0 -1
- package/lib/cjs/LoadingIndicator/index.js +0 -13
- package/lib/cjs/LoadingIndicator/loadingIndicator.css +0 -79
- package/lib/cjs/LoginModal/LoginModal.d.ts +0 -14
- package/lib/cjs/LoginModal/LoginModal.d.ts.map +0 -1
- package/lib/cjs/LoginModal/LoginModal.js +0 -21
- package/lib/cjs/LoginModal/index.d.ts +0 -2
- package/lib/cjs/LoginModal/index.d.ts.map +0 -1
- package/lib/cjs/LoginModal/index.js +0 -13
- package/lib/cjs/MarkdownEditor/MarkdownEditor.d.ts +0 -45
- package/lib/cjs/MarkdownEditor/MarkdownEditor.d.ts.map +0 -1
- package/lib/cjs/MarkdownEditor/MarkdownEditor.js +0 -437
- package/lib/cjs/MarkdownEditor/index.d.ts +0 -2
- package/lib/cjs/MarkdownEditor/index.d.ts.map +0 -1
- package/lib/cjs/MarkdownEditor/index.js +0 -13
- package/lib/cjs/MarkdownEditor/markdownEditor.css +0 -111
- package/lib/cjs/MoreOrLess/MoreOrLess.d.ts +0 -13
- package/lib/cjs/MoreOrLess/MoreOrLess.d.ts.map +0 -1
- package/lib/cjs/MoreOrLess/MoreOrLess.js +0 -71
- package/lib/cjs/MoreOrLess/index.d.ts +0 -2
- package/lib/cjs/MoreOrLess/index.d.ts.map +0 -1
- package/lib/cjs/MoreOrLess/index.js +0 -13
- package/lib/cjs/PaginatedList/PaginatedList.d.ts +0 -18
- package/lib/cjs/PaginatedList/PaginatedList.d.ts.map +0 -1
- package/lib/cjs/PaginatedList/PaginatedList.js +0 -63
- package/lib/cjs/PaginatedList/index.d.ts +0 -2
- package/lib/cjs/PaginatedList/index.d.ts.map +0 -1
- package/lib/cjs/PaginatedList/index.js +0 -13
- package/lib/cjs/PaginationCompact/PaginationCompact.d.ts +0 -9
- package/lib/cjs/PaginationCompact/PaginationCompact.d.ts.map +0 -1
- package/lib/cjs/PaginationCompact/PaginationCompact.js +0 -63
- package/lib/cjs/PaginationCompact/index.d.ts +0 -2
- package/lib/cjs/PaginationCompact/index.d.ts.map +0 -1
- package/lib/cjs/PaginationCompact/index.js +0 -13
- package/lib/cjs/PaginationCompact/paginationCompact.css +0 -5
- package/lib/cjs/PhoneInput/CountryData.d.ts +0 -3
- package/lib/cjs/PhoneInput/CountryData.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/CountryData.js +0 -583
- package/lib/cjs/PhoneInput/PhoneInput.d.ts +0 -19
- package/lib/cjs/PhoneInput/PhoneInput.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/PhoneInput.js +0 -286
- package/lib/cjs/PhoneInput/PhoneInput.scss +0 -753
- package/lib/cjs/PhoneInput/flags.png +0 -0
- package/lib/cjs/PhoneInput/index.d.ts +0 -2
- package/lib/cjs/PhoneInput/index.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/index.js +0 -13
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts +0 -8
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.js +0 -68
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.d.ts +0 -12
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.js +0 -39
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.d.ts +0 -6
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.js +0 -8
- package/lib/cjs/ProgressBar/CircularProgressBar/index.d.ts +0 -2
- package/lib/cjs/ProgressBar/CircularProgressBar/index.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/index.js +0 -13
- package/lib/cjs/ProgressBar/CircularProgressBar/styles.css +0 -60
- package/lib/cjs/ProgressBar/CircularProgressBar/types.d.ts +0 -32
- package/lib/cjs/ProgressBar/CircularProgressBar/types.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/types.js +0 -2
- package/lib/cjs/ProgressBar/ProgressBar.d.ts +0 -15
- package/lib/cjs/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/ProgressBar.js +0 -36
- package/lib/cjs/ProgressBar/index.d.ts +0 -3
- package/lib/cjs/ProgressBar/index.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/index.js +0 -14
- package/lib/cjs/PromisifyModal/PromisifyModal.d.ts +0 -18
- package/lib/cjs/PromisifyModal/PromisifyModal.d.ts.map +0 -1
- package/lib/cjs/PromisifyModal/PromisifyModal.js +0 -40
- package/lib/cjs/PromisifyModal/index.d.ts +0 -2
- package/lib/cjs/PromisifyModal/index.d.ts.map +0 -1
- package/lib/cjs/PromisifyModal/index.js +0 -13
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.d.ts +0 -7
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.js +0 -20
- package/lib/cjs/SubscriptionAbuse/const.d.ts +0 -4
- package/lib/cjs/SubscriptionAbuse/const.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/const.js +0 -15
- package/lib/cjs/SubscriptionAbuse/index.d.ts +0 -3
- package/lib/cjs/SubscriptionAbuse/index.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/index.js +0 -14
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.d.ts +0 -11
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.js +0 -44
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.d.ts +0 -10
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.js +0 -178
- package/lib/cjs/SupportFeedbackForm/index.d.ts +0 -3
- package/lib/cjs/SupportFeedbackForm/index.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/index.js +0 -14
- package/lib/cjs/Table/PFTable.d.ts +0 -39
- package/lib/cjs/Table/PFTable.d.ts.map +0 -1
- package/lib/cjs/Table/PFTable.js +0 -204
- package/lib/cjs/Table/README.md +0 -65
- package/lib/cjs/Table/Table.d.ts.map +0 -1
- package/lib/cjs/Table/Table.js +0 -38
- package/lib/cjs/Table/TableColumnSelector.d.ts +0 -7
- package/lib/cjs/Table/TableColumnSelector.d.ts.map +0 -1
- package/lib/cjs/Table/TableColumnSelector.js +0 -34
- package/lib/cjs/Table/TablePagination.d.ts +0 -18
- package/lib/cjs/Table/TablePagination.d.ts.map +0 -1
- package/lib/cjs/Table/TablePagination.js +0 -44
- package/lib/cjs/Table/TableProvider.d.ts +0 -15
- package/lib/cjs/Table/TableProvider.d.ts.map +0 -1
- package/lib/cjs/Table/TableProvider.js +0 -25
- package/lib/cjs/Table/columnSelector.css +0 -37
- package/lib/cjs/Table/index.d.ts +0 -5
- package/lib/cjs/Table/index.d.ts.map +0 -1
- package/lib/cjs/Table/index.js +0 -16
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.d.ts +0 -14
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.d.ts.map +0 -1
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.js +0 -116
- package/lib/cjs/TermsAndConditions/index.d.ts +0 -2
- package/lib/cjs/TermsAndConditions/index.d.ts.map +0 -1
- package/lib/cjs/TermsAndConditions/index.js +0 -13
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.d.ts +0 -8
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.d.ts.map +0 -1
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.js +0 -136
- package/lib/cjs/TextAreaAutosize/index.d.ts +0 -2
- package/lib/cjs/TextAreaAutosize/index.d.ts.map +0 -1
- package/lib/cjs/TextAreaAutosize/index.js +0 -13
- package/lib/cjs/TextAreaResizable/TextAreaResizable.d.ts +0 -20
- package/lib/cjs/TextAreaResizable/TextAreaResizable.d.ts.map +0 -1
- package/lib/cjs/TextAreaResizable/TextAreaResizable.js +0 -56
- package/lib/cjs/TextAreaResizable/index.d.ts +0 -2
- package/lib/cjs/TextAreaResizable/index.d.ts.map +0 -1
- package/lib/cjs/TextAreaResizable/index.js +0 -13
- package/lib/cjs/ToastNotification/ToastNotification.d.ts +0 -28
- package/lib/cjs/ToastNotification/ToastNotification.d.ts.map +0 -1
- package/lib/cjs/ToastNotification/ToastNotification.js +0 -63
- package/lib/cjs/ToastNotification/index.d.ts +0 -2
- package/lib/cjs/ToastNotification/index.d.ts.map +0 -1
- package/lib/cjs/ToastNotification/index.js +0 -13
- package/lib/cjs/ToastNotification/toastNotification.css +0 -22
- package/lib/cjs/TopContentSearch/TopContentSearch.d.ts +0 -14
- package/lib/cjs/TopContentSearch/TopContentSearch.d.ts.map +0 -1
- package/lib/cjs/TopContentSearch/TopContentSearch.js +0 -138
- package/lib/cjs/TopContentSearch/index.d.ts +0 -2
- package/lib/cjs/TopContentSearch/index.d.ts.map +0 -1
- package/lib/cjs/TopContentSearch/index.js +0 -13
- package/lib/cjs/TopContentSearch/topContentSearch.scss +0 -22
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.d.ts +0 -14
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.d.ts.map +0 -1
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.js +0 -76
- package/lib/cjs/ValueChangedIcon/index.d.ts +0 -2
- package/lib/cjs/ValueChangedIcon/index.d.ts.map +0 -1
- package/lib/cjs/ValueChangedIcon/index.js +0 -13
- package/lib/cjs/helperFunctions/errorMessage.d.ts +0 -12
- package/lib/cjs/helperFunctions/errorMessage.d.ts.map +0 -1
- package/lib/cjs/helperFunctions/errorMessage.js +0 -95
- package/lib/cjs/helperFunctions/errorMessage.scss +0 -3
- package/lib/cjs/helperFunctions/index.d.ts +0 -2
- package/lib/cjs/helperFunctions/index.d.ts.map +0 -1
- package/lib/cjs/helperFunctions/index.js +0 -13
- package/lib/cjs/hooks/index.d.ts +0 -14
- package/lib/cjs/hooks/index.d.ts.map +0 -1
- package/lib/cjs/hooks/index.js +0 -25
- package/lib/cjs/hooks/useBreakpoint.d.ts +0 -12
- package/lib/cjs/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/cjs/hooks/useBreakpoint.js +0 -86
- package/lib/cjs/hooks/useCopyToClipboard.d.ts +0 -6
- package/lib/cjs/hooks/useCopyToClipboard.d.ts.map +0 -1
- package/lib/cjs/hooks/useCopyToClipboard.js +0 -39
- package/lib/cjs/hooks/useDebounce.d.ts +0 -9
- package/lib/cjs/hooks/useDebounce.d.ts.map +0 -1
- package/lib/cjs/hooks/useDebounce.js +0 -40
- package/lib/cjs/hooks/useFetch.d.ts +0 -20
- package/lib/cjs/hooks/useFetch.d.ts.map +0 -1
- package/lib/cjs/hooks/useFetch.js +0 -71
- package/lib/cjs/hooks/useForceUpdate.d.ts +0 -18
- package/lib/cjs/hooks/useForceUpdate.d.ts.map +0 -1
- package/lib/cjs/hooks/useForceUpdate.js +0 -28
- package/lib/cjs/hooks/useForkRef.d.ts +0 -2
- package/lib/cjs/hooks/useForkRef.d.ts.map +0 -1
- package/lib/cjs/hooks/useForkRef.js +0 -29
- package/lib/cjs/hooks/useIsMounted.d.ts +0 -3
- package/lib/cjs/hooks/useIsMounted.d.ts.map +0 -1
- package/lib/cjs/hooks/useIsMounted.js +0 -18
- package/lib/cjs/hooks/useLRUCache.d.ts +0 -8
- package/lib/cjs/hooks/useLRUCache.d.ts.map +0 -1
- package/lib/cjs/hooks/useLRUCache.js +0 -28
- package/lib/cjs/hooks/useLocalStorage.d.ts +0 -5
- package/lib/cjs/hooks/useLocalStorage.d.ts.map +0 -1
- package/lib/cjs/hooks/useLocalStorage.js +0 -39
- package/lib/cjs/hooks/useOnScreen.d.ts +0 -2
- package/lib/cjs/hooks/useOnScreen.d.ts.map +0 -1
- package/lib/cjs/hooks/useOnScreen.js +0 -18
- package/lib/cjs/hooks/usePolling.d.ts +0 -2
- package/lib/cjs/hooks/usePolling.d.ts.map +0 -1
- package/lib/cjs/hooks/usePolling.js +0 -19
- package/lib/cjs/hooks/usePrevious.d.ts +0 -2
- package/lib/cjs/hooks/usePrevious.d.ts.map +0 -1
- package/lib/cjs/hooks/usePrevious.js +0 -12
- package/lib/cjs/hooks/useTitle.d.ts +0 -2
- package/lib/cjs/hooks/useTitle.d.ts.map +0 -1
- package/lib/cjs/hooks/useTitle.js +0 -14
- package/lib/cjs/hooks/useUndo.d.ts +0 -22
- package/lib/cjs/hooks/useUndo.d.ts.map +0 -1
- package/lib/cjs/hooks/useUndo.js +0 -76
- package/lib/cjs/index.d.ts +0 -34
- package/lib/cjs/index.d.ts.map +0 -1
- package/lib/cjs/index.js +0 -45
- package/lib/esm/PhoneInput/flags.png +0 -0
- package/lib/esm/Table/Table.d.ts +0 -11
- package/lib/esm/Table/Table.d.ts.map +0 -1
- package/lib/esm/Table/TableColumnSelector.d.ts +0 -7
- package/lib/esm/Table/TableColumnSelector.d.ts.map +0 -1
- package/lib/esm/Table/TableColumnSelector.js +0 -27
- package/lib/esm/Table/columnSelector.css +0 -37
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './PhoneInput.scss';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IProps {
|
|
3
4
|
phoneValue: string;
|
|
4
5
|
countryCode?: string;
|
|
@@ -9,11 +10,23 @@ interface IProps {
|
|
|
9
10
|
setInvalid?: (boolean: any) => void;
|
|
10
11
|
isLoading?: boolean;
|
|
11
12
|
isDisabled?: boolean;
|
|
13
|
+
shouldNotSetCountryCode?: boolean;
|
|
12
14
|
}
|
|
15
|
+
export declare const getExactCountry: (phoneNumber: string) => any[] | {
|
|
16
|
+
name: string | number | string[];
|
|
17
|
+
regions: string | number | string[];
|
|
18
|
+
iso2: string | number | string[];
|
|
19
|
+
countryCode: string | number | string[];
|
|
20
|
+
dialCode: string | number | string[];
|
|
21
|
+
format: string;
|
|
22
|
+
priority: string | number | string[];
|
|
23
|
+
areaCode: string | number | string[];
|
|
24
|
+
phoneInitials: string[];
|
|
25
|
+
};
|
|
13
26
|
export declare const getPhoneObj: (phoneNumber: string) => {
|
|
14
27
|
countryCode: string;
|
|
15
28
|
phoneLine: string;
|
|
16
29
|
};
|
|
17
|
-
export declare function PhoneInput(props: IProps): JSX.Element;
|
|
30
|
+
export declare function PhoneInput(props: IProps): React.JSX.Element;
|
|
18
31
|
export {};
|
|
19
32
|
//# sourceMappingURL=PhoneInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAO3B,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACtE,mBAAmB,CAAC,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAoDD,eAAO,MAAM,eAAe,gBAAiB,MAAM;;;;;;;;;;CAmClD,CAAC;AAqCF,eAAO,MAAM,WAAW,gBAAiB,MAAM;;;CAgB9C,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA+LvC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import './PhoneInput.scss';
|
|
2
|
-
import { InputGroup,
|
|
2
|
+
import { InputGroup, InputGroupItem, Spinner, TextInput } from '@patternfly/react-core';
|
|
3
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
3
4
|
import isEmpty from 'lodash/isEmpty';
|
|
4
5
|
import isEqual from 'lodash/isEqual';
|
|
6
|
+
import isUndefined from 'lodash/isUndefined';
|
|
5
7
|
import React, { useEffect, useState } from 'react';
|
|
6
8
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import {
|
|
9
|
+
import { COUNTRY_DATA } from './CountryData';
|
|
10
|
+
import { FlagSvgs } from './FlagSvgs';
|
|
8
11
|
const PREFIX = '+';
|
|
9
|
-
const DEFAULT_MASK = '... ... ... ...
|
|
12
|
+
const DEFAULT_MASK = '... ... ... ... ... ... ...';
|
|
13
|
+
const DEFAULT_FORMAT = PREFIX + DEFAULT_MASK;
|
|
10
14
|
const ALWAYS_DEFAULT_MASK = false;
|
|
11
15
|
// Getting Country phone format
|
|
12
16
|
function getMask(prefix, dialCode, predefinedMask, defaultMask, alwaysDefaultMask) {
|
|
@@ -28,26 +32,73 @@ const initializedCountries = COUNTRY_DATA.map((country) => {
|
|
|
28
32
|
format: getMask(PREFIX, country[3], country[4], DEFAULT_MASK, ALWAYS_DEFAULT_MASK),
|
|
29
33
|
priority: country[5] || 0,
|
|
30
34
|
areaCode: country[6] || [],
|
|
35
|
+
phoneInitials: !isEmpty(country[6]) // dialCode + areaCode
|
|
36
|
+
? country[6].map((areaCode) => `${country[3]}${areaCode}`)
|
|
37
|
+
: [],
|
|
31
38
|
};
|
|
32
39
|
return countryItem;
|
|
33
40
|
});
|
|
41
|
+
const trimAndReplacePlusFromPhone = (value) => {
|
|
42
|
+
var _a;
|
|
43
|
+
if (!value)
|
|
44
|
+
return '';
|
|
45
|
+
return (_a = value === null || value === void 0 ? void 0 : value.trim()) === null || _a === void 0 ? void 0 : _a.replace('+', '');
|
|
46
|
+
};
|
|
47
|
+
const removeAllSpaces = (value) => {
|
|
48
|
+
// to remove all trailing and in between spaces
|
|
49
|
+
if (!value)
|
|
50
|
+
return '';
|
|
51
|
+
return value === null || value === void 0 ? void 0 : value.replace(/\s+/g, '');
|
|
52
|
+
};
|
|
53
|
+
const removeAllChars = (value) => {
|
|
54
|
+
if (!value)
|
|
55
|
+
return '';
|
|
56
|
+
// to remove all chars, brackets and have only digits
|
|
57
|
+
return value === null || value === void 0 ? void 0 : value.replace(/[^0-9]/g, '');
|
|
58
|
+
};
|
|
59
|
+
// guess exact country for any given phone
|
|
60
|
+
export const getExactCountry = (phoneNumber) => {
|
|
61
|
+
let localPhone = removeAllChars(phoneNumber);
|
|
62
|
+
// Guessing countries according to user input
|
|
63
|
+
const possibleCountries = initializedCountries === null || initializedCountries === void 0 ? void 0 : initializedCountries.filter((country) => localPhone === null || localPhone === void 0 ? void 0 : localPhone.startsWith(country.dialCode.toString()));
|
|
64
|
+
const possibleCountriesPhoneInitials = possibleCountries === null || possibleCountries === void 0 ? void 0 : possibleCountries.map((country) => country.phoneInitials);
|
|
65
|
+
// Function to find the matching country index based on user phone input
|
|
66
|
+
const findMatchingIndex = (possibleCountry, phone) => {
|
|
67
|
+
for (let i = 0; i < (possibleCountry === null || possibleCountry === void 0 ? void 0 : possibleCountry.length); i++) {
|
|
68
|
+
const country = possibleCountry[i];
|
|
69
|
+
for (let j = 0; j < (country === null || country === void 0 ? void 0 : country.length); j++) {
|
|
70
|
+
if (phone.startsWith(country[j])) {
|
|
71
|
+
return i;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return -1; // Return -1 if no match is found
|
|
76
|
+
};
|
|
77
|
+
const countryMatchingIndex = findMatchingIndex(possibleCountriesPhoneInitials, localPhone);
|
|
78
|
+
const defaultCountry = possibleCountries === null || possibleCountries === void 0 ? void 0 : possibleCountries.filter((country) => (localPhone === null || localPhone === void 0 ? void 0 : localPhone.startsWith(country.dialCode.toString())) && isEqual(country.priority, 0));
|
|
79
|
+
const possibleDefaultCountry = !isEmpty(defaultCountry[0]) && !isUndefined(defaultCountry[0]) ? defaultCountry[0] : []; // default country when phone didn't match with any country's area code
|
|
80
|
+
const exactCountry = countryMatchingIndex < 0 ? possibleDefaultCountry : possibleCountries[countryMatchingIndex];
|
|
81
|
+
return exactCountry;
|
|
82
|
+
};
|
|
34
83
|
// Formatting phone numbers according to country
|
|
35
84
|
const formatNumber = (fullPhoneNumber, localFormat) => {
|
|
85
|
+
var _a;
|
|
36
86
|
if (isEmpty(fullPhoneNumber))
|
|
37
87
|
return '';
|
|
38
|
-
let localPhone = fullPhoneNumber.replace(PREFIX, '');
|
|
88
|
+
let localPhone = fullPhoneNumber === null || fullPhoneNumber === void 0 ? void 0 : fullPhoneNumber.replace(PREFIX, '');
|
|
89
|
+
localPhone = removeAllSpaces(localPhone);
|
|
39
90
|
if (isEmpty(localPhone))
|
|
40
91
|
return '';
|
|
41
92
|
// Formatting inputted number
|
|
42
93
|
let phone = '';
|
|
43
94
|
[...fullPhoneNumber].forEach((ele) => {
|
|
44
95
|
if (ele >= '0' && ele <= '9') {
|
|
45
|
-
phone = phone.concat(ele);
|
|
96
|
+
phone = phone === null || phone === void 0 ? void 0 : phone.concat(ele);
|
|
46
97
|
}
|
|
47
98
|
});
|
|
48
99
|
let pattern = '';
|
|
49
100
|
let i = 0;
|
|
50
|
-
for (let j = 0; j < (localFormat === null || localFormat === void 0 ? void 0 : localFormat.length) && i < phone.length; j++) {
|
|
101
|
+
for (let j = 0; j < (localFormat === null || localFormat === void 0 ? void 0 : localFormat.length) && i < (phone === null || phone === void 0 ? void 0 : phone.length); j++) {
|
|
51
102
|
if (localFormat[j] === '.') {
|
|
52
103
|
pattern += phone[i];
|
|
53
104
|
i++;
|
|
@@ -56,100 +107,55 @@ const formatNumber = (fullPhoneNumber, localFormat) => {
|
|
|
56
107
|
pattern += localFormat[j];
|
|
57
108
|
}
|
|
58
109
|
}
|
|
110
|
+
const isPatternWithPrefix = (_a = pattern === null || pattern === void 0 ? void 0 : pattern.replace(/\s+/g, '')) === null || _a === void 0 ? void 0 : _a.startsWith(PREFIX);
|
|
111
|
+
pattern = isPatternWithPrefix ? pattern : !isEmpty(isPatternWithPrefix) ? PREFIX + pattern : '';
|
|
59
112
|
return pattern;
|
|
60
113
|
};
|
|
61
114
|
// return phoneline and countrycode for any given phone
|
|
62
115
|
export const getPhoneObj = (phoneNumber) => {
|
|
63
|
-
|
|
116
|
+
var _a;
|
|
117
|
+
let localPhone = removeAllChars(phoneNumber);
|
|
64
118
|
let countryCode = '';
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (!isEmpty(exactCountry)) {
|
|
69
|
-
countryCode = exactCountry[0].dialCode.toString();
|
|
119
|
+
const exactCountry = getExactCountry(localPhone);
|
|
120
|
+
if (!isEmpty(exactCountry) && !isEmpty(exactCountry['dialCode'].toString())) {
|
|
121
|
+
countryCode = PREFIX + exactCountry['dialCode'].toString();
|
|
70
122
|
}
|
|
71
|
-
else
|
|
72
|
-
countryCode =
|
|
123
|
+
else {
|
|
124
|
+
countryCode = '';
|
|
73
125
|
}
|
|
74
126
|
return {
|
|
75
|
-
countryCode:
|
|
76
|
-
phoneLine: localPhone.substring(countryCode.length, localPhone.length),
|
|
127
|
+
countryCode: countryCode,
|
|
128
|
+
phoneLine: localPhone === null || localPhone === void 0 ? void 0 : localPhone.substring((_a = trimAndReplacePlusFromPhone(countryCode)) === null || _a === void 0 ? void 0 : _a.length, localPhone === null || localPhone === void 0 ? void 0 : localPhone.length),
|
|
77
129
|
};
|
|
78
130
|
};
|
|
79
131
|
export function PhoneInput(props) {
|
|
80
|
-
const { phoneValue, countryCode, onCountryCodeChange, onPhoneValueChange, validations, setInvalid } = props;
|
|
132
|
+
const { phoneValue, countryCode, onCountryCodeChange, onPhoneValueChange, validations, setInvalid, shouldNotSetCountryCode, } = props;
|
|
81
133
|
const { t } = useTranslation();
|
|
82
134
|
const [isOpen, setIsOpen] = useState(false);
|
|
83
135
|
const [iso2, setIso2] = useState('');
|
|
84
136
|
const [formattedNumber, setFormattedNumber] = useState('');
|
|
85
|
-
const [format, setFormat] = useState('');
|
|
86
|
-
const [countryObj, setCountryObj] = useState({
|
|
87
|
-
name: '',
|
|
88
|
-
regions: [''],
|
|
89
|
-
iso2: '',
|
|
90
|
-
countryCode: '',
|
|
91
|
-
dialCode: '',
|
|
92
|
-
format: '',
|
|
93
|
-
priority: 0,
|
|
94
|
-
areaCode: [''], // Area codes of a country
|
|
95
|
-
});
|
|
96
137
|
const setLocalFormat = (phoneNumber) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// if the user selects a value from the dropdown and the country code is the same as prev, iso2 values shouldn't override
|
|
101
|
-
if (!isEmpty(countryObj) && isEqual(localPhone, countryObj.dialCode)) {
|
|
102
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + countryObj.countryCode);
|
|
103
|
-
return countryObj.format;
|
|
138
|
+
const localPhone = removeAllChars(phoneNumber);
|
|
139
|
+
if (shouldNotSetCountryCode) {
|
|
140
|
+
return DEFAULT_FORMAT; // default format for portal phone without country code
|
|
104
141
|
}
|
|
105
142
|
let localFormat;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const exactCountry = initializedCountries.filter((country) => country.dialCode.toString() === localPhone);
|
|
112
|
-
if (!isEmpty(isCountryCanada)) {
|
|
113
|
-
const canadaCountryObj = initializedCountries.filter((country) => country.iso2.toString() === 'ca');
|
|
114
|
-
setIso2(canadaCountryObj[0].iso2.toString());
|
|
115
|
-
localFormat = canadaCountryObj[0].format.toString();
|
|
116
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + canadaCountryObj[0].dialCode.toString());
|
|
117
|
-
setFormat(localFormat);
|
|
118
|
-
}
|
|
119
|
-
else if (!isEmpty(exactCountry)) {
|
|
120
|
-
const localExactCountry = exactCountry.filter((country) => isEqual(country.priority, 0));
|
|
121
|
-
if (isEqual(localExactCountry[0].dialCode.toString(), countryObj.dialCode)) {
|
|
122
|
-
setIso2(countryObj.iso2);
|
|
123
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + countryObj.countryCode);
|
|
124
|
-
return countryObj.format;
|
|
125
|
-
}
|
|
126
|
-
setIso2(localExactCountry[0].iso2.toString());
|
|
127
|
-
localFormat = localExactCountry[0].format.toString();
|
|
128
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + localExactCountry[0].dialCode.toString());
|
|
129
|
-
setFormat(localFormat);
|
|
130
|
-
}
|
|
131
|
-
else if (!isEmpty(possibleCountries)) {
|
|
132
|
-
const localPossibleCountry = possibleCountries.filter((country) => isEqual(country.priority, 0));
|
|
133
|
-
if (isEqual(localPossibleCountry[0].dialCode.toString(), countryObj.dialCode)) {
|
|
134
|
-
setIso2(countryObj.iso2);
|
|
135
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + countryObj.countryCode);
|
|
136
|
-
return countryObj.format;
|
|
137
|
-
}
|
|
138
|
-
setIso2(localPossibleCountry[0].iso2.toString());
|
|
139
|
-
localFormat = localPossibleCountry[0].format.toString();
|
|
140
|
-
onCountryCodeChange && onCountryCodeChange(PREFIX + localPossibleCountry[0].dialCode.toString());
|
|
141
|
-
setFormat(localFormat);
|
|
143
|
+
const exactCountry = getExactCountry(localPhone);
|
|
144
|
+
if (!isEmpty(exactCountry)) {
|
|
145
|
+
setIso2(exactCountry['iso2'].toString());
|
|
146
|
+
localFormat = exactCountry['format'].toString();
|
|
147
|
+
onCountryCodeChange && onCountryCodeChange(PREFIX + exactCountry['dialCode'].toString());
|
|
142
148
|
}
|
|
143
149
|
else {
|
|
144
|
-
// if
|
|
150
|
+
// if there are not matched possible countries
|
|
145
151
|
setIso2('');
|
|
146
|
-
localFormat =
|
|
152
|
+
localFormat = DEFAULT_FORMAT;
|
|
147
153
|
onCountryCodeChange && onCountryCodeChange('');
|
|
148
154
|
}
|
|
149
155
|
return localFormat;
|
|
150
156
|
};
|
|
151
157
|
const onPhoneChange = (phone) => {
|
|
152
|
-
if (isEmpty(phone
|
|
158
|
+
if (isEmpty(removeAllSpaces(phone)) || isEmpty(trimAndReplacePlusFromPhone(phone))) {
|
|
153
159
|
setFormattedNumber('');
|
|
154
160
|
onPhoneValueChange('');
|
|
155
161
|
setInvalid && setInvalid(false);
|
|
@@ -160,25 +166,32 @@ export function PhoneInput(props) {
|
|
|
160
166
|
const localFormat = setLocalFormat(phone);
|
|
161
167
|
const _formattedNumber = formatNumber(phone, localFormat);
|
|
162
168
|
setFormattedNumber(_formattedNumber);
|
|
163
|
-
if (!phone.trim().startsWith(PREFIX) && regex.test(phone) && !isEqual(phone, '-')) {
|
|
164
|
-
onPhoneValueChange(PREFIX + phone.trim());
|
|
169
|
+
if (!(phone === null || phone === void 0 ? void 0 : phone.trim().startsWith(PREFIX)) && regex.test(phone) && !isEqual(phone, '-')) {
|
|
170
|
+
onPhoneValueChange(PREFIX + (phone === null || phone === void 0 ? void 0 : phone.trim()));
|
|
165
171
|
}
|
|
166
172
|
else {
|
|
167
|
-
|
|
168
|
-
onPhoneValueChange(phone.slice(0, localFormat.length || 5));
|
|
173
|
+
onPhoneValueChange(phone === null || phone === void 0 ? void 0 : phone.slice(0, localFormat === null || localFormat === void 0 ? void 0 : localFormat.length));
|
|
169
174
|
}
|
|
170
175
|
};
|
|
171
176
|
const onToggle = (isOpen) => {
|
|
172
177
|
setIsOpen(isOpen);
|
|
173
178
|
};
|
|
174
179
|
const onCountrySelect = (event, selection) => {
|
|
175
|
-
|
|
180
|
+
var _a, _b;
|
|
181
|
+
const prevCountryCode = !shouldNotSetCountryCode // fetching previous country code to remove it from the phone
|
|
182
|
+
? trimAndReplacePlusFromPhone((_a = getPhoneObj(phoneValue)) === null || _a === void 0 ? void 0 : _a.countryCode)
|
|
183
|
+
: '';
|
|
184
|
+
const phoneWithoutCountryCode = (_b = removeAllChars(phoneValue)) === null || _b === void 0 ? void 0 : _b.replace(prevCountryCode, '');
|
|
185
|
+
const formattedPhone = `${PREFIX}${selection.countryCode}${phoneWithoutCountryCode}`;
|
|
186
|
+
const localFormattedPhone = setLocalFormat(formattedPhone);
|
|
187
|
+
onPhoneValueChange(formatNumber(formattedPhone, localFormattedPhone));
|
|
176
188
|
setIsOpen(!isOpen);
|
|
177
189
|
};
|
|
178
190
|
const getOptions = (options) => {
|
|
179
191
|
return options.map((country) => (React.createElement(SelectOption, { key: country.iso2, value: country },
|
|
180
|
-
React.createElement("div", { className: "pf-u-display-inline-flex" },
|
|
181
|
-
React.createElement("
|
|
192
|
+
React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
|
|
193
|
+
React.createElement("svg", { className: "flag-class-select" },
|
|
194
|
+
React.createElement("use", { xlinkHref: `#cc_${country.iso2}` })),
|
|
182
195
|
country.name,
|
|
183
196
|
" (+",
|
|
184
197
|
country.dialCode,
|
|
@@ -194,30 +207,10 @@ export function PhoneInput(props) {
|
|
|
194
207
|
return getOptions(newOptions);
|
|
195
208
|
};
|
|
196
209
|
const placeholder = (React.createElement("div", { className: "phone-number-select-placeholder" },
|
|
197
|
-
React.createElement("div", { className: "pf-u-display-inline-flex" },
|
|
198
|
-
React.createElement("
|
|
210
|
+
React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
|
|
211
|
+
React.createElement("svg", { className: "flag-class-selected" },
|
|
212
|
+
React.createElement("use", { xlinkHref: `#cc_${iso2}` })),
|
|
199
213
|
iso2.toUpperCase())));
|
|
200
|
-
useEffect(() => {
|
|
201
|
-
if (isEmpty(phoneValue)) {
|
|
202
|
-
setInvalid && setInvalid(false);
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (isEmpty(iso2)) {
|
|
206
|
-
const localFormat = setLocalFormat(phoneValue);
|
|
207
|
-
const _formattedNumber = formatNumber(phoneValue, localFormat);
|
|
208
|
-
setFormattedNumber(_formattedNumber);
|
|
209
|
-
}
|
|
210
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
|
-
}, []);
|
|
212
|
-
useEffect(() => {
|
|
213
|
-
if (!isEmpty(countryObj.iso2) && `${PREFIX}${countryObj.dialCode}` !== countryCode) {
|
|
214
|
-
setIso2(countryObj.iso2);
|
|
215
|
-
setFormat(countryObj.format);
|
|
216
|
-
onPhoneValueChange(`${PREFIX}${countryObj.dialCode}`);
|
|
217
|
-
setFormattedNumber(`${PREFIX}${countryObj.dialCode}`);
|
|
218
|
-
}
|
|
219
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
|
-
}, [countryObj]);
|
|
221
214
|
useEffect(() => {
|
|
222
215
|
// when user types +, it will be replaced by empty string
|
|
223
216
|
if (isEqual(phoneValue === null || phoneValue === void 0 ? void 0 : phoneValue.trim(), PREFIX) && isEmpty(iso2)) {
|
|
@@ -225,18 +218,6 @@ export function PhoneInput(props) {
|
|
|
225
218
|
setFormattedNumber('');
|
|
226
219
|
return;
|
|
227
220
|
}
|
|
228
|
-
if (isEmpty(phoneValue) && isEmpty(iso2)) {
|
|
229
|
-
setCountryObj({
|
|
230
|
-
name: '',
|
|
231
|
-
regions: [''],
|
|
232
|
-
iso2: '',
|
|
233
|
-
countryCode: '',
|
|
234
|
-
dialCode: '',
|
|
235
|
-
format: '',
|
|
236
|
-
priority: 0,
|
|
237
|
-
areaCode: [''],
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
221
|
if (isEmpty(phoneValue)) {
|
|
241
222
|
setIso2('');
|
|
242
223
|
setInvalid && setInvalid(false);
|
|
@@ -251,9 +232,29 @@ export function PhoneInput(props) {
|
|
|
251
232
|
}
|
|
252
233
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
234
|
}, [phoneValue]);
|
|
235
|
+
// For first time user whose phone is fetched from portal without country code
|
|
236
|
+
// For phone length less or equal to 10 country code shouldn't be fetched to avoid faulty phone population
|
|
237
|
+
// shouldNotSetCountryCode flag from ContactPhoneNumber
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
if (shouldNotSetCountryCode) {
|
|
240
|
+
setIso2('');
|
|
241
|
+
onCountryCodeChange && onCountryCodeChange('');
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
onCountryCodeChange && onCountryCodeChange(PREFIX + countryCode);
|
|
245
|
+
}
|
|
246
|
+
onPhoneValueChange && onPhoneValueChange(removeAllSpaces(phoneValue)); // removing trailing and in between spaces
|
|
247
|
+
const localFormat = setLocalFormat(phoneValue);
|
|
248
|
+
const _formattedNumber = formatNumber(phoneValue, localFormat);
|
|
249
|
+
setFormattedNumber(_formattedNumber);
|
|
250
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
251
|
+
}, [shouldNotSetCountryCode]);
|
|
254
252
|
return (React.createElement(InputGroup, { className: "phone-number-input" },
|
|
255
|
-
React.createElement(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
React.createElement(FlagSvgs, null),
|
|
254
|
+
React.createElement(InputGroupItem, null,
|
|
255
|
+
React.createElement("div", null,
|
|
256
|
+
React.createElement(Select, { variant: SelectVariant.single, "data-tracking-id": "case-phone-number-country-code", className: "phone-number-select", onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onCountrySelect, isOpen: isOpen, placeholderText: iso2 && phoneValue !== '' ? placeholder : 'Country Code', onFilter: onFilter, hasInlineFilter: true, inlineFilterPlaceholderText: t('Search'), isDisabled: props.isDisabled, toggleAriaLabel: "Country Code" }, getOptions(initializedCountries)))),
|
|
257
|
+
React.createElement(InputGroupItem, { style: { width: '100%' } },
|
|
258
|
+
React.createElement(TextInput, { id: "case-phone-number", "data-tracking-id": "case-phone-number", placeholder: "55-555-5555", value: formattedNumber ? formattedNumber : phoneValue, onChange: (_event, phone) => onPhoneChange(phone), validated: validations, isDisabled: props.isDisabled, "aria-label": "Case owner's phone number" })),
|
|
259
|
+
props.isLoading && React.createElement(Spinner, { size: "lg", className: "pf-v5-u-ml-2xl pf-v5-u-mr-xl phone-spinner" })));
|
|
259
260
|
}
|