@zj-dynamics/components-native 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/NOTICE.foundation +21 -0
- package/README.md +16 -2
- package/RulnarComponentsNative.podspec +16 -0
- package/dist/AutoLink.d.ts +9 -0
- package/dist/AutoLink.js +63 -0
- package/dist/BottomSheetKeyboardAwareScrollView.d.ts +12 -0
- package/dist/BottomSheetKeyboardAwareScrollView.js +19 -0
- package/dist/Button.d.ts +37 -0
- package/dist/Button.js +24 -0
- package/dist/Checkbox.d.ts +37 -0
- package/dist/Checkbox.js +73 -0
- package/dist/Content.d.ts +16 -0
- package/dist/Content.js +17 -0
- package/dist/ContentOverlay.d.ts +31 -0
- package/dist/ContentOverlay.js +151 -0
- package/dist/Divider.d.ts +6 -0
- package/dist/Divider.js +20 -0
- package/dist/Flex.d.ts +10 -0
- package/dist/Flex.js +19 -0
- package/dist/Icon.d.ts +11 -0
- package/dist/Icon.js +17 -0
- package/dist/InputCurrency.d.ts +12 -0
- package/dist/InputCurrency.js +57 -0
- package/dist/InputText.d.ts +32 -0
- package/dist/InputText.js +103 -0
- package/dist/NativeTextFields.d.ts +22 -0
- package/dist/NativeTextFields.js +59 -0
- package/dist/Switch.d.ts +17 -0
- package/dist/Switch.js +27 -0
- package/dist/controlledField.d.ts +4 -0
- package/dist/controlledField.js +9 -0
- package/dist/foundationText/ActionItem/ActionItem.d.ts +42 -0
- package/dist/foundationText/ActionItem/ActionItem.js +31 -0
- package/dist/foundationText/ActionItem/ActionItem.style.d.ts +21 -0
- package/dist/foundationText/ActionItem/ActionItem.style.js +24 -0
- package/dist/foundationText/ActionItem/ActionItemGroup.d.ts +12 -0
- package/dist/foundationText/ActionItem/ActionItemGroup.js +18 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.d.ts +10 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.js +17 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.style.d.ts +10 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.style.js +13 -0
- package/dist/foundationText/ActionItem/index.d.ts +4 -0
- package/dist/foundationText/ActionItem/index.js +3 -0
- package/dist/foundationText/ActionLabel/ActionLabel.d.ts +28 -0
- package/dist/foundationText/ActionLabel/ActionLabel.js +22 -0
- package/dist/foundationText/ActionLabel/index.d.ts +2 -0
- package/dist/foundationText/ActionLabel/index.js +1 -0
- package/dist/foundationText/ActivityIndicator/ActivityIndicator.d.ts +46 -0
- package/dist/foundationText/ActivityIndicator/ActivityIndicator.js +191 -0
- package/dist/foundationText/ActivityIndicator/index.d.ts +2 -0
- package/dist/foundationText/ActivityIndicator/index.js +1 -0
- package/dist/foundationText/Banner/Banner.d.ts +3 -0
- package/dist/foundationText/Banner/Banner.js +64 -0
- package/dist/foundationText/Banner/Banner.style.d.ts +56 -0
- package/dist/foundationText/Banner/Banner.style.js +59 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.d.ts +8 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.js +9 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.style.d.ts +18 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.style.js +21 -0
- package/dist/foundationText/Banner/index.d.ts +2 -0
- package/dist/foundationText/Banner/index.js +1 -0
- package/dist/foundationText/Banner/types.d.ts +63 -0
- package/dist/foundationText/Banner/types.js +1 -0
- package/dist/foundationText/BottomSheet/BottomSheet.d.ts +32 -0
- package/dist/foundationText/BottomSheet/BottomSheet.js +75 -0
- package/dist/foundationText/BottomSheet/BottomSheet.style.d.ts +26 -0
- package/dist/foundationText/BottomSheet/BottomSheet.style.js +30 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +13 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.js +16 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.styles.d.ts +16 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.styles.js +19 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/index.d.ts +2 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/index.js +1 -0
- package/dist/foundationText/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
- package/dist/foundationText/BottomSheet/hooks/useBottomSheetBackHandler.js +25 -0
- package/dist/foundationText/BottomSheet/index.d.ts +4 -0
- package/dist/foundationText/BottomSheet/index.js +2 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.d.ts +30 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.js +25 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.style.d.ts +16 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.style.js +19 -0
- package/dist/foundationText/ButtonGroup/ButtonGroupAction.d.ts +47 -0
- package/dist/foundationText/ButtonGroup/ButtonGroupAction.js +11 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +14 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.js +15 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/index.d.ts +1 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/index.js +1 -0
- package/dist/foundationText/ButtonGroup/index.d.ts +3 -0
- package/dist/foundationText/ButtonGroup/index.js +2 -0
- package/dist/foundationText/ButtonGroup/types.d.ts +7 -0
- package/dist/foundationText/ButtonGroup/types.js +1 -0
- package/dist/foundationText/ButtonGroup/utils.d.ts +19 -0
- package/dist/foundationText/ButtonGroup/utils.js +41 -0
- package/dist/foundationText/Card/Card.d.ts +41 -0
- package/dist/foundationText/Card/Card.js +26 -0
- package/dist/foundationText/Card/Card.style.d.ts +56 -0
- package/dist/foundationText/Card/Card.style.js +38 -0
- package/dist/foundationText/Card/components/InternalCardHeader.d.ts +10 -0
- package/dist/foundationText/Card/components/InternalCardHeader.js +16 -0
- package/dist/foundationText/Card/components/InternalCardHeader.style.d.ts +14 -0
- package/dist/foundationText/Card/components/InternalCardHeader.style.js +17 -0
- package/dist/foundationText/Card/components/index.d.ts +1 -0
- package/dist/foundationText/Card/components/index.js +1 -0
- package/dist/foundationText/Card/index.d.ts +2 -0
- package/dist/foundationText/Card/index.js +1 -0
- package/dist/foundationText/Chip/Chip.d.ts +45 -0
- package/dist/foundationText/Chip/Chip.js +88 -0
- package/dist/foundationText/Chip/Chip.style.d.ts +27 -0
- package/dist/foundationText/Chip/Chip.style.js +31 -0
- package/dist/foundationText/Chip/index.d.ts +2 -0
- package/dist/foundationText/Chip/index.js +1 -0
- package/dist/foundationText/ComponentSettingsContext/ComponentSettingsContext.d.ts +57 -0
- package/dist/foundationText/ComponentSettingsContext/ComponentSettingsContext.js +26 -0
- package/dist/foundationText/ComponentSettingsContext/index.d.ts +1 -0
- package/dist/foundationText/ComponentSettingsContext/index.js +1 -0
- package/dist/foundationText/Disclosure/Disclosure.d.ts +35 -0
- package/dist/foundationText/Disclosure/Disclosure.js +51 -0
- package/dist/foundationText/Disclosure/Disclosure.style.d.ts +19 -0
- package/dist/foundationText/Disclosure/Disclosure.style.js +22 -0
- package/dist/foundationText/Disclosure/constants.d.ts +1 -0
- package/dist/foundationText/Disclosure/constants.js +1 -0
- package/dist/foundationText/Disclosure/index.d.ts +1 -0
- package/dist/foundationText/Disclosure/index.js +1 -0
- package/dist/foundationText/EmptyState/EmptyState.d.ts +35 -0
- package/dist/foundationText/EmptyState/EmptyState.js +18 -0
- package/dist/foundationText/EmptyState/EmptyState.style.d.ts +6 -0
- package/dist/foundationText/EmptyState/EmptyState.style.js +9 -0
- package/dist/foundationText/EmptyState/index.d.ts +2 -0
- package/dist/foundationText/EmptyState/index.js +1 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +22 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.js +35 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.style.d.ts +29 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.style.js +32 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageContext.d.ts +3 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageContext.js +11 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +7 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageProvider.js +38 -0
- package/dist/foundationText/ErrorMessageWrapper/context/index.d.ts +2 -0
- package/dist/foundationText/ErrorMessageWrapper/context/index.js +2 -0
- package/dist/foundationText/ErrorMessageWrapper/context/types.d.ts +62 -0
- package/dist/foundationText/ErrorMessageWrapper/context/types.js +1 -0
- package/dist/foundationText/ErrorMessageWrapper/index.d.ts +2 -0
- package/dist/foundationText/ErrorMessageWrapper/index.js +2 -0
- package/dist/foundationText/Form/Form.d.ts +4 -0
- package/dist/foundationText/Form/Form.js +142 -0
- package/dist/foundationText/Form/Form.style.d.ts +31 -0
- package/dist/foundationText/Form/Form.style.js +34 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.d.ts +13 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.js +21 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.style.d.ts +15 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.style.js +11 -0
- package/dist/foundationText/Form/components/FormActionBar/index.d.ts +2 -0
- package/dist/foundationText/Form/components/FormActionBar/index.js +1 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.d.ts +10 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.js +18 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.style.d.ts +24 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.style.js +27 -0
- package/dist/foundationText/Form/components/FormBody/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormBody/index.js +1 -0
- package/dist/foundationText/Form/components/FormCache/FormCache.d.ts +10 -0
- package/dist/foundationText/Form/components/FormCache/FormCache.js +28 -0
- package/dist/foundationText/Form/components/FormErrorBanner/FormErrorBanner.d.ts +3 -0
- package/dist/foundationText/Form/components/FormErrorBanner/FormErrorBanner.js +14 -0
- package/dist/foundationText/Form/components/FormErrorBanner/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormErrorBanner/index.js +1 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.d.ts +2 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.js +9 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.style.d.ts +13 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.style.js +16 -0
- package/dist/foundationText/Form/components/FormMask/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMask/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessage/FormMessage.d.ts +19 -0
- package/dist/foundationText/Form/components/FormMessage/FormMessage.js +49 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +8 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.js +27 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.style.d.ts +20 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.style.js +18 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessage/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessage/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessageBanner/FormMessageBanner.d.ts +7 -0
- package/dist/foundationText/Form/components/FormMessageBanner/FormMessageBanner.js +16 -0
- package/dist/foundationText/Form/components/FormMessageBanner/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessageBanner/index.js +1 -0
- package/dist/foundationText/Form/components/FormSaveButton/FormSaveButton.d.ts +3 -0
- package/dist/foundationText/Form/components/FormSaveButton/FormSaveButton.js +55 -0
- package/dist/foundationText/Form/components/FormSaveButton/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormSaveButton/index.js +1 -0
- package/dist/foundationText/Form/components/IOSKeyboardAwareScrollViewSpacer/IOSKeyboardAwareScrollViewSpacer.d.ts +6 -0
- package/dist/foundationText/Form/components/IOSKeyboardAwareScrollViewSpacer/IOSKeyboardAwareScrollViewSpacer.js +13 -0
- package/dist/foundationText/Form/constants.d.ts +2 -0
- package/dist/foundationText/Form/constants.js +2 -0
- package/dist/foundationText/Form/context/FormContext.d.ts +11 -0
- package/dist/foundationText/Form/context/FormContext.js +16 -0
- package/dist/foundationText/Form/context/index.d.ts +2 -0
- package/dist/foundationText/Form/context/index.js +1 -0
- package/dist/foundationText/Form/context/types.d.ts +26 -0
- package/dist/foundationText/Form/context/types.js +1 -0
- package/dist/foundationText/Form/hooks/useFormViewRefs.d.ts +10 -0
- package/dist/foundationText/Form/hooks/useFormViewRefs.js +13 -0
- package/dist/foundationText/Form/hooks/useInternalForm.d.ts +19 -0
- package/dist/foundationText/Form/hooks/useInternalForm.js +43 -0
- package/dist/foundationText/Form/hooks/useOfflineHandler.d.ts +1 -0
- package/dist/foundationText/Form/hooks/useOfflineHandler.js +23 -0
- package/dist/foundationText/Form/hooks/useSaveButtonPosition.d.ts +12 -0
- package/dist/foundationText/Form/hooks/useSaveButtonPosition.js +25 -0
- package/dist/foundationText/Form/hooks/useScreenInformation.d.ts +8 -0
- package/dist/foundationText/Form/hooks/useScreenInformation.js +15 -0
- package/dist/foundationText/Form/hooks/useScrollToError/index.d.ts +1 -0
- package/dist/foundationText/Form/hooks/useScrollToError/index.js +1 -0
- package/dist/foundationText/Form/hooks/useScrollToError/useScrollToError.d.ts +9 -0
- package/dist/foundationText/Form/hooks/useScrollToError/useScrollToError.js +64 -0
- package/dist/foundationText/Form/index.d.ts +5 -0
- package/dist/foundationText/Form/index.js +4 -0
- package/dist/foundationText/Form/types.d.ts +215 -0
- package/dist/foundationText/Form/types.js +10 -0
- package/dist/foundationText/FormField/FormField.d.ts +24 -0
- package/dist/foundationText/FormField/FormField.js +11 -0
- package/dist/foundationText/FormField/index.d.ts +1 -0
- package/dist/foundationText/FormField/index.js +1 -0
- package/dist/foundationText/FormatFile/FormatFile.d.ts +79 -0
- package/dist/foundationText/FormatFile/FormatFile.js +47 -0
- package/dist/foundationText/FormatFile/FormatFile.style.d.ts +15 -0
- package/dist/foundationText/FormatFile/FormatFile.style.js +19 -0
- package/dist/foundationText/FormatFile/FormatFileThumbnail.d.ts +58 -0
- package/dist/foundationText/FormatFile/FormatFileThumbnail.js +35 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.js +9 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.style.d.ts +8 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.style.js +11 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/index.js +1 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.d.ts +13 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.js +42 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.style.d.ts +64 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.style.js +70 -0
- package/dist/foundationText/FormatFile/components/FileView/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/FileView/index.js +1 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +12 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.js +17 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/index.d.ts +2 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/index.js +1 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.d.ts +14 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.js +108 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.style.d.ts +25 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.style.js +28 -0
- package/dist/foundationText/FormatFile/components/MediaView/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/MediaView/index.js +1 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.js +30 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.style.d.ts +13 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.style.js +16 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/index.js +1 -0
- package/dist/foundationText/FormatFile/constants.d.ts +35 -0
- package/dist/foundationText/FormatFile/constants.js +74 -0
- package/dist/foundationText/FormatFile/context/FormatFileContext.d.ts +9 -0
- package/dist/foundationText/FormatFile/context/FormatFileContext.js +8 -0
- package/dist/foundationText/FormatFile/context/types.d.ts +9 -0
- package/dist/foundationText/FormatFile/context/types.js +1 -0
- package/dist/foundationText/FormatFile/index.d.ts +8 -0
- package/dist/foundationText/FormatFile/index.js +3 -0
- package/dist/foundationText/FormatFile/types.d.ts +105 -0
- package/dist/foundationText/FormatFile/types.js +8 -0
- package/dist/foundationText/FormatFile/utils/computeA11yLabel.d.ts +9 -0
- package/dist/foundationText/FormatFile/utils/computeA11yLabel.js +11 -0
- package/dist/foundationText/FormatFile/utils/createUseCreateThumbnail.d.ts +6 -0
- package/dist/foundationText/FormatFile/utils/createUseCreateThumbnail.js +27 -0
- package/dist/foundationText/FormatFile/utils/getFileCategory.d.ts +28 -0
- package/dist/foundationText/FormatFile/utils/getFileCategory.js +62 -0
- package/dist/foundationText/FormatFile/utils/index.d.ts +7 -0
- package/dist/foundationText/FormatFile/utils/index.js +6 -0
- package/dist/foundationText/FormatFile/utils/mapFileTypeToIconName.d.ts +17 -0
- package/dist/foundationText/FormatFile/utils/mapFileTypeToIconName.js +30 -0
- package/dist/foundationText/FormatFile/utils/parseFile.d.ts +3 -0
- package/dist/foundationText/FormatFile/utils/parseFile.js +58 -0
- package/dist/foundationText/FormatFile/utils/sanitizeFileName.d.ts +5 -0
- package/dist/foundationText/FormatFile/utils/sanitizeFileName.js +9 -0
- package/dist/foundationText/FormatFile/utils/truncateFileNameForLine.d.ts +24 -0
- package/dist/foundationText/FormatFile/utils/truncateFileNameForLine.js +58 -0
- package/dist/foundationText/Glimmer/Glimmer.d.ts +32 -0
- package/dist/foundationText/Glimmer/Glimmer.js +42 -0
- package/dist/foundationText/Glimmer/Glimmer.shape.style.d.ts +14 -0
- package/dist/foundationText/Glimmer/Glimmer.shape.style.js +17 -0
- package/dist/foundationText/Glimmer/Glimmer.size.style.d.ts +17 -0
- package/dist/foundationText/Glimmer/Glimmer.size.style.js +10 -0
- package/dist/foundationText/Glimmer/Glimmer.style.d.ts +26 -0
- package/dist/foundationText/Glimmer/Glimmer.style.js +30 -0
- package/dist/foundationText/Glimmer/index.d.ts +1 -0
- package/dist/foundationText/Glimmer/index.js +1 -0
- package/dist/foundationText/Heading/Heading.d.ts +38 -0
- package/dist/foundationText/Heading/Heading.js +53 -0
- package/dist/foundationText/Heading/index.d.ts +2 -0
- package/dist/foundationText/Heading/index.js +1 -0
- package/dist/foundationText/IconButton/IconButton.d.ts +35 -0
- package/dist/foundationText/IconButton/IconButton.js +9 -0
- package/dist/foundationText/IconButton/IconButton.style.d.ts +8 -0
- package/dist/foundationText/IconButton/IconButton.style.js +11 -0
- package/dist/foundationText/IconButton/index.d.ts +1 -0
- package/dist/foundationText/IconButton/index.js +1 -0
- package/dist/foundationText/InputCurrency/constants.d.ts +1 -0
- package/dist/foundationText/InputCurrency/constants.js +1 -0
- package/dist/foundationText/InputCurrency/utils.d.ts +9 -0
- package/dist/foundationText/InputCurrency/utils.js +57 -0
- package/dist/foundationText/InputDate/InputDate.d.ts +76 -0
- package/dist/foundationText/InputDate/InputDate.js +70 -0
- package/dist/foundationText/InputDate/index.d.ts +2 -0
- package/dist/foundationText/InputDate/index.js +1 -0
- package/dist/foundationText/InputFieldWrapper/CommonInputStyles.style.d.ts +10 -0
- package/dist/foundationText/InputFieldWrapper/CommonInputStyles.style.js +49 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.d.ts +92 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.js +99 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.style.d.ts +106 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.style.js +123 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +10 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.js +11 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.style.d.ts +22 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.style.js +26 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/index.d.ts +1 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/index.js +1 -0
- package/dist/foundationText/InputFieldWrapper/components/Prefix/Prefix.d.ts +22 -0
- package/dist/foundationText/InputFieldWrapper/components/Prefix/Prefix.js +39 -0
- package/dist/foundationText/InputFieldWrapper/components/Suffix/Suffix.d.ts +25 -0
- package/dist/foundationText/InputFieldWrapper/components/Suffix/Suffix.js +40 -0
- package/dist/foundationText/InputFieldWrapper/index.d.ts +4 -0
- package/dist/foundationText/InputFieldWrapper/index.js +3 -0
- package/dist/foundationText/InputPressable/InputPressable.d.ts +91 -0
- package/dist/foundationText/InputPressable/InputPressable.js +42 -0
- package/dist/foundationText/InputPressable/InputPressable.style.d.ts +21 -0
- package/dist/foundationText/InputPressable/InputPressable.style.js +28 -0
- package/dist/foundationText/InputPressable/index.d.ts +2 -0
- package/dist/foundationText/InputPressable/index.js +1 -0
- package/dist/foundationText/InputSearch/components/FilterButton.d.ts +7 -0
- package/dist/foundationText/InputSearch/components/FilterButton.js +10 -0
- package/dist/foundationText/InputText/context/InputAccessoriesContext.d.ts +3 -0
- package/dist/foundationText/InputText/context/InputAccessoriesContext.js +16 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.d.ts +5 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.js +68 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.style.d.ts +17 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.style.js +23 -0
- package/dist/foundationText/InputText/context/index.d.ts +2 -0
- package/dist/foundationText/InputText/context/index.js +2 -0
- package/dist/foundationText/InputText/context/types.d.ts +23 -0
- package/dist/foundationText/InputText/context/types.js +1 -0
- package/dist/foundationText/InputTime/InputTime.d.ts +63 -0
- package/dist/foundationText/InputTime/InputTime.js +76 -0
- package/dist/foundationText/InputTime/InputTime.style.d.ts +6 -0
- package/dist/foundationText/InputTime/InputTime.style.js +7 -0
- package/dist/foundationText/InputTime/index.d.ts +2 -0
- package/dist/foundationText/InputTime/index.js +2 -0
- package/dist/foundationText/InputTime/utils/index.d.ts +11 -0
- package/dist/foundationText/InputTime/utils/index.js +16 -0
- package/dist/foundationText/ProgressBar/ProgressBar.d.ts +6 -0
- package/dist/foundationText/ProgressBar/ProgressBar.js +36 -0
- package/dist/foundationText/ProgressBar/ProgressBar.size.style.d.ts +11 -0
- package/dist/foundationText/ProgressBar/ProgressBar.size.style.js +6 -0
- package/dist/foundationText/ProgressBar/ProgressBar.style.d.ts +34 -0
- package/dist/foundationText/ProgressBar/ProgressBar.style.js +37 -0
- package/dist/foundationText/ProgressBar/ProgressBarInner.d.ts +12 -0
- package/dist/foundationText/ProgressBar/ProgressBarInner.js +25 -0
- package/dist/foundationText/ProgressBar/ProgressBarStepped.d.ts +12 -0
- package/dist/foundationText/ProgressBar/ProgressBarStepped.js +32 -0
- package/dist/foundationText/ProgressBar/index.d.ts +2 -0
- package/dist/foundationText/ProgressBar/index.js +1 -0
- package/dist/foundationText/ProgressBar/types.d.ts +61 -0
- package/dist/foundationText/ProgressBar/types.js +1 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.d.ts +3 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.js +105 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.size.style.d.ts +19 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.size.style.js +15 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.style.d.ts +48 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.style.js +51 -0
- package/dist/foundationText/ProgressIndicator/index.d.ts +2 -0
- package/dist/foundationText/ProgressIndicator/index.js +1 -0
- package/dist/foundationText/ProgressIndicator/types.d.ts +44 -0
- package/dist/foundationText/ProgressIndicator/types.js +1 -0
- package/dist/foundationText/Select/Select.d.ts +92 -0
- package/dist/foundationText/Select/Select.js +102 -0
- package/dist/foundationText/Select/Select.style.d.ts +29 -0
- package/dist/foundationText/Select/Select.style.js +55 -0
- package/dist/foundationText/Select/SelectComposableTypes.d.ts +50 -0
- package/dist/foundationText/Select/SelectComposableTypes.js +1 -0
- package/dist/foundationText/Select/SelectRoot.d.ts +12 -0
- package/dist/foundationText/Select/SelectRoot.js +69 -0
- package/dist/foundationText/Select/SelectRoot.style.d.ts +8 -0
- package/dist/foundationText/Select/SelectRoot.style.js +9 -0
- package/dist/foundationText/Select/components/SelectContent.d.ts +8 -0
- package/dist/foundationText/Select/components/SelectContent.js +34 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.js +22 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.js +15 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.d.ts +30 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.js +29 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectFieldContext.d.ts +27 -0
- package/dist/foundationText/Select/components/SelectFieldContext.js +10 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/SelectIOSPicker.d.ts +10 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/SelectIOSPicker.js +2 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +3 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/SelectInternalPicker.js +14 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/utils.d.ts +3 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/utils.js +13 -0
- package/dist/foundationText/Select/components/SelectItem.d.ts +32 -0
- package/dist/foundationText/Select/components/SelectItem.js +26 -0
- package/dist/foundationText/Select/components/SelectItem.style.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectItem.style.js +6 -0
- package/dist/foundationText/Select/components/SelectLabel.d.ts +22 -0
- package/dist/foundationText/Select/components/SelectLabel.js +30 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.d.ts +11 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.js +17 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.style.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.style.js +8 -0
- package/dist/foundationText/Select/components/SelectPressable/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectPressable/index.js +1 -0
- package/dist/foundationText/Select/components/SelectTrigger.d.ts +20 -0
- package/dist/foundationText/Select/components/SelectTrigger.js +39 -0
- package/dist/foundationText/Select/components/SelectTrigger.style.d.ts +25 -0
- package/dist/foundationText/Select/components/SelectTrigger.style.js +31 -0
- package/dist/foundationText/Select/index.d.ts +4 -0
- package/dist/foundationText/Select/index.js +4 -0
- package/dist/foundationText/Select/types.d.ts +38 -0
- package/dist/foundationText/Select/types.js +1 -0
- package/dist/foundationText/StatusLabel/StatusLabel.d.ts +22 -0
- package/dist/foundationText/StatusLabel/StatusLabel.js +20 -0
- package/dist/foundationText/StatusLabel/StatusLabel.style.d.ts +23 -0
- package/dist/foundationText/StatusLabel/StatusLabel.style.js +29 -0
- package/dist/foundationText/StatusLabel/index.d.ts +2 -0
- package/dist/foundationText/StatusLabel/index.js +1 -0
- package/dist/foundationText/Text/Text.d.ts +76 -0
- package/dist/foundationText/Text/Text.js +39 -0
- package/dist/foundationText/Text/index.d.ts +2 -0
- package/dist/foundationText/Text/index.js +1 -0
- package/dist/foundationText/TextList/TextList.d.ts +30 -0
- package/dist/foundationText/TextList/TextList.js +11 -0
- package/dist/foundationText/TextList/TextList.style.d.ts +14 -0
- package/dist/foundationText/TextList/TextList.style.js +17 -0
- package/dist/foundationText/TextList/index.d.ts +1 -0
- package/dist/foundationText/TextList/index.js +1 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.d.ts +5 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.js +32 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.style.d.ts +47 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.style.js +50 -0
- package/dist/foundationText/ThumbnailList/index.d.ts +2 -0
- package/dist/foundationText/ThumbnailList/index.js +2 -0
- package/dist/foundationText/ThumbnailList/types.d.ts +15 -0
- package/dist/foundationText/ThumbnailList/types.js +5 -0
- package/dist/foundationText/Toast/Toast.d.ts +28 -0
- package/dist/foundationText/Toast/Toast.js +64 -0
- package/dist/foundationText/Toast/Toast.styles.d.ts +31 -0
- package/dist/foundationText/Toast/Toast.styles.js +31 -0
- package/dist/foundationText/Toast/index.d.ts +2 -0
- package/dist/foundationText/Toast/index.js +1 -0
- package/dist/foundationText/Typography/Typography.d.ts +126 -0
- package/dist/foundationText/Typography/Typography.js +124 -0
- package/dist/foundationText/Typography/Typography.style.d.ts +16 -0
- package/dist/foundationText/Typography/Typography.style.js +472 -0
- package/dist/foundationText/Typography/TypographyGestureDetector.d.ts +8 -0
- package/dist/foundationText/Typography/TypographyGestureDetector.js +11 -0
- package/dist/foundationText/Typography/index.d.ts +5 -0
- package/dist/foundationText/Typography/index.js +4 -0
- package/dist/foundationText/Typography/webFonts.d.ts +4 -0
- package/dist/foundationText/Typography/webFonts.js +34 -0
- package/dist/foundationText/capitalize.d.ts +1 -0
- package/dist/foundationText/capitalize.js +6 -0
- package/dist/foundationText/compatTheme.d.ts +8 -0
- package/dist/foundationText/compatTheme.js +14 -0
- package/dist/foundationText/dateFormatter.d.ts +6 -0
- package/dist/foundationText/dateFormatter.js +19 -0
- package/dist/foundationText/foundationMessages.d.ts +11 -0
- package/dist/foundationText/foundationMessages.js +24 -0
- package/dist/foundationText/messages-en.d.ts +38 -0
- package/dist/foundationText/messages-en.js +38 -0
- package/dist/foundationText/messages-es.d.ts +38 -0
- package/dist/foundationText/messages-es.js +38 -0
- package/dist/foundationText/primitives/HelperText/HelperText.d.ts +15 -0
- package/dist/foundationText/primitives/HelperText/HelperText.js +11 -0
- package/dist/foundationText/primitives/HelperText/HelperText.style.d.ts +16 -0
- package/dist/foundationText/primitives/HelperText/HelperText.style.js +19 -0
- package/dist/foundationText/primitives/HelperText/index.d.ts +2 -0
- package/dist/foundationText/primitives/HelperText/index.js +1 -0
- package/dist/foundationText/primitives/Portal/index.d.ts +1 -0
- package/dist/foundationText/primitives/Portal/index.js +7 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.d.ts +69 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.js +160 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.style.d.ts +114 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.style.js +130 -0
- package/dist/foundationText/primitives/Select/index.d.ts +2 -0
- package/dist/foundationText/primitives/Select/index.js +1 -0
- package/dist/foundationText/primitives/Select/nativeTypes.d.ts +84 -0
- package/dist/foundationText/primitives/Select/nativeTypes.js +1 -0
- package/dist/foundationText/primitives/Select/types.d.ts +41 -0
- package/dist/foundationText/primitives/Select/types.js +1 -0
- package/dist/foundationText/primitives/index.d.ts +3 -0
- package/dist/foundationText/primitives/index.js +3 -0
- package/dist/foundationTokens.d.ts +388 -0
- package/dist/foundationTokens.js +26 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +54 -0
- package/dist/legacyTheme.d.ts +18 -0
- package/dist/legacyTheme.js +23 -0
- package/dist/sheetContext.d.ts +3 -0
- package/dist/sheetContext.js +6 -0
- package/dist/theme.d.ts +29 -0
- package/dist/theme.js +42 -0
- package/dist/useFormController.d.ts +11 -0
- package/dist/useFormController.js +15 -0
- package/dist/useIsScreenReaderEnabled.d.ts +1 -0
- package/dist/useIsScreenReaderEnabled.js +21 -0
- package/ios/RulnarPickerManager.m +59 -0
- package/package.json +146 -4
- package/resources/meta.json +85 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
container: {
|
|
3
|
+
flex: number;
|
|
4
|
+
flexGrow: number;
|
|
5
|
+
width: "100%";
|
|
6
|
+
};
|
|
7
|
+
safeArea: {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
};
|
|
10
|
+
scrollContentContainer: {
|
|
11
|
+
flexGrow: number;
|
|
12
|
+
};
|
|
13
|
+
scrollView: {
|
|
14
|
+
flexGrow: number;
|
|
15
|
+
};
|
|
16
|
+
formChildContainer: {
|
|
17
|
+
flexGrow: number;
|
|
18
|
+
justifyContent: "flex-start";
|
|
19
|
+
};
|
|
20
|
+
activityIndicator: {
|
|
21
|
+
marginVertical: number;
|
|
22
|
+
flex: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
container: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
flexGrow: 1,
|
|
7
|
+
width: "100%",
|
|
8
|
+
},
|
|
9
|
+
safeArea: {
|
|
10
|
+
backgroundColor: tokens["color-surface"],
|
|
11
|
+
},
|
|
12
|
+
scrollContentContainer: {
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
},
|
|
15
|
+
scrollView: {
|
|
16
|
+
flexGrow: 1,
|
|
17
|
+
},
|
|
18
|
+
formChildContainer: {
|
|
19
|
+
flexGrow: 1,
|
|
20
|
+
justifyContent: "flex-start",
|
|
21
|
+
},
|
|
22
|
+
activityIndicator: {
|
|
23
|
+
marginVertical: tokens["space-base"],
|
|
24
|
+
flex: 1,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormBody, useBottomPadding } from "./FormBody.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormBody, useBottomPadding } from "./FormBody.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DeepPartial, FieldValues } from "react-hook-form";
|
|
3
|
+
interface FormCacheProps<T extends FieldValues> {
|
|
4
|
+
readonly localCacheId?: string | string[];
|
|
5
|
+
readonly localCacheKey?: string;
|
|
6
|
+
readonly localCacheExclude?: string[];
|
|
7
|
+
readonly setLocalCache: (data: DeepPartial<T>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function FormCache<T extends FieldValues>({ localCacheExclude, localCacheKey, setLocalCache, }: FormCacheProps<T>): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
4
|
+
import omit from "lodash/omit.js";
|
|
5
|
+
export function FormCache({ localCacheExclude, localCacheKey, setLocalCache, }) {
|
|
6
|
+
const { control, formState } = useFormContext();
|
|
7
|
+
const { isDirty } = formState;
|
|
8
|
+
const formData = useWatch({ control });
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
!localCacheKey &&
|
|
11
|
+
console.log("No `localCacheKey` specified on Form. Local copy of form data is now disabled.");
|
|
12
|
+
}, [localCacheKey]);
|
|
13
|
+
/**
|
|
14
|
+
* Automatically save form data locally
|
|
15
|
+
*/
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!isDirty)
|
|
18
|
+
return;
|
|
19
|
+
if (Array.isArray(localCacheExclude) && localCacheExclude.length > 0) {
|
|
20
|
+
setLocalCache(omit(formData, localCacheExclude));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
setLocalCache(formData);
|
|
24
|
+
}
|
|
25
|
+
}, [formData, isDirty, localCacheExclude, setLocalCache]);
|
|
26
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
27
|
+
return _jsx(_Fragment, {});
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Banner } from "../../../Banner/index.js";
|
|
4
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
5
|
+
export function FormErrorBanner({ networkError, bannerError, }) {
|
|
6
|
+
const { t } = useComponentMessages();
|
|
7
|
+
if (networkError) {
|
|
8
|
+
return _jsx(Banner, { type: "error", children: t("errors.couldNotSave") });
|
|
9
|
+
}
|
|
10
|
+
else if (bannerError) {
|
|
11
|
+
return (_jsx(Banner, { text: bannerError.title, ...(bannerError.messages !== undefined && { details: bannerError.messages }), type: "error" }));
|
|
12
|
+
}
|
|
13
|
+
return _jsx(_Fragment, {});
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormErrorBanner } from "./FormErrorBanner.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormErrorBanner } from "./FormErrorBanner.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./FormMask.style.js";
|
|
5
|
+
import { ActivityIndicator } from "../../../ActivityIndicator/index.js";
|
|
6
|
+
export function FormMask() {
|
|
7
|
+
const styles = useStyles();
|
|
8
|
+
return (_jsx(View, { style: styles.mask, children: _jsx(ActivityIndicator, {}) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
mask: {
|
|
5
|
+
zIndex: tokens["elevation-modal"],
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
position: "absolute",
|
|
9
|
+
top: 0,
|
|
10
|
+
left: 0,
|
|
11
|
+
backgroundColor: tokens["color-overlay--dimmed"],
|
|
12
|
+
padding: tokens["space-base"],
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMask } from "./FormMask.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMask } from "./FormMask.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { EmptyStateProps } from "../../../EmptyState/index.js";
|
|
3
|
+
type FormMessageData = EmptyStateProps;
|
|
4
|
+
/**
|
|
5
|
+
* Show a message that takes over the whole screen to the user. This provides a
|
|
6
|
+
* more urgent feedback when the user does an action that requires attention
|
|
7
|
+
* their full attention.
|
|
8
|
+
*
|
|
9
|
+
* By default, rendering `<FormMessage />` on a screen won't show any messages
|
|
10
|
+
* because it's only a container. Use `FormMessage.open(...)`. to show a
|
|
11
|
+
* message to the user. Use `FormMessage.close()` to close the most
|
|
12
|
+
* recent message.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FormMessage: {
|
|
15
|
+
(): React.JSX.Element | null;
|
|
16
|
+
show(messageData: FormMessageData): void;
|
|
17
|
+
close(): void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useState } from "react";
|
|
3
|
+
import { InternalFormMessage } from "./components/InternalFormMessage/index.js";
|
|
4
|
+
let open;
|
|
5
|
+
let close;
|
|
6
|
+
/**
|
|
7
|
+
* Show a message that takes over the whole screen to the user. This provides a
|
|
8
|
+
* more urgent feedback when the user does an action that requires attention
|
|
9
|
+
* their full attention.
|
|
10
|
+
*
|
|
11
|
+
* By default, rendering `<FormMessage />` on a screen won't show any messages
|
|
12
|
+
* because it's only a container. Use `FormMessage.open(...)`. to show a
|
|
13
|
+
* message to the user. Use `FormMessage.close()` to close the most
|
|
14
|
+
* recent message.
|
|
15
|
+
*/
|
|
16
|
+
export const FormMessage = () => {
|
|
17
|
+
const [data, setData] = useState([]);
|
|
18
|
+
open = useCallback((messageData) => {
|
|
19
|
+
setData([...data, messageData]);
|
|
20
|
+
}, [data]);
|
|
21
|
+
close = useCallback(() => {
|
|
22
|
+
const newValue = data.slice(0, -1);
|
|
23
|
+
setData(newValue);
|
|
24
|
+
}, [data]);
|
|
25
|
+
if (data.length === 0) {
|
|
26
|
+
return _jsx(_Fragment, {});
|
|
27
|
+
}
|
|
28
|
+
const lastMessage = data.at(-1);
|
|
29
|
+
return lastMessage ? _jsx(InternalFormMessage, { data: lastMessage, onRequestClose: close }) : null;
|
|
30
|
+
};
|
|
31
|
+
FormMessage.show = (messageData) => {
|
|
32
|
+
if (open) {
|
|
33
|
+
open(messageData);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
warnOnUndefinedFunctions("show");
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
FormMessage.close = () => {
|
|
40
|
+
if (close) {
|
|
41
|
+
close();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
warnOnUndefinedFunctions("close");
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function warnOnUndefinedFunctions(method) {
|
|
48
|
+
console.warn(`Could not ${method} "FormMessage". Either you're calling this method before the component mounts or you're using this without the "<Form />" component. If you're using "FormMessage" without the "Form", include "<FormMessage />" on your component to start using it.`);
|
|
49
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { EmptyStateProps } from "../../../../../EmptyState/index.js";
|
|
3
|
+
interface FormMessageProps {
|
|
4
|
+
readonly data: EmptyStateProps;
|
|
5
|
+
readonly onRequestClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function InternalFormMessage({ data, onRequestClose, }: FormMessageProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { Modal, StatusBar, View } from "react-native";
|
|
5
|
+
import { ScrollView } from "react-native-gesture-handler";
|
|
6
|
+
import { useStyles } from "./InternalFormMessage.style.js";
|
|
7
|
+
import { EmptyState } from "../../../../../EmptyState/index.js";
|
|
8
|
+
import { useComponentMessages } from "../../../../../foundationMessages.js";
|
|
9
|
+
export function InternalFormMessage({ data, onRequestClose, }) {
|
|
10
|
+
const { t } = useComponentMessages();
|
|
11
|
+
const styles = useStyles();
|
|
12
|
+
const emptyStateData = useMemo(() => {
|
|
13
|
+
if (data.secondaryAction) {
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return {
|
|
18
|
+
...data,
|
|
19
|
+
secondaryAction: {
|
|
20
|
+
label: t("goBack"),
|
|
21
|
+
onPress: onRequestClose,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}, [data, t, onRequestClose]);
|
|
26
|
+
return (_jsx(Modal, { animationType: "fade", transparent: true, visible: true, onRequestClose: onRequestClose, children: _jsxs(View, { style: styles.wrapper, children: [_jsx(StatusBar, { barStyle: "dark-content" }), _jsx(SafeAreaView, { children: _jsx(ScrollView, { style: styles.scrollWrapper, contentContainerStyle: styles.scrollWrapperContent, centerContent: true, children: _jsx(EmptyState, { ...emptyStateData }) }) })] }) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
wrapper: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
flex: number;
|
|
5
|
+
justifyContent: "center";
|
|
6
|
+
};
|
|
7
|
+
closeAction: {
|
|
8
|
+
position: "absolute";
|
|
9
|
+
top: number;
|
|
10
|
+
right: number;
|
|
11
|
+
zIndex: number;
|
|
12
|
+
};
|
|
13
|
+
scrollWrapper: {
|
|
14
|
+
height: "100%";
|
|
15
|
+
};
|
|
16
|
+
scrollWrapperContent: {
|
|
17
|
+
flexGrow: number;
|
|
18
|
+
justifyContent: "center";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
wrapper: {
|
|
5
|
+
backgroundColor: tokens["color-surface"],
|
|
6
|
+
flex: 1,
|
|
7
|
+
justifyContent: "center",
|
|
8
|
+
},
|
|
9
|
+
closeAction: {
|
|
10
|
+
position: "absolute",
|
|
11
|
+
top: 0,
|
|
12
|
+
right: 0,
|
|
13
|
+
zIndex: 1,
|
|
14
|
+
},
|
|
15
|
+
scrollWrapper: { height: "100%" },
|
|
16
|
+
scrollWrapperContent: { flexGrow: 1, justifyContent: "center" },
|
|
17
|
+
};
|
|
18
|
+
});
|
package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InternalFormMessage } from "./InternalFormMessage.js";
|
package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InternalFormMessage } from "./InternalFormMessage.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMessage } from "./FormMessage.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMessage } from "./FormMessage.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormBannerMessage } from "../../types.js";
|
|
3
|
+
interface FormMessageBannerProps {
|
|
4
|
+
readonly bannerMessages?: FormBannerMessage[];
|
|
5
|
+
}
|
|
6
|
+
export declare function FormMessageBanner({ bannerMessages }: FormMessageBannerProps): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormBannerMessageType } from "../../types.js";
|
|
4
|
+
import { Banner } from "../../../Banner/index.js";
|
|
5
|
+
export function FormMessageBanner({ bannerMessages }) {
|
|
6
|
+
return (_jsx(_Fragment, { children: bannerMessages?.map((message, index) => (_jsx(Banner, { text: message.message, type: getBannerType(message.messageType) }, index))) }));
|
|
7
|
+
}
|
|
8
|
+
function getBannerType(messageType) {
|
|
9
|
+
switch (messageType) {
|
|
10
|
+
case FormBannerMessageType.WarningMessage:
|
|
11
|
+
return "warning";
|
|
12
|
+
case FormBannerMessageType.NoticeMessage:
|
|
13
|
+
default:
|
|
14
|
+
return "notice";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMessageBanner } from "./FormMessageBanner.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMessageBanner } from "./FormMessageBanner.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormSaveButtonProps } from "../../types.js";
|
|
3
|
+
export declare function FormSaveButton({ primaryAction, loading, label, secondaryActions, setSecondaryActionLoading, onOpenBottomSheet, onCloseBottomSheet, }: FormSaveButtonProps): React.JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useFormContext } from "react-hook-form";
|
|
4
|
+
import { ButtonGroup } from "../../../ButtonGroup/index.js";
|
|
5
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
6
|
+
export function FormSaveButton({ primaryAction, loading, label, secondaryActions, setSecondaryActionLoading, onOpenBottomSheet, onCloseBottomSheet, }) {
|
|
7
|
+
const { t } = useComponentMessages();
|
|
8
|
+
const formContext = useFormContext();
|
|
9
|
+
const buttonActions = useButtonGroupAction(secondaryActions);
|
|
10
|
+
return (_jsx(ButtonGroup, { ...(onOpenBottomSheet !== undefined && { onOpenBottomSheet: onOpenBottomSheet }), ...(onCloseBottomSheet !== undefined && { onCloseBottomSheet: onCloseBottomSheet }), allowTapWhenOffline: true, children: buttonActions.map((action, index) => {
|
|
11
|
+
if (index === 0) {
|
|
12
|
+
return (_jsx(ButtonGroup.PrimaryAction, { onPress: primaryAction, label: label ?? t("save"), loading: loading }, index));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return (_jsx(ButtonGroup.SecondaryAction, { label: action.label, ...(action.icon !== undefined && { icon: action.icon }), onPress: action.onPress, ...(action.destructive !== undefined && { destructive: action.destructive }) }, index));
|
|
16
|
+
}
|
|
17
|
+
}) }));
|
|
18
|
+
function useButtonGroupAction(array) {
|
|
19
|
+
const buttonGroupActionProps = array
|
|
20
|
+
? array.map(arr => {
|
|
21
|
+
return {
|
|
22
|
+
label: arr.label,
|
|
23
|
+
onPress: () => internalOnPress(arr.handleAction),
|
|
24
|
+
...(arr.destructive !== undefined && { destructive: arr.destructive }),
|
|
25
|
+
...(arr.icon !== undefined && { icon: arr.icon }),
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
: [];
|
|
29
|
+
buttonGroupActionProps.unshift({
|
|
30
|
+
label: label ?? t("save"),
|
|
31
|
+
onPress: primaryAction,
|
|
32
|
+
loading: loading,
|
|
33
|
+
});
|
|
34
|
+
return buttonGroupActionProps;
|
|
35
|
+
}
|
|
36
|
+
async function internalOnPress(handleAction) {
|
|
37
|
+
let performSubmit = true;
|
|
38
|
+
if (handleAction.onBeforeSubmit) {
|
|
39
|
+
performSubmit = await handleAction.onBeforeSubmit();
|
|
40
|
+
}
|
|
41
|
+
if (performSubmit) {
|
|
42
|
+
setSecondaryActionLoading?.(true);
|
|
43
|
+
handleAction
|
|
44
|
+
.onSubmit(primaryAction)
|
|
45
|
+
.then(() => {
|
|
46
|
+
handleAction.resetFormOnSubmit && formContext.reset();
|
|
47
|
+
handleAction.onSubmitSuccess?.();
|
|
48
|
+
})
|
|
49
|
+
.catch(handleAction.onSubmitError)
|
|
50
|
+
.finally(() => {
|
|
51
|
+
setSecondaryActionLoading?.(false);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormSaveButton } from "./FormSaveButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormSaveButton } from "./FormSaveButton.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Platform, View } from "react-native";
|
|
4
|
+
/**
|
|
5
|
+
* This is a spacer to help prevent issues with the KeyboardAwareScrollView on iOS.
|
|
6
|
+
* This will be removed as a part of JOB-147156
|
|
7
|
+
*/
|
|
8
|
+
export function IOSKeyboardAwareScrollViewSpacer() {
|
|
9
|
+
if (Platform.OS === "ios") {
|
|
10
|
+
return _jsx(View, { style: { height: 400 } });
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormContextProps } from "./types.js";
|
|
2
|
+
export declare const formContextDefaultValues: {
|
|
3
|
+
useConfirmBeforeBack: () => import("react").RefObject<() => undefined>;
|
|
4
|
+
useInternalFormLocalCache: () => {
|
|
5
|
+
setLocalCache: () => undefined;
|
|
6
|
+
removeLocalCache: () => undefined;
|
|
7
|
+
};
|
|
8
|
+
edgeToEdgeEnabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const FormContext: import("react").Context<FormContextProps>;
|
|
11
|
+
export declare function useFormContext(): FormContextProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext, useRef } from "react";
|
|
2
|
+
export const formContextDefaultValues = {
|
|
3
|
+
useConfirmBeforeBack: () => {
|
|
4
|
+
const ref = useRef(() => undefined);
|
|
5
|
+
return ref;
|
|
6
|
+
},
|
|
7
|
+
useInternalFormLocalCache: () => ({
|
|
8
|
+
setLocalCache: () => undefined,
|
|
9
|
+
removeLocalCache: () => undefined,
|
|
10
|
+
}),
|
|
11
|
+
edgeToEdgeEnabled: false,
|
|
12
|
+
};
|
|
13
|
+
export const FormContext = createContext(formContextDefaultValues);
|
|
14
|
+
export function useFormContext() {
|
|
15
|
+
return useContext(FormContext);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormContext, useFormContext, } from "./FormContext.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { DeepPartial, FieldValues, UseFormReturn } from "react-hook-form";
|
|
3
|
+
export interface UseConfirmBeforeBackProps {
|
|
4
|
+
alwaysPreventBack: boolean;
|
|
5
|
+
onAcceptEvent?: () => void;
|
|
6
|
+
shouldShowAlert: boolean;
|
|
7
|
+
showLostProgressMessage?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface LocalCacheOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Allows the ability to specify that the cached data contains pre-filled data.
|
|
12
|
+
* By setting this the cached data will only be applied if the same id is based
|
|
13
|
+
* for the same key. If the id doesn't match the data will be deleted from the
|
|
14
|
+
* cache.
|
|
15
|
+
*/
|
|
16
|
+
readonly id?: string | string[];
|
|
17
|
+
}
|
|
18
|
+
export interface FormContextProps {
|
|
19
|
+
useConfirmBeforeBack: (props: UseConfirmBeforeBackProps) => RefObject<() => void>;
|
|
20
|
+
useInternalFormLocalCache: <TData extends FieldValues>(formMethods: UseFormReturn<TData>, cacheKey?: string, options?: LocalCacheOptions) => {
|
|
21
|
+
setLocalCache: (data: DeepPartial<TData>) => void;
|
|
22
|
+
removeLocalCache: () => void;
|
|
23
|
+
};
|
|
24
|
+
edgeToEdgeEnabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
import type { KeyboardAwareScrollViewRef } from "react-native-keyboard-controller";
|
|
4
|
+
interface UseFormViewRefsReturn {
|
|
5
|
+
readonly scrollViewRef: RefObject<KeyboardAwareScrollViewRef | null>;
|
|
6
|
+
readonly bottomViewRef: RefObject<View | null>;
|
|
7
|
+
readonly scrollToTop: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useFormViewRefs(): UseFormViewRefsReturn;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
export function useFormViewRefs() {
|
|
3
|
+
const scrollViewRef = useRef(null);
|
|
4
|
+
const bottomViewRef = useRef(null);
|
|
5
|
+
const scrollToTop = useCallback(() => {
|
|
6
|
+
scrollViewRef.current?.scrollTo({ x: 0, y: 0, animated: true });
|
|
7
|
+
}, [scrollViewRef]);
|
|
8
|
+
return {
|
|
9
|
+
scrollViewRef: scrollViewRef,
|
|
10
|
+
bottomViewRef,
|
|
11
|
+
scrollToTop,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeepPartial, FieldValues, UseFormHandleSubmit, UseFormReturn } from "react-hook-form";
|
|
2
|
+
import type { RefObject } from "react";
|
|
3
|
+
import type { KeyboardAwareScrollViewRef } from "react-native-keyboard-controller";
|
|
4
|
+
import type { InternalFormProps } from "../types.js";
|
|
5
|
+
type UseInternalFormProps<T extends FieldValues, SubmitResponseType> = Pick<InternalFormProps<T, SubmitResponseType>, "mode" | "reValidateMode" | "initialValues" | "formRef" | "localCacheKey" | "localCacheExclude" | "localCacheId" | "UNSAFE_allowDiscardLocalCacheWhenOffline"> & {
|
|
6
|
+
scrollViewRef?: RefObject<KeyboardAwareScrollViewRef | null>;
|
|
7
|
+
readonly saveButtonHeight: number;
|
|
8
|
+
readonly messageBannerHeight: number;
|
|
9
|
+
};
|
|
10
|
+
interface UseInternalForm<T extends FieldValues> {
|
|
11
|
+
readonly formMethods: UseFormReturn<T>;
|
|
12
|
+
readonly handleSubmit: UseFormHandleSubmit<T>;
|
|
13
|
+
readonly isSubmitting: boolean;
|
|
14
|
+
readonly isDirty: boolean;
|
|
15
|
+
readonly removeListenerRef: RefObject<() => void>;
|
|
16
|
+
readonly setLocalCache: (data: DeepPartial<T>) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function useInternalForm<T extends FieldValues, SubmitResponseType>({ mode, reValidateMode, initialValues, formRef, localCacheKey, localCacheId, scrollViewRef, saveButtonHeight, messageBannerHeight, UNSAFE_allowDiscardLocalCacheWhenOffline, }: UseInternalFormProps<T, SubmitResponseType>): UseInternalForm<T>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useForm } from "react-hook-form";
|
|
2
|
+
import { useComponentSettings } from "../../ComponentSettingsContext/index.js";
|
|
3
|
+
import { useFormContext } from "../context/FormContext.js";
|
|
4
|
+
export function useInternalForm({ mode, reValidateMode, initialValues, formRef, localCacheKey, localCacheId, scrollViewRef, saveButtonHeight, messageBannerHeight, UNSAFE_allowDiscardLocalCacheWhenOffline = false, }) {
|
|
5
|
+
const { useConfirmBeforeBack, useInternalFormLocalCache } = useFormContext();
|
|
6
|
+
const { isOnline } = useComponentSettings();
|
|
7
|
+
const formMethods = useForm({
|
|
8
|
+
...(mode !== undefined && { mode }),
|
|
9
|
+
...(reValidateMode !== undefined && { reValidateMode }),
|
|
10
|
+
...(initialValues !== undefined && { defaultValues: initialValues }),
|
|
11
|
+
shouldFocusError: false,
|
|
12
|
+
});
|
|
13
|
+
const clientSideSaveOn = localCacheKey && localCacheKey !== "INVALID";
|
|
14
|
+
const { setLocalCache, removeLocalCache } = useInternalFormLocalCache(formMethods, localCacheKey, {
|
|
15
|
+
...(localCacheId !== undefined && { id: localCacheId }),
|
|
16
|
+
});
|
|
17
|
+
const { handleSubmit, formState: { isSubmitting, isDirty }, } = formMethods;
|
|
18
|
+
if (formRef) {
|
|
19
|
+
formRef.current = {
|
|
20
|
+
...formMethods,
|
|
21
|
+
saveButtonHeight,
|
|
22
|
+
messageBannerHeight,
|
|
23
|
+
...(scrollViewRef !== undefined && { scrollViewRef }),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const shouldRemoveCacheOnBack = UNSAFE_allowDiscardLocalCacheWhenOffline
|
|
27
|
+
? true
|
|
28
|
+
: isOnline;
|
|
29
|
+
const removeListenerRef = useConfirmBeforeBack({
|
|
30
|
+
alwaysPreventBack: isSubmitting,
|
|
31
|
+
shouldShowAlert: isDirty,
|
|
32
|
+
...(shouldRemoveCacheOnBack && { onAcceptEvent: removeLocalCache }),
|
|
33
|
+
showLostProgressMessage: shouldRemoveCacheOnBack || !clientSideSaveOn ? true : false,
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
setLocalCache,
|
|
37
|
+
formMethods,
|
|
38
|
+
handleSubmit,
|
|
39
|
+
isSubmitting,
|
|
40
|
+
isDirty,
|
|
41
|
+
removeListenerRef,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useOfflineHandler(): (callback: () => void, dismiss: () => void) => () => void;
|