@oneblink/apps-react 2.2.0 → 2.3.0-beta.2
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/dist/OneBlinkAutoSaveForm.d.ts +10 -10
- package/dist/OneBlinkAutoSaveForm.js +28 -28
- package/dist/OneBlinkForm.d.ts +11 -11
- package/dist/OneBlinkForm.js +11 -11
- package/dist/OneBlinkFormBase.d.ts +28 -28
- package/dist/OneBlinkFormBase.js +472 -472
- package/dist/OneBlinkFormStoreView.d.ts +8 -0
- package/dist/OneBlinkFormStoreView.js +55 -0
- package/dist/OneBlinkFormStoreView.js.map +1 -0
- package/dist/OneBlinkReadOnlyForm.d.ts +11 -11
- package/dist/OneBlinkReadOnlyForm.js +48 -48
- package/dist/components/AnnotationModal.d.ts +8 -0
- package/dist/components/AnnotationModal.js +104 -0
- package/dist/components/AnnotationModal.js.map +1 -0
- package/dist/components/AutocompleteDropdown.d.ts +26 -0
- package/dist/components/AutocompleteDropdown.js +174 -0
- package/dist/components/AutocompleteDropdown.js.map +1 -0
- package/dist/components/CopyToClipboardButton.d.ts +9 -0
- package/dist/components/CopyToClipboardButton.js +14 -0
- package/dist/components/CopyToClipboardButton.js.map +1 -0
- package/dist/components/CopyToClipboardIconButton.d.ts +10 -10
- package/dist/components/CopyToClipboardIconButton.js +32 -32
- package/dist/components/CustomAccordion.d.ts +27 -27
- package/dist/components/CustomAccordion.js +37 -37
- package/dist/components/CustomisableButtonInner.d.ts +7 -0
- package/dist/components/CustomisableButtonInner.js +9 -0
- package/dist/components/CustomisableButtonInner.js.map +1 -0
- package/dist/components/ErrorMessage.d.ts +13 -0
- package/dist/components/ErrorMessage.js +13 -0
- package/dist/components/ErrorMessage.js.map +1 -0
- package/dist/components/ErrorSnackbar.d.ts +8 -8
- package/dist/components/ErrorSnackbar.js +25 -25
- package/dist/components/FormElementLabelContainer.d.ts +12 -0
- package/dist/components/FormElementLabelContainer.js +16 -0
- package/dist/components/FormElementLabelContainer.js.map +1 -0
- package/dist/components/FormElementOptions.d.ts +9 -0
- package/dist/components/FormElementOptions.js +15 -0
- package/dist/components/FormElementOptions.js.map +1 -0
- package/dist/components/Lists.d.ts +25 -25
- package/dist/components/Lists.js +44 -44
- package/dist/components/LoadingWithMessage.d.ts +6 -6
- package/dist/components/LoadingWithMessage.js +11 -11
- package/dist/components/LookupButton.d.ts +10 -0
- package/dist/components/LookupButton.js +30 -0
- package/dist/components/LookupButton.js.map +1 -0
- package/dist/components/LookupNotification.d.ts +12 -0
- package/dist/components/LookupNotification.js +231 -0
- package/dist/components/LookupNotification.js.map +1 -0
- package/dist/components/Modal.d.ts +14 -0
- package/dist/components/Modal.js +15 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/NoResourcesYet.d.ts +12 -0
- package/dist/components/NoResourcesYet.js +7 -0
- package/dist/components/NoResourcesYet.js.map +1 -0
- package/dist/components/OnLoading.d.ts +10 -0
- package/dist/components/OnLoading.js +12 -0
- package/dist/components/OnLoading.js.map +1 -0
- package/dist/components/OneBlinkAppsErrorOriginalMessage.d.ts +7 -0
- package/dist/components/OneBlinkAppsErrorOriginalMessage.js +13 -0
- package/dist/components/OneBlinkAppsErrorOriginalMessage.js.map +1 -0
- package/dist/components/OneBlinkFormElements.d.ts +19 -0
- package/dist/components/OneBlinkFormElements.js +196 -0
- package/dist/components/OneBlinkFormElements.js.map +1 -0
- package/dist/components/PageFormElements.d.ts +17 -0
- package/dist/components/PageFormElements.js +49 -0
- package/dist/components/PageFormElements.js.map +1 -0
- package/dist/components/ToggleAllCheckbox.d.ts +13 -0
- package/dist/components/ToggleAllCheckbox.js +27 -0
- package/dist/components/ToggleAllCheckbox.js.map +1 -0
- package/dist/components/attachments/AttachmentStatus.d.ts +12 -0
- package/dist/components/attachments/AttachmentStatus.js +35 -0
- package/dist/components/attachments/AttachmentStatus.js.map +1 -0
- package/dist/components/attachments/FileCard.d.ts +18 -0
- package/dist/components/attachments/FileCard.js +58 -0
- package/dist/components/attachments/FileCard.js.map +1 -0
- package/dist/components/attachments/FileCardContent.d.ts +5 -0
- package/dist/components/attachments/FileCardContent.js +11 -0
- package/dist/components/attachments/FileCardContent.js.map +1 -0
- package/dist/components/attachments/Files.d.ts +14 -0
- package/dist/components/attachments/Files.js +27 -0
- package/dist/components/attachments/Files.js.map +1 -0
- package/dist/components/attachments/ImagePreviewUnavailable.d.ts +4 -0
- package/dist/components/attachments/ImagePreviewUnavailable.js +12 -0
- package/dist/components/attachments/ImagePreviewUnavailable.js.map +1 -0
- package/dist/components/attachments/UploadingAttachment.d.ts +4 -0
- package/dist/components/attachments/UploadingAttachment.js +13 -0
- package/dist/components/attachments/UploadingAttachment.js.map +1 -0
- package/dist/components/formStore/ColumnsConfigurationButton.d.ts +10 -0
- package/dist/components/formStore/ColumnsConfigurationButton.js +29 -0
- package/dist/components/formStore/ColumnsConfigurationButton.js.map +1 -0
- package/dist/components/formStore/DownloadSubmissionDataButton.d.ts +13 -0
- package/dist/components/formStore/DownloadSubmissionDataButton.js +45 -0
- package/dist/components/formStore/DownloadSubmissionDataButton.js.map +1 -0
- package/dist/components/formStore/FormStore.d.ts +9 -0
- package/dist/components/formStore/FormStore.js +103 -0
- package/dist/components/formStore/FormStore.js.map +1 -0
- package/dist/components/formStore/FormStoreTableProvider.d.ts +6 -6
- package/dist/components/formStore/FormStoreTableProvider.js +90 -90
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.d.ts +5 -5
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js +19 -19
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.d.ts +5 -5
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js +66 -66
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.d.ts +5 -5
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js +86 -86
- package/dist/components/formStore/OneBlinkFormStoreProvider.d.ts +8 -8
- package/dist/components/formStore/OneBlinkFormStoreProvider.js +24 -24
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.d.ts +5 -5
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js +11 -11
- package/dist/components/formStore/OneBlinkFormStoreTable.d.ts +4 -4
- package/dist/components/formStore/OneBlinkFormStoreTable.js +194 -194
- package/dist/components/formStore/display/ElementDisplay.d.ts +23 -23
- package/dist/components/formStore/display/ElementDisplay.js +77 -77
- package/dist/components/formStore/display/FormStoreIcon.d.ts +2 -2
- package/dist/components/formStore/display/FormStoreIcon.js +2 -2
- package/dist/components/formStore/table/ActionedByTableCell.d.ts +11 -11
- package/dist/components/formStore/table/ActionedByTableCell.js +43 -43
- package/dist/components/formStore/table/ColumnFilters.d.ts +9 -9
- package/dist/components/formStore/table/ColumnFilters.js +179 -179
- package/dist/components/formStore/table/FormElementTableCell.d.ts +10 -10
- package/dist/components/formStore/table/FormElementTableCell.js +228 -228
- package/dist/components/formStore/table/HeaderCellMoreButton.d.ts +9 -9
- package/dist/components/formStore/table/HeaderCellMoreButton.js +48 -48
- package/dist/components/formStore/table/RepeatableSetCell.d.ts +8 -8
- package/dist/components/formStore/table/RepeatableSetCell.js +62 -62
- package/dist/components/formStore/table/RepeatableSetCellAccordion.d.ts +9 -9
- package/dist/components/formStore/table/RepeatableSetCellAccordion.js +11 -11
- package/dist/components/formStore/table/TableCellCopyButton.d.ts +7 -7
- package/dist/components/formStore/table/TableCellCopyButton.js +27 -27
- package/dist/components/formStore/table/generateColumns.d.ts +24 -24
- package/dist/components/formStore/table/generateColumns.js +290 -290
- package/dist/components/formStore/table/index.d.ts +17 -0
- package/dist/components/formStore/table/index.js +194 -0
- package/dist/components/formStore/table/index.js.map +1 -0
- package/dist/components/formStore/table/useFormStoreTable.d.ts +52 -52
- package/dist/components/formStore/table/useFormStoreTable.js +157 -157
- package/dist/components/formStore/useFormStoreTableContext.d.ts +44 -44
- package/dist/components/formStore/useFormStoreTableContext.js +9 -9
- package/dist/components/messages/ErrorMessage.d.ts +12 -12
- package/dist/components/messages/ErrorMessage.js +12 -12
- package/dist/components/messages/LargeIconMessage.d.ts +18 -18
- package/dist/components/messages/LargeIconMessage.js +33 -33
- package/dist/components/messages/NoResourcesYet.d.ts +11 -11
- package/dist/components/messages/NoResourcesYet.js +6 -6
- package/dist/components/pickers/V4CompatibleDatePicker.d.ts +32 -32
- package/dist/components/pickers/V4CompatibleDatePicker.js +70 -70
- package/dist/components/pickers/V4CompatibleDateTimePicker.d.ts +32 -32
- package/dist/components/pickers/V4CompatibleDateTimePicker.js +70 -70
- package/dist/components/pickers/V4CompatibleTimePicker.d.ts +28 -28
- package/dist/components/pickers/V4CompatibleTimePicker.js +53 -53
- package/dist/components/renderer/AnnotationModal.d.ts +8 -8
- package/dist/components/renderer/AnnotationModal.js +101 -101
- package/dist/components/renderer/AutocompleteDropdown.d.ts +26 -26
- package/dist/components/renderer/AutocompleteDropdown.js +175 -175
- package/dist/components/renderer/CopyToClipboardButton.d.ts +8 -8
- package/dist/components/renderer/CopyToClipboardButton.js +13 -13
- package/dist/components/renderer/CustomisableButtonInner.d.ts +7 -7
- package/dist/components/renderer/CustomisableButtonInner.js +8 -8
- package/dist/components/renderer/FormElementLabelContainer.d.ts +12 -12
- package/dist/components/renderer/FormElementLabelContainer.js +15 -15
- package/dist/components/renderer/FormElementOptions.d.ts +9 -9
- package/dist/components/renderer/FormElementOptions.js +14 -14
- package/dist/components/renderer/LookupButton.d.ts +10 -10
- package/dist/components/renderer/LookupButton.js +29 -29
- package/dist/components/renderer/LookupNotification.d.ts +12 -12
- package/dist/components/renderer/LookupNotification.js +230 -230
- package/dist/components/renderer/Modal.d.ts +14 -14
- package/dist/components/renderer/Modal.js +14 -14
- package/dist/components/renderer/OnLoading.d.ts +10 -10
- package/dist/components/renderer/OnLoading.js +11 -11
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.d.ts +7 -7
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js +12 -12
- package/dist/components/renderer/OneBlinkFormElements.d.ts +19 -19
- package/dist/components/renderer/OneBlinkFormElements.js +202 -202
- package/dist/components/renderer/PageFormElements.d.ts +17 -17
- package/dist/components/renderer/PageFormElements.js +48 -48
- package/dist/components/renderer/ProgressBar.d.ts +7 -0
- package/dist/components/renderer/ProgressBar.js +7 -0
- package/dist/components/renderer/ProgressBar.js.map +1 -0
- package/dist/components/renderer/ToggleAllCheckbox.d.ts +13 -13
- package/dist/components/renderer/ToggleAllCheckbox.js +26 -26
- package/dist/components/renderer/attachments/AttachmentStatus.d.ts +10 -10
- package/dist/components/renderer/attachments/AttachmentStatus.js +36 -30
- package/dist/components/renderer/attachments/AttachmentStatus.js.map +1 -1
- package/dist/components/renderer/attachments/FileCard.d.ts +19 -18
- package/dist/components/renderer/attachments/FileCard.js +60 -57
- package/dist/components/renderer/attachments/FileCard.js.map +1 -1
- package/dist/components/renderer/attachments/FileCardContent.d.ts +5 -5
- package/dist/components/renderer/attachments/FileCardContent.js +10 -10
- package/dist/components/renderer/attachments/Files.d.ts +14 -0
- package/dist/components/renderer/attachments/Files.js +27 -0
- package/dist/components/renderer/attachments/Files.js.map +1 -0
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.d.ts +4 -4
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.js +11 -11
- package/dist/components/renderer/attachments/ProgressBar.d.ts +8 -0
- package/dist/components/renderer/attachments/ProgressBar.js +34 -0
- package/dist/components/renderer/attachments/ProgressBar.js.map +1 -0
- package/dist/components/renderer/attachments/UploadingAttachment.d.ts +4 -4
- package/dist/components/renderer/attachments/UploadingAttachment.js +12 -12
- package/dist/form-elements/ComplianceButton.d.ts +10 -10
- package/dist/form-elements/ComplianceButton.js +11 -11
- package/dist/form-elements/FormElementABN.d.ts +14 -14
- package/dist/form-elements/FormElementABN.js +155 -155
- package/dist/form-elements/FormElementAutocomplete.d.ts +19 -19
- package/dist/form-elements/FormElementAutocomplete.js +81 -81
- package/dist/form-elements/FormElementBSB.d.ts +18 -18
- package/dist/form-elements/FormElementBSB.js +100 -100
- package/dist/form-elements/FormElementBarcodeScanner.d.ts +14 -14
- package/dist/form-elements/FormElementBarcodeScanner.js +306 -306
- package/dist/form-elements/FormElementBoolean.d.ts +14 -14
- package/dist/form-elements/FormElementBoolean.js +16 -16
- package/dist/form-elements/FormElementCalculation.d.ts +11 -11
- package/dist/form-elements/FormElementCalculation.js +179 -179
- package/dist/form-elements/FormElementCamera.d.ts +15 -15
- package/dist/form-elements/FormElementCamera.js +227 -220
- package/dist/form-elements/FormElementCamera.js.map +1 -1
- package/dist/form-elements/FormElementCaptcha.d.ts +12 -12
- package/dist/form-elements/FormElementCaptcha.js +14 -14
- package/dist/form-elements/FormElementCheckBoxes.d.ts +15 -15
- package/dist/form-elements/FormElementCheckBoxes.js +64 -64
- package/dist/form-elements/FormElementCivicaNameRecord.d.ts +8 -8
- package/dist/form-elements/FormElementCivicaNameRecord.js +51 -51
- package/dist/form-elements/FormElementCivicaStreetName.d.ts +15 -15
- package/dist/form-elements/FormElementCivicaStreetName.js +38 -38
- package/dist/form-elements/FormElementCompliance.d.ts +22 -22
- package/dist/form-elements/FormElementCompliance.js +129 -129
- package/dist/form-elements/FormElementDate.d.ts +14 -14
- package/dist/form-elements/FormElementDate.js +74 -74
- package/dist/form-elements/FormElementDateTime.d.ts +14 -14
- package/dist/form-elements/FormElementDateTime.js +67 -67
- package/dist/form-elements/FormElementEmail.d.ts +14 -14
- package/dist/form-elements/FormElementEmail.js +22 -22
- package/dist/form-elements/FormElementFile.d.ts +13 -13
- package/dist/form-elements/FormElementFile.js +31 -31
- package/dist/form-elements/FormElementFile.js.map +1 -1
- package/dist/form-elements/FormElementFiles/FormElementFile.d.ts +13 -0
- package/dist/form-elements/FormElementFiles/FormElementFile.js +32 -0
- package/dist/form-elements/FormElementFiles/FormElementFile.js.map +1 -0
- package/dist/form-elements/FormElementFiles/FormElementFileDisplay.d.ts +10 -0
- package/dist/form-elements/FormElementFiles/FormElementFileDisplay.js +11 -0
- package/dist/form-elements/FormElementFiles/FormElementFileDisplay.js.map +1 -0
- package/dist/form-elements/FormElementFiles/FormElementFiles.d.ts +15 -0
- package/dist/form-elements/FormElementFiles/FormElementFiles.js +17 -0
- package/dist/form-elements/FormElementFiles/FormElementFiles.js.map +1 -0
- package/dist/form-elements/FormElementFiles/FormElementFilesInvalidAttachment.d.ts +7 -0
- package/dist/form-elements/FormElementFiles/FormElementFilesInvalidAttachment.js +11 -0
- package/dist/form-elements/FormElementFiles/FormElementFilesInvalidAttachment.js.map +1 -0
- package/dist/form-elements/FormElementFiles/index.d.ts +17 -0
- package/dist/form-elements/FormElementFiles/index.js +18 -0
- package/dist/form-elements/FormElementFiles/index.js.map +1 -0
- package/dist/form-elements/FormElementFiles/legacy/FormElementFiles.d.ts +18 -0
- package/dist/form-elements/FormElementFiles/legacy/FormElementFiles.js +61 -0
- package/dist/form-elements/FormElementFiles/legacy/FormElementFiles.js.map +1 -0
- package/dist/form-elements/FormElementFiles.d.ts +15 -15
- package/dist/form-elements/FormElementFiles.js +42 -42
- package/dist/form-elements/FormElementForm.d.ts +17 -17
- package/dist/form-elements/FormElementForm.js +63 -63
- package/dist/form-elements/FormElementFreshdeskDependentField.d.ts +8 -8
- package/dist/form-elements/FormElementFreshdeskDependentField.js +15 -15
- package/dist/form-elements/FormElementGeoscapeAddress.d.ts +15 -15
- package/dist/form-elements/FormElementGeoscapeAddress.js +62 -62
- package/dist/form-elements/FormElementHTML.d.ts +8 -8
- package/dist/form-elements/FormElementHTML.js +15 -15
- package/dist/form-elements/FormElementHeading.d.ts +8 -8
- package/dist/form-elements/FormElementHeading.js +23 -23
- package/dist/form-elements/FormElementImage.d.ts +8 -8
- package/dist/form-elements/FormElementImage.js +6 -6
- package/dist/form-elements/FormElementLocation.d.ts +20 -20
- package/dist/form-elements/FormElementLocation.js +204 -204
- package/dist/form-elements/FormElementNumber.d.ts +14 -14
- package/dist/form-elements/FormElementNumber.js +72 -72
- package/dist/form-elements/FormElementPointAddress.d.ts +15 -15
- package/dist/form-elements/FormElementPointAddress.js +69 -69
- package/dist/form-elements/FormElementRadio.d.ts +15 -15
- package/dist/form-elements/FormElementRadio.js +41 -41
- package/dist/form-elements/FormElementRepeatableSet.d.ts +19 -19
- package/dist/form-elements/FormElementRepeatableSet.js +126 -126
- package/dist/form-elements/FormElementSection.d.ts +8 -8
- package/dist/form-elements/FormElementSection.js +69 -69
- package/dist/form-elements/FormElementSelect.d.ts +15 -15
- package/dist/form-elements/FormElementSelect.js +44 -44
- package/dist/form-elements/FormElementSignature.d.ts +15 -15
- package/dist/form-elements/FormElementSignature.js +138 -135
- package/dist/form-elements/FormElementSignature.js.map +1 -1
- package/dist/form-elements/FormElementSummary.d.ts +11 -11
- package/dist/form-elements/FormElementSummary.js +159 -159
- package/dist/form-elements/FormElementTelephone.d.ts +14 -14
- package/dist/form-elements/FormElementTelephone.js +22 -22
- package/dist/form-elements/FormElementText.d.ts +14 -14
- package/dist/form-elements/FormElementText.js +29 -29
- package/dist/form-elements/FormElementTextarea.d.ts +14 -14
- package/dist/form-elements/FormElementTextarea.js +30 -30
- package/dist/form-elements/FormElementTime.d.ts +14 -14
- package/dist/form-elements/FormElementTime.js +53 -53
- package/dist/form-elements/OptionButton.d.ts +11 -11
- package/dist/form-elements/OptionButton.js +9 -9
- package/dist/hooks/attachments/useAttachment.d.ts +12 -11
- package/dist/hooks/attachments/useAttachment.js +242 -235
- package/dist/hooks/attachments/useAttachment.js.map +1 -1
- package/dist/hooks/attachments/useAttachmentBlobs.d.ts +19 -19
- package/dist/hooks/attachments/useAttachmentBlobs.js +23 -23
- package/dist/hooks/attachments/useAttachmentObjectURLs.d.ts +24 -0
- package/dist/hooks/attachments/useAttachmentObjectURLs.js +37 -0
- package/dist/hooks/attachments/useAttachmentObjectURLs.js.map +1 -0
- package/dist/hooks/attachments/useAttachments.d.ts +10 -10
- package/dist/hooks/attachments/useAttachments.js +69 -69
- package/dist/hooks/attachments/useLocalAttachmentBlobs.d.ts +24 -0
- package/dist/hooks/attachments/useLocalAttachmentBlobs.js +40 -0
- package/dist/hooks/attachments/useLocalAttachmentBlobs.js.map +1 -0
- package/dist/hooks/useAbnLookupAuthenticationGuid.d.ts +3 -3
- package/dist/hooks/useAbnLookupAuthenticationGuid.js +5 -5
- package/dist/hooks/useAuth.d.ts +15 -15
- package/dist/hooks/useAuth.js +42 -42
- package/dist/hooks/useBooleanState.d.ts +5 -5
- package/dist/hooks/useBooleanState.js +8 -8
- package/dist/hooks/useButtonsConfiguration.d.ts +45 -0
- package/dist/hooks/useButtonsConfiguration.js +6 -0
- package/dist/hooks/useButtonsConfiguration.js.map +1 -0
- package/dist/hooks/useCaptchaSiteKey.d.ts +3 -3
- package/dist/hooks/useCaptchaSiteKey.js +5 -5
- package/dist/hooks/useChangeEffect.d.ts +1 -0
- package/dist/hooks/useChangeEffect.js +14 -0
- package/dist/hooks/useChangeEffect.js.map +1 -0
- package/dist/hooks/useClickOutsideElement.d.ts +3 -3
- package/dist/hooks/useClickOutsideElement.js +14 -14
- package/dist/hooks/useConditionalLogic.d.ts +6 -6
- package/dist/hooks/useConditionalLogic.js +22 -22
- package/dist/hooks/useConditionallyShowOptionCallback.d.ts +5 -0
- package/dist/hooks/useConditionallyShowOptionCallback.js +20 -0
- package/dist/hooks/useConditionallyShowOptionCallback.js.map +1 -0
- package/dist/hooks/useContrastColor.d.ts +2 -2
- package/dist/hooks/useContrastColor.js +12 -12
- package/dist/hooks/useCustomValidation.d.ts +1 -0
- package/dist/hooks/useCustomValidation.js +9 -0
- package/dist/hooks/useCustomValidation.js.map +1 -0
- package/dist/hooks/useDynamicOptionsLoaderEffect.d.ts +7 -0
- package/dist/hooks/useDynamicOptionsLoaderEffect.js +45 -0
- package/dist/hooks/useDynamicOptionsLoaderEffect.js.map +1 -0
- package/dist/hooks/useDynamicOptionsLoaderState.d.ts +7 -7
- package/dist/hooks/useDynamicOptionsLoaderState.js +44 -44
- package/dist/hooks/useExecutedLookupCallback.d.ts +12 -12
- package/dist/hooks/useExecutedLookupCallback.js +15 -15
- package/dist/hooks/useFlatpickr.d.ts +10 -10
- package/dist/hooks/useFlatpickr.js +73 -73
- package/dist/hooks/useFlatpickrGuid.d.ts +7 -7
- package/dist/hooks/useFlatpickrGuid.js +11 -11
- package/dist/hooks/useFlattenElementsContext.d.ts +2 -2
- package/dist/hooks/useFlattenElementsContext.js +7 -7
- package/dist/hooks/useFormDefinition.d.ts +4 -4
- package/dist/hooks/useFormDefinition.js +9 -9
- package/dist/hooks/useFormElementOptions.d.ts +9 -9
- package/dist/hooks/useFormElementOptions.js +35 -35
- package/dist/hooks/useFormIsReadOnly.d.ts +3 -3
- package/dist/hooks/useFormIsReadOnly.js +5 -5
- package/dist/hooks/useFormSubmissionAutoSaveState.d.ts +24 -24
- package/dist/hooks/useFormSubmissionAutoSaveState.js +145 -145
- package/dist/hooks/useFormSubmissionModelContext.d.ts +15 -15
- package/dist/hooks/useFormSubmissionModelContext.js +32 -32
- package/dist/hooks/useFormSubmissionState.d.ts +10 -10
- package/dist/hooks/useFormSubmissionState.js +13 -13
- package/dist/hooks/useFormValidation.d.ts +7 -7
- package/dist/hooks/useFormValidation.js +29 -29
- package/dist/hooks/useGoogleMapsApiKey.d.ts +3 -3
- package/dist/hooks/useGoogleMapsApiKey.js +5 -5
- package/dist/hooks/useInfiniteScrollDataLoad.d.ts +30 -30
- package/dist/hooks/useInfiniteScrollDataLoad.js +124 -124
- package/dist/hooks/useInjectPages.d.ts +7 -7
- package/dist/hooks/useInjectPages.js +5 -5
- package/dist/hooks/useIsHovering.d.ts +5 -5
- package/dist/hooks/useIsHovering.js +12 -12
- package/dist/hooks/useIsMounted.d.ts +3 -3
- package/dist/hooks/useIsMounted.js +11 -11
- package/dist/hooks/useIsOffline.d.ts +6 -6
- package/dist/hooks/useIsOffline.js +26 -26
- package/dist/hooks/useIsPageVisible.d.ts +9 -9
- package/dist/hooks/useIsPageVisible.js +8 -8
- package/dist/hooks/useLegacyElements.d.ts +16 -0
- package/dist/hooks/useLegacyElements.js +55 -0
- package/dist/hooks/useLegacyElements.js.map +1 -0
- package/dist/hooks/useLoadDataState.d.ts +15 -15
- package/dist/hooks/useLoadDataState.js +54 -54
- package/dist/hooks/useLogin.d.ts +46 -46
- package/dist/hooks/useLogin.js +295 -295
- package/dist/hooks/useLookupNotification.d.ts +9 -9
- package/dist/hooks/useLookupNotification.js +10 -10
- package/dist/hooks/useLookups.d.ts +5 -5
- package/dist/hooks/useLookups.js +62 -62
- package/dist/hooks/useNullableState.d.ts +2 -2
- package/dist/hooks/useNullableState.js +6 -6
- package/dist/hooks/usePages.d.ts +24 -24
- package/dist/hooks/usePages.js +141 -141
- package/dist/hooks/useQuery.d.ts +2 -2
- package/dist/hooks/useQuery.js +7 -7
- package/dist/hooks/useSubmissionIdIsValid.d.ts +3 -3
- package/dist/hooks/useSubmissionIdIsValid.js +19 -19
- package/dist/hooks/useToggleAll.d.ts +6 -0
- package/dist/hooks/useToggleAll.js +24 -0
- package/dist/hooks/useToggleAll.js.map +1 -0
- package/dist/hooks/useToggleComplianceChildren.d.ts +3 -3
- package/dist/hooks/useToggleComplianceChildren.js +13 -13
- package/dist/index.d.ts +23 -22
- package/dist/index.js +23 -22
- package/dist/index.js.map +1 -1
- package/dist/services/attachments.d.ts +10 -10
- package/dist/services/attachments.js +72 -72
- package/dist/services/barcode-readers/quagger.d.ts +1 -1
- package/dist/services/barcode-readers/quagger.js +34 -34
- package/dist/services/blob-utils.d.ts +5 -5
- package/dist/services/blob-utils.js +73 -73
- package/dist/services/checkBsbsAreInvalid.d.ts +3 -3
- package/dist/services/checkBsbsAreInvalid.js +40 -40
- package/dist/services/checkIfAttachmentsAreUploading.d.ts +3 -3
- package/dist/services/checkIfAttachmentsAreUploading.js +57 -57
- package/dist/services/checkIfAttachmentsExist.d.ts +5 -5
- package/dist/services/checkIfAttachmentsExist.js +144 -144
- package/dist/services/checkIfBsbsAreValidating.d.ts +3 -3
- package/dist/services/checkIfBsbsAreValidating.js +40 -40
- package/dist/services/clean-form-elements-ctrl-model.d.ts +4 -0
- package/dist/services/clean-form-elements-ctrl-model.js +166 -0
- package/dist/services/clean-form-elements-ctrl-model.js.map +1 -0
- package/dist/services/cleanFormSubmissionModel.d.ts +6 -6
- package/dist/services/cleanFormSubmissionModel.js +203 -203
- package/dist/services/conditionally-show-element.d.ts +11 -0
- package/dist/services/conditionally-show-element.js +92 -0
- package/dist/services/conditionally-show-element.js.map +1 -0
- package/dist/services/conditionally-show-option.d.ts +3 -0
- package/dist/services/conditionally-show-option.js +135 -0
- package/dist/services/conditionally-show-option.js.map +1 -0
- package/dist/services/defaultCoordinates.d.ts +5 -5
- package/dist/services/defaultCoordinates.js +8 -8
- package/dist/services/download-file.d.ts +3 -3
- package/dist/services/download-file.js +90 -90
- package/dist/services/drawTimestampOnCanvas.d.ts +1 -1
- package/dist/services/drawTimestampOnCanvas.js +22 -22
- package/dist/services/flattenFormElements.d.ts +2 -0
- package/dist/services/flattenFormElements.js +13 -0
- package/dist/services/flattenFormElements.js.map +1 -0
- package/dist/services/form-validation.d.ts +10 -10
- package/dist/services/form-validation.js +561 -561
- package/dist/services/generate-default-data.d.ts +13 -13
- package/dist/services/generate-default-data.js +494 -494
- package/dist/services/generateCivicaNameRecordElements.d.ts +2 -2
- package/dist/services/generateCivicaNameRecordElements.js +140 -140
- package/dist/services/generateFreshdeskDependentFieldElements.d.ts +2 -2
- package/dist/services/generateFreshdeskDependentFieldElements.js +69 -69
- package/dist/services/getCorrectDateFromDateOnlyString.d.ts +2 -0
- package/dist/services/getCorrectDateFromDateOnlyString.js +4 -0
- package/dist/services/getCorrectDateFromDateOnlyString.js.map +1 -0
- package/dist/services/sanitize-html.d.ts +2 -2
- package/dist/services/sanitize-html.js +20 -20
- package/dist/services/scrolling-service.d.ts +7 -7
- package/dist/services/scrolling-service.js +38 -38
- package/dist/services/utils-service.d.ts +5 -5
- package/dist/services/utils-service.js +16 -16
- package/dist/styles/boolean.scss +12 -0
- package/dist/styles/ob-file.scss +63 -0
- package/dist/styles/progress.scss +8 -0
- package/dist/styles.css +7 -0
- package/dist/styles.css.map +1 -1
- package/dist/styles.scss +1 -0
- package/dist/types/attachments.d.ts +19 -19
- package/dist/types/attachments.js +1 -1
- package/dist/types/form.d.ts +40 -40
- package/dist/types/form.js +2 -2
- package/package.json +2 -2
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
declare type AttachmentObjectBlob = {
|
3
|
+
attachmentId: string;
|
4
|
+
blob: Blob;
|
5
|
+
};
|
6
|
+
declare type RegisterAttachmentParam = {
|
7
|
+
blob: Blob;
|
8
|
+
attachmentId: string;
|
9
|
+
};
|
10
|
+
declare type ReplacePreUploadIdParam = {
|
11
|
+
attachmentId: string;
|
12
|
+
preUploadId: string;
|
13
|
+
};
|
14
|
+
declare type AttachmentObjectURLsContextValue = {
|
15
|
+
registerAttachmentObjectURL: (options: RegisterAttachmentParam) => void;
|
16
|
+
replacePreUploadIdWithAttachmentId: (options: ReplacePreUploadIdParam) => void;
|
17
|
+
attachmentObjectURLs: Array<AttachmentObjectBlob>;
|
18
|
+
};
|
19
|
+
declare type Props = {
|
20
|
+
children: React.ReactNode;
|
21
|
+
};
|
22
|
+
export declare const AttachmentObjectURLsProvider: ({ children }: Props) => JSX.Element;
|
23
|
+
declare const useAttachmentObjectURLs: () => AttachmentObjectURLsContextValue;
|
24
|
+
export default useAttachmentObjectURLs;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
const AttachmentObjectURLsContext = React.createContext({
|
3
|
+
registerAttachmentObjectURL: () => { },
|
4
|
+
replacePreUploadIdWithAttachmentId: () => { },
|
5
|
+
attachmentObjectURLs: [],
|
6
|
+
});
|
7
|
+
export const AttachmentObjectURLsProvider = ({ children }) => {
|
8
|
+
const [attachmentObjectURLs, setAttachmentObjectURLs] = React.useState([]);
|
9
|
+
const registerAttachmentObjectURL = React.useCallback((newAttachment) => {
|
10
|
+
setAttachmentObjectURLs((c) => [...c, newAttachment]);
|
11
|
+
}, []);
|
12
|
+
const replacePreUploadIdWithAttachmentId = React.useCallback(({ attachmentId: newAttachmentId, preUploadId, }) => {
|
13
|
+
setAttachmentObjectURLs((c) => {
|
14
|
+
return c.map(({ attachmentId, blob }) => {
|
15
|
+
return {
|
16
|
+
blob,
|
17
|
+
attachmentId: attachmentId === preUploadId ? newAttachmentId : attachmentId,
|
18
|
+
};
|
19
|
+
});
|
20
|
+
});
|
21
|
+
}, []);
|
22
|
+
const value = React.useMemo(() => ({
|
23
|
+
attachmentObjectURLs,
|
24
|
+
registerAttachmentObjectURL,
|
25
|
+
replacePreUploadIdWithAttachmentId,
|
26
|
+
}), [
|
27
|
+
attachmentObjectURLs,
|
28
|
+
registerAttachmentObjectURL,
|
29
|
+
replacePreUploadIdWithAttachmentId,
|
30
|
+
]);
|
31
|
+
return (React.createElement(AttachmentObjectURLsContext.Provider, { value: value }, children));
|
32
|
+
};
|
33
|
+
const useAttachmentObjectURLs = () => {
|
34
|
+
return React.useContext(AttachmentObjectURLsContext);
|
35
|
+
};
|
36
|
+
export default useAttachmentObjectURLs;
|
37
|
+
//# sourceMappingURL=useAttachmentObjectURLs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useAttachmentObjectURLs.js","sourceRoot":"","sources":["../../../src/hooks/attachments/useAttachmentObjectURLs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAwB9B,MAAM,2BAA2B,GAC/B,KAAK,CAAC,aAAa,CAAmC;IACpD,2BAA2B,EAAE,GAAG,EAAE,GAAE,CAAC;IACrC,kCAAkC,EAAE,GAAG,EAAE,GAAE,CAAC;IAC5C,oBAAoB,EAAE,EAAE;CACzB,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAClE,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAEpE,EAAE,CAAC,CAAA;IACL,MAAM,2BAA2B,GAAG,KAAK,CAAC,WAAW,CACnD,CAAC,aAAsC,EAAE,EAAE;QACzC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;IACvD,CAAC,EACD,EAAE,CACH,CAAA;IAED,MAAM,kCAAkC,GAAG,KAAK,CAAC,WAAW,CAC1D,CAAC,EACC,YAAY,EAAE,eAAe,EAC7B,WAAW,GACa,EAAE,EAAE;QAC5B,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE;gBACtC,OAAO;oBACL,IAAI;oBACJ,YAAY,EACV,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;iBAChE,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,EAAE,CACH,CAAA;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,GAAG,EAAE,CAAC,CAAC;QACL,oBAAoB;QACpB,2BAA2B;QAC3B,kCAAkC;KACnC,CAAC,EACF;QACE,oBAAoB;QACpB,2BAA2B;QAC3B,kCAAkC;KACnC,CACF,CAAA;IAED,OAAO,CACL,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAC/C,QAAQ,CAC4B,CACxC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAA;AACtD,CAAC,CAAA;AACD,eAAe,uBAAuB,CAAA","sourcesContent":["import * as React from 'react'\n\ntype AttachmentObjectBlob = {\n attachmentId: string\n blob: Blob\n}\ntype RegisterAttachmentParam = {\n blob: Blob\n attachmentId: string\n}\ntype ReplacePreUploadIdParam = {\n attachmentId: string\n preUploadId: string\n}\ntype AttachmentObjectURLsContextValue = {\n registerAttachmentObjectURL: (options: RegisterAttachmentParam) => void\n replacePreUploadIdWithAttachmentId: (options: ReplacePreUploadIdParam) => void\n attachmentObjectURLs: Array<AttachmentObjectBlob>\n}\n\ntype Props = {\n children: React.ReactNode\n}\n\nconst AttachmentObjectURLsContext =\n React.createContext<AttachmentObjectURLsContextValue>({\n registerAttachmentObjectURL: () => {},\n replacePreUploadIdWithAttachmentId: () => {},\n attachmentObjectURLs: [],\n })\n\nexport const AttachmentObjectURLsProvider = ({ children }: Props) => {\n const [attachmentObjectURLs, setAttachmentObjectURLs] = React.useState<\n AttachmentObjectBlob[]\n >([])\n const registerAttachmentObjectURL = React.useCallback(\n (newAttachment: RegisterAttachmentParam) => {\n setAttachmentObjectURLs((c) => [...c, newAttachment])\n },\n [],\n )\n\n const replacePreUploadIdWithAttachmentId = React.useCallback(\n ({\n attachmentId: newAttachmentId,\n preUploadId,\n }: ReplacePreUploadIdParam) => {\n setAttachmentObjectURLs((c) => {\n return c.map(({ attachmentId, blob }) => {\n return {\n blob,\n attachmentId:\n attachmentId === preUploadId ? newAttachmentId : attachmentId,\n }\n })\n })\n },\n [],\n )\n\n const value = React.useMemo(\n () => ({\n attachmentObjectURLs,\n registerAttachmentObjectURL,\n replacePreUploadIdWithAttachmentId,\n }),\n [\n attachmentObjectURLs,\n registerAttachmentObjectURL,\n replacePreUploadIdWithAttachmentId,\n ],\n )\n\n return (\n <AttachmentObjectURLsContext.Provider value={value}>\n {children}\n </AttachmentObjectURLsContext.Provider>\n )\n}\n\nconst useAttachmentObjectURLs = () => {\n return React.useContext(AttachmentObjectURLsContext)\n}\nexport default useAttachmentObjectURLs\n"]}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { FormTypes } from '@oneblink/types';
|
2
|
-
import { Attachment } from '../../types/attachments';
|
3
|
-
import { FormElementValueChangeHandler } from '../../types/form';
|
4
|
-
declare const useAttachments: (element: FormTypes.FilesElement, onChange: FormElementValueChangeHandler<Attachment[]>) => {
|
5
|
-
isDirty: boolean;
|
6
|
-
addAttachments: (files: File[]) => Promise<void>;
|
7
|
-
removeAttachment: (id: string) => void;
|
8
|
-
changeAttachment: (id: string, attachment: Attachment) => void;
|
9
|
-
};
|
10
|
-
export default useAttachments;
|
1
|
+
import { FormTypes } from '@oneblink/types';
|
2
|
+
import { Attachment } from '../../types/attachments';
|
3
|
+
import { FormElementValueChangeHandler } from '../../types/form';
|
4
|
+
declare const useAttachments: (element: FormTypes.FilesElement, onChange: FormElementValueChangeHandler<Attachment[]>) => {
|
5
|
+
isDirty: boolean;
|
6
|
+
addAttachments: (files: File[]) => Promise<void>;
|
7
|
+
removeAttachment: (id: string) => void;
|
8
|
+
changeAttachment: (id: string, attachment: Attachment) => void;
|
9
|
+
};
|
10
|
+
export default useAttachments;
|
@@ -1,70 +1,70 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { prepareNewAttachment, correctFileOrientation, } from '../../services/attachments';
|
3
|
-
import { canvasToBlob } from '../../services/blob-utils';
|
4
|
-
import useBooleanState from '../useBooleanState';
|
5
|
-
import useIsMounted from '../useIsMounted';
|
6
|
-
const useAttachments = (element, onChange) => {
|
7
|
-
const isMounted = useIsMounted();
|
8
|
-
const [isDirty, setIsDirty] = useBooleanState(false);
|
9
|
-
const addAttachments = React.useCallback(async (files) => {
|
10
|
-
if (!files.length)
|
11
|
-
return;
|
12
|
-
const newAttachments = await Promise.all(files.map(async (file) => {
|
13
|
-
const result = await correctFileOrientation(file);
|
14
|
-
if (result instanceof Blob) {
|
15
|
-
return prepareNewAttachment(result, file.name, element);
|
16
|
-
}
|
17
|
-
const blob = await canvasToBlob(result);
|
18
|
-
return prepareNewAttachment(blob, file.name, element);
|
19
|
-
}));
|
20
|
-
onChange(element, (currentAttachments) => {
|
21
|
-
if (!currentAttachments)
|
22
|
-
return newAttachments;
|
23
|
-
return [...currentAttachments, ...newAttachments];
|
24
|
-
});
|
25
|
-
if (isMounted.current) {
|
26
|
-
setIsDirty();
|
27
|
-
}
|
28
|
-
}, [element, isMounted, onChange, setIsDirty]);
|
29
|
-
const removeAttachment = React.useCallback((id) => {
|
30
|
-
onChange(element, (currentAttachments) => {
|
31
|
-
const newAttachments = currentAttachments === null || currentAttachments === void 0 ? void 0 : currentAttachments.filter((att) => {
|
32
|
-
// Return items that are not the removed id
|
33
|
-
if (!att.type) {
|
34
|
-
return att.id !== id;
|
35
|
-
}
|
36
|
-
return att._id !== id;
|
37
|
-
});
|
38
|
-
if (newAttachments === null || newAttachments === void 0 ? void 0 : newAttachments.length) {
|
39
|
-
return newAttachments;
|
40
|
-
}
|
41
|
-
});
|
42
|
-
if (isMounted.current) {
|
43
|
-
setIsDirty();
|
44
|
-
}
|
45
|
-
}, [element, isMounted, onChange, setIsDirty]);
|
46
|
-
const changeAttachment = React.useCallback((id, attachment) => {
|
47
|
-
onChange(element, (currentAttachments) => {
|
48
|
-
if (!currentAttachments)
|
49
|
-
return;
|
50
|
-
return currentAttachments.map((att) => {
|
51
|
-
// Can only change attachments that are not uploaded (have a type)
|
52
|
-
if (att.type && att._id === id) {
|
53
|
-
return attachment;
|
54
|
-
}
|
55
|
-
return att;
|
56
|
-
});
|
57
|
-
});
|
58
|
-
if (isMounted.current) {
|
59
|
-
setIsDirty();
|
60
|
-
}
|
61
|
-
}, [element, isMounted, onChange, setIsDirty]);
|
62
|
-
return {
|
63
|
-
isDirty,
|
64
|
-
addAttachments,
|
65
|
-
removeAttachment,
|
66
|
-
changeAttachment,
|
67
|
-
};
|
68
|
-
};
|
69
|
-
export default useAttachments;
|
1
|
+
import * as React from 'react';
|
2
|
+
import { prepareNewAttachment, correctFileOrientation, } from '../../services/attachments';
|
3
|
+
import { canvasToBlob } from '../../services/blob-utils';
|
4
|
+
import useBooleanState from '../useBooleanState';
|
5
|
+
import useIsMounted from '../useIsMounted';
|
6
|
+
const useAttachments = (element, onChange) => {
|
7
|
+
const isMounted = useIsMounted();
|
8
|
+
const [isDirty, setIsDirty] = useBooleanState(false);
|
9
|
+
const addAttachments = React.useCallback(async (files) => {
|
10
|
+
if (!files.length)
|
11
|
+
return;
|
12
|
+
const newAttachments = await Promise.all(files.map(async (file) => {
|
13
|
+
const result = await correctFileOrientation(file);
|
14
|
+
if (result instanceof Blob) {
|
15
|
+
return prepareNewAttachment(result, file.name, element);
|
16
|
+
}
|
17
|
+
const blob = await canvasToBlob(result);
|
18
|
+
return prepareNewAttachment(blob, file.name, element);
|
19
|
+
}));
|
20
|
+
onChange(element, (currentAttachments) => {
|
21
|
+
if (!currentAttachments)
|
22
|
+
return newAttachments;
|
23
|
+
return [...currentAttachments, ...newAttachments];
|
24
|
+
});
|
25
|
+
if (isMounted.current) {
|
26
|
+
setIsDirty();
|
27
|
+
}
|
28
|
+
}, [element, isMounted, onChange, setIsDirty]);
|
29
|
+
const removeAttachment = React.useCallback((id) => {
|
30
|
+
onChange(element, (currentAttachments) => {
|
31
|
+
const newAttachments = currentAttachments === null || currentAttachments === void 0 ? void 0 : currentAttachments.filter((att) => {
|
32
|
+
// Return items that are not the removed id
|
33
|
+
if (!att.type) {
|
34
|
+
return att.id !== id;
|
35
|
+
}
|
36
|
+
return att._id !== id;
|
37
|
+
});
|
38
|
+
if (newAttachments === null || newAttachments === void 0 ? void 0 : newAttachments.length) {
|
39
|
+
return newAttachments;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
if (isMounted.current) {
|
43
|
+
setIsDirty();
|
44
|
+
}
|
45
|
+
}, [element, isMounted, onChange, setIsDirty]);
|
46
|
+
const changeAttachment = React.useCallback((id, attachment) => {
|
47
|
+
onChange(element, (currentAttachments) => {
|
48
|
+
if (!currentAttachments)
|
49
|
+
return;
|
50
|
+
return currentAttachments.map((att) => {
|
51
|
+
// Can only change attachments that are not uploaded (have a type)
|
52
|
+
if (att.type && att._id === id) {
|
53
|
+
return attachment;
|
54
|
+
}
|
55
|
+
return att;
|
56
|
+
});
|
57
|
+
});
|
58
|
+
if (isMounted.current) {
|
59
|
+
setIsDirty();
|
60
|
+
}
|
61
|
+
}, [element, isMounted, onChange, setIsDirty]);
|
62
|
+
return {
|
63
|
+
isDirty,
|
64
|
+
addAttachments,
|
65
|
+
removeAttachment,
|
66
|
+
changeAttachment,
|
67
|
+
};
|
68
|
+
};
|
69
|
+
export default useAttachments;
|
70
70
|
//# sourceMappingURL=useAttachments.js.map
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
declare type AttachmentObjectBlob = {
|
3
|
+
attachmentId: string;
|
4
|
+
blob: Blob;
|
5
|
+
};
|
6
|
+
declare type RegisterAttachmentParam = {
|
7
|
+
blob: Blob;
|
8
|
+
attachmentId: string;
|
9
|
+
};
|
10
|
+
declare type ReplacePreUploadIdParam = {
|
11
|
+
attachmentId: string;
|
12
|
+
preUploadId: string;
|
13
|
+
};
|
14
|
+
declare type AttachmentBlobsContextValue = {
|
15
|
+
registerAttachmentBlob: (options: RegisterAttachmentParam) => void;
|
16
|
+
replacePreUploadIdWithAttachmentId: (options: ReplacePreUploadIdParam) => void;
|
17
|
+
getAttachmentBlob: (attachmentId: string) => AttachmentObjectBlob | undefined;
|
18
|
+
};
|
19
|
+
declare type Props = {
|
20
|
+
children: React.ReactNode;
|
21
|
+
};
|
22
|
+
export declare const AttachmentBlobsProvider: ({ children }: Props) => JSX.Element;
|
23
|
+
declare const useAttachmentBlobs: () => AttachmentBlobsContextValue;
|
24
|
+
export default useAttachmentBlobs;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
const AttachmentBlobsContext = React.createContext({
|
3
|
+
registerAttachmentBlob: () => { },
|
4
|
+
replacePreUploadIdWithAttachmentId: () => { },
|
5
|
+
getAttachmentBlob: () => undefined,
|
6
|
+
});
|
7
|
+
export const AttachmentBlobsProvider = ({ children }) => {
|
8
|
+
const [attachmentBlobs, setAttachmentBlobs] = React.useState([]);
|
9
|
+
const registerAttachmentBlob = React.useCallback((newAttachment) => {
|
10
|
+
setAttachmentBlobs((c) => [...c, newAttachment]);
|
11
|
+
}, []);
|
12
|
+
const replacePreUploadIdWithAttachmentId = React.useCallback(({ attachmentId: newAttachmentId, preUploadId, }) => {
|
13
|
+
setAttachmentBlobs((c) => {
|
14
|
+
return c.map(({ attachmentId, blob }) => {
|
15
|
+
return {
|
16
|
+
blob,
|
17
|
+
attachmentId: attachmentId === preUploadId ? newAttachmentId : attachmentId,
|
18
|
+
};
|
19
|
+
});
|
20
|
+
});
|
21
|
+
}, []);
|
22
|
+
const getAttachmentBlob = React.useCallback((attachmentId) => {
|
23
|
+
return attachmentBlobs.find((b) => b.attachmentId === attachmentId);
|
24
|
+
}, [attachmentBlobs]);
|
25
|
+
const value = React.useMemo(() => ({
|
26
|
+
registerAttachmentBlob,
|
27
|
+
replacePreUploadIdWithAttachmentId,
|
28
|
+
getAttachmentBlob,
|
29
|
+
}), [
|
30
|
+
registerAttachmentBlob,
|
31
|
+
replacePreUploadIdWithAttachmentId,
|
32
|
+
getAttachmentBlob,
|
33
|
+
]);
|
34
|
+
return (React.createElement(AttachmentBlobsContext.Provider, { value: value }, children));
|
35
|
+
};
|
36
|
+
const useAttachmentBlobs = () => {
|
37
|
+
return React.useContext(AttachmentBlobsContext);
|
38
|
+
};
|
39
|
+
export default useAttachmentBlobs;
|
40
|
+
//# sourceMappingURL=useLocalAttachmentBlobs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useLocalAttachmentBlobs.js","sourceRoot":"","sources":["../../../src/hooks/attachments/useLocalAttachmentBlobs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAwB9B,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAChD;IACE,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC;IAChC,kCAAkC,EAAE,GAAG,EAAE,GAAE,CAAC;IAC5C,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS;CACnC,CACF,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC7D,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAE1D,EAAE,CAAC,CAAA;IACL,MAAM,sBAAsB,GAAG,KAAK,CAAC,WAAW,CAC9C,CAAC,aAAsC,EAAE,EAAE;QACzC,kBAAkB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;IAClD,CAAC,EACD,EAAE,CACH,CAAA;IAED,MAAM,kCAAkC,GAAG,KAAK,CAAC,WAAW,CAC1D,CAAC,EACC,YAAY,EAAE,eAAe,EAC7B,WAAW,GACa,EAAE,EAAE;QAC5B,kBAAkB,CAAC,CAAC,CAAC,EAAE,EAAE;YACvB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE;gBACtC,OAAO;oBACL,IAAI;oBACJ,YAAY,EACV,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;iBAChE,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,EAAE,CACH,CAAA;IAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CACzC,CAAC,YAAoB,EAAE,EAAE;QACvB,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,CAAA;IACrE,CAAC,EACD,CAAC,eAAe,CAAC,CAClB,CAAA;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,GAAG,EAAE,CAAC,CAAC;QACL,sBAAsB;QACtB,kCAAkC;QAClC,iBAAiB;KAClB,CAAC,EACF;QACE,sBAAsB;QACtB,kCAAkC;QAClC,iBAAiB;KAClB,CACF,CAAA;IAED,OAAO,CACL,oBAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAC1C,QAAQ,CACuB,CACnC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAA;AACjD,CAAC,CAAA;AACD,eAAe,kBAAkB,CAAA","sourcesContent":["import * as React from 'react'\n\ntype AttachmentObjectBlob = {\n attachmentId: string\n blob: Blob\n}\ntype RegisterAttachmentParam = {\n blob: Blob\n attachmentId: string\n}\ntype ReplacePreUploadIdParam = {\n attachmentId: string\n preUploadId: string\n}\ntype AttachmentBlobsContextValue = {\n registerAttachmentBlob: (options: RegisterAttachmentParam) => void\n replacePreUploadIdWithAttachmentId: (options: ReplacePreUploadIdParam) => void\n getAttachmentBlob: (attachmentId: string) => AttachmentObjectBlob | undefined\n}\n\ntype Props = {\n children: React.ReactNode\n}\n\nconst AttachmentBlobsContext = React.createContext<AttachmentBlobsContextValue>(\n {\n registerAttachmentBlob: () => {},\n replacePreUploadIdWithAttachmentId: () => {},\n getAttachmentBlob: () => undefined,\n },\n)\n\nexport const AttachmentBlobsProvider = ({ children }: Props) => {\n const [attachmentBlobs, setAttachmentBlobs] = React.useState<\n AttachmentObjectBlob[]\n >([])\n const registerAttachmentBlob = React.useCallback(\n (newAttachment: RegisterAttachmentParam) => {\n setAttachmentBlobs((c) => [...c, newAttachment])\n },\n [],\n )\n\n const replacePreUploadIdWithAttachmentId = React.useCallback(\n ({\n attachmentId: newAttachmentId,\n preUploadId,\n }: ReplacePreUploadIdParam) => {\n setAttachmentBlobs((c) => {\n return c.map(({ attachmentId, blob }) => {\n return {\n blob,\n attachmentId:\n attachmentId === preUploadId ? newAttachmentId : attachmentId,\n }\n })\n })\n },\n [],\n )\n\n const getAttachmentBlob = React.useCallback(\n (attachmentId: string) => {\n return attachmentBlobs.find((b) => b.attachmentId === attachmentId)\n },\n [attachmentBlobs],\n )\n\n const value = React.useMemo(\n () => ({\n registerAttachmentBlob,\n replacePreUploadIdWithAttachmentId,\n getAttachmentBlob,\n }),\n [\n registerAttachmentBlob,\n replacePreUploadIdWithAttachmentId,\n getAttachmentBlob,\n ],\n )\n\n return (\n <AttachmentBlobsContext.Provider value={value}>\n {children}\n </AttachmentBlobsContext.Provider>\n )\n}\n\nconst useAttachmentBlobs = () => {\n return React.useContext(AttachmentBlobsContext)\n}\nexport default useAttachmentBlobs\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export declare const AbnLookupAuthenticationGuidContext: React.Context<string | undefined>;
|
3
|
-
export default function useAbnLookupAuthenticationGuid(): string | undefined;
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare const AbnLookupAuthenticationGuidContext: React.Context<string | undefined>;
|
3
|
+
export default function useAbnLookupAuthenticationGuid(): string | undefined;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export const AbnLookupAuthenticationGuidContext = React.createContext(undefined);
|
3
|
-
export default function useAbnLookupAuthenticationGuid() {
|
4
|
-
return React.useContext(AbnLookupAuthenticationGuidContext);
|
5
|
-
}
|
1
|
+
import * as React from 'react';
|
2
|
+
export const AbnLookupAuthenticationGuidContext = React.createContext(undefined);
|
3
|
+
export default function useAbnLookupAuthenticationGuid() {
|
4
|
+
return React.useContext(AbnLookupAuthenticationGuidContext);
|
5
|
+
}
|
6
6
|
//# sourceMappingURL=useAbnLookupAuthenticationGuid.js.map
|
package/dist/hooks/useAuth.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { authService } from '@oneblink/apps';
|
3
|
-
declare type AuthContextValue = {
|
4
|
-
isLoggedIn: ReturnType<typeof authService.isLoggedIn>;
|
5
|
-
userProfile: ReturnType<typeof authService.getUserProfile>;
|
6
|
-
userFriendlyName: ReturnType<typeof authService.getUserFriendlyName>;
|
7
|
-
isUsingFormsKey: boolean;
|
8
|
-
};
|
9
|
-
export declare function AuthContextProvider({ children, formsKeyToken, userToken, }: {
|
10
|
-
children: React.ReactNode;
|
11
|
-
formsKeyToken?: string;
|
12
|
-
userToken?: string;
|
13
|
-
}): JSX.Element;
|
14
|
-
export default function useAuth(): AuthContextValue;
|
15
|
-
export {};
|
1
|
+
import * as React from 'react';
|
2
|
+
import { authService } from '@oneblink/apps';
|
3
|
+
declare type AuthContextValue = {
|
4
|
+
isLoggedIn: ReturnType<typeof authService.isLoggedIn>;
|
5
|
+
userProfile: ReturnType<typeof authService.getUserProfile>;
|
6
|
+
userFriendlyName: ReturnType<typeof authService.getUserFriendlyName>;
|
7
|
+
isUsingFormsKey: boolean;
|
8
|
+
};
|
9
|
+
export declare function AuthContextProvider({ children, formsKeyToken, userToken, }: {
|
10
|
+
children: React.ReactNode;
|
11
|
+
formsKeyToken?: string;
|
12
|
+
userToken?: string;
|
13
|
+
}): JSX.Element;
|
14
|
+
export default function useAuth(): AuthContextValue;
|
15
|
+
export {};
|
package/dist/hooks/useAuth.js
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { authService } from '@oneblink/apps';
|
3
|
-
const AuthContext = React.createContext({
|
4
|
-
isLoggedIn: false,
|
5
|
-
userProfile: null,
|
6
|
-
userFriendlyName: undefined,
|
7
|
-
isUsingFormsKey: false,
|
8
|
-
});
|
9
|
-
export function AuthContextProvider({ children, formsKeyToken, userToken, }) {
|
10
|
-
const [value, setValue] = React.useState(() => {
|
11
|
-
authService.setFormsKeyToken(formsKeyToken);
|
12
|
-
authService.setUserToken(userToken);
|
13
|
-
return {
|
14
|
-
isLoggedIn: authService.isLoggedIn(),
|
15
|
-
userProfile: authService.getUserProfile(),
|
16
|
-
userFriendlyName: authService.getUserFriendlyName(),
|
17
|
-
isUsingFormsKey: !!formsKeyToken,
|
18
|
-
};
|
19
|
-
});
|
20
|
-
React.useEffect(() => {
|
21
|
-
authService.setFormsKeyToken(formsKeyToken);
|
22
|
-
setValue((currentValue) => ({
|
23
|
-
...currentValue,
|
24
|
-
isUsingFormsKey: !!formsKeyToken,
|
25
|
-
}));
|
26
|
-
}, [formsKeyToken]);
|
27
|
-
React.useEffect(() => {
|
28
|
-
authService.setUserToken(userToken);
|
29
|
-
}, [userToken]);
|
30
|
-
React.useEffect(() => {
|
31
|
-
return authService.registerAuthListener(() => setValue((current) => ({
|
32
|
-
...current,
|
33
|
-
isLoggedIn: authService.isLoggedIn(),
|
34
|
-
userProfile: authService.getUserProfile(),
|
35
|
-
userFriendlyName: authService.getUserFriendlyName(),
|
36
|
-
})));
|
37
|
-
}, []);
|
38
|
-
return React.createElement(AuthContext.Provider, { value: value }, children);
|
39
|
-
}
|
40
|
-
export default function useAuth() {
|
41
|
-
return React.useContext(AuthContext);
|
42
|
-
}
|
1
|
+
import * as React from 'react';
|
2
|
+
import { authService } from '@oneblink/apps';
|
3
|
+
const AuthContext = React.createContext({
|
4
|
+
isLoggedIn: false,
|
5
|
+
userProfile: null,
|
6
|
+
userFriendlyName: undefined,
|
7
|
+
isUsingFormsKey: false,
|
8
|
+
});
|
9
|
+
export function AuthContextProvider({ children, formsKeyToken, userToken, }) {
|
10
|
+
const [value, setValue] = React.useState(() => {
|
11
|
+
authService.setFormsKeyToken(formsKeyToken);
|
12
|
+
authService.setUserToken(userToken);
|
13
|
+
return {
|
14
|
+
isLoggedIn: authService.isLoggedIn(),
|
15
|
+
userProfile: authService.getUserProfile(),
|
16
|
+
userFriendlyName: authService.getUserFriendlyName(),
|
17
|
+
isUsingFormsKey: !!formsKeyToken,
|
18
|
+
};
|
19
|
+
});
|
20
|
+
React.useEffect(() => {
|
21
|
+
authService.setFormsKeyToken(formsKeyToken);
|
22
|
+
setValue((currentValue) => ({
|
23
|
+
...currentValue,
|
24
|
+
isUsingFormsKey: !!formsKeyToken,
|
25
|
+
}));
|
26
|
+
}, [formsKeyToken]);
|
27
|
+
React.useEffect(() => {
|
28
|
+
authService.setUserToken(userToken);
|
29
|
+
}, [userToken]);
|
30
|
+
React.useEffect(() => {
|
31
|
+
return authService.registerAuthListener(() => setValue((current) => ({
|
32
|
+
...current,
|
33
|
+
isLoggedIn: authService.isLoggedIn(),
|
34
|
+
userProfile: authService.getUserProfile(),
|
35
|
+
userFriendlyName: authService.getUserFriendlyName(),
|
36
|
+
})));
|
37
|
+
}, []);
|
38
|
+
return React.createElement(AuthContext.Provider, { value: value }, children);
|
39
|
+
}
|
40
|
+
export default function useAuth() {
|
41
|
+
return React.useContext(AuthContext);
|
42
|
+
}
|
43
43
|
//# sourceMappingURL=useAuth.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
declare type setTrue = () => void;
|
2
|
-
declare type setFalse = () => void;
|
3
|
-
declare type toggle = () => void;
|
4
|
-
export default function useBooleanState(defaultValue: boolean): [boolean, setTrue, setFalse, toggle];
|
5
|
-
export {};
|
1
|
+
declare type setTrue = () => void;
|
2
|
+
declare type setFalse = () => void;
|
3
|
+
declare type toggle = () => void;
|
4
|
+
export default function useBooleanState(defaultValue: boolean): [boolean, setTrue, setFalse, toggle];
|
5
|
+
export {};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export default function useBooleanState(defaultValue) {
|
3
|
-
const [state, setState] = React.useState(defaultValue);
|
4
|
-
const turnOn = React.useCallback(() => setState(true), []);
|
5
|
-
const turnOff = React.useCallback(() => setState(false), []);
|
6
|
-
const toggle = React.useCallback(() => setState((current) => !current), []);
|
7
|
-
return [state, turnOn, turnOff, toggle];
|
8
|
-
}
|
1
|
+
import * as React from 'react';
|
2
|
+
export default function useBooleanState(defaultValue) {
|
3
|
+
const [state, setState] = React.useState(defaultValue);
|
4
|
+
const turnOn = React.useCallback(() => setState(true), []);
|
5
|
+
const turnOff = React.useCallback(() => setState(false), []);
|
6
|
+
const toggle = React.useCallback(() => setState((current) => !current), []);
|
7
|
+
return [state, turnOn, turnOff, toggle];
|
8
|
+
}
|
9
9
|
//# sourceMappingURL=useBooleanState.js.map
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare const ButtonsConfigurationContext: React.Context<{
|
3
|
+
submit?: {
|
4
|
+
icon?: string | undefined;
|
5
|
+
label?: string | undefined;
|
6
|
+
} | undefined;
|
7
|
+
cancel?: {
|
8
|
+
icon?: string | undefined;
|
9
|
+
label?: string | undefined;
|
10
|
+
} | undefined;
|
11
|
+
saveDraft?: {
|
12
|
+
icon?: string | undefined;
|
13
|
+
label?: string | undefined;
|
14
|
+
} | undefined;
|
15
|
+
cancelPromptYes?: {
|
16
|
+
icon?: string | undefined;
|
17
|
+
label?: string | undefined;
|
18
|
+
} | undefined;
|
19
|
+
cancelPromptNo?: {
|
20
|
+
icon?: string | undefined;
|
21
|
+
label?: string | undefined;
|
22
|
+
} | undefined;
|
23
|
+
} | undefined>;
|
24
|
+
export default function useButtonsConfiguration(): {
|
25
|
+
submit?: {
|
26
|
+
icon?: string | undefined;
|
27
|
+
label?: string | undefined;
|
28
|
+
} | undefined;
|
29
|
+
cancel?: {
|
30
|
+
icon?: string | undefined;
|
31
|
+
label?: string | undefined;
|
32
|
+
} | undefined;
|
33
|
+
saveDraft?: {
|
34
|
+
icon?: string | undefined;
|
35
|
+
label?: string | undefined;
|
36
|
+
} | undefined;
|
37
|
+
cancelPromptYes?: {
|
38
|
+
icon?: string | undefined;
|
39
|
+
label?: string | undefined;
|
40
|
+
} | undefined;
|
41
|
+
cancelPromptNo?: {
|
42
|
+
icon?: string | undefined;
|
43
|
+
label?: string | undefined;
|
44
|
+
} | undefined;
|
45
|
+
} | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useButtonsConfiguration.js","sourceRoot":"","sources":["../../src/hooks/useButtonsConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAE5D,EAAE,CAAC,CAAA;AAEL,MAAM,CAAC,OAAO,UAAU,uBAAuB;IAC7C,OAAO,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAA;AACtD,CAAC","sourcesContent":["import * as React from 'react'\nimport { FormsAppsTypes } from '@oneblink/types'\nexport const ButtonsConfigurationContext = React.createContext<\n FormsAppsTypes.FormsListStyles['buttons']\n>({})\n\nexport default function useButtonsConfiguration() {\n return React.useContext(ButtonsConfigurationContext)\n}\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export declare const CaptchaSiteKeyContext: React.Context<string | undefined>;
|
3
|
-
export default function useCaptchaSiteKey(): string | undefined;
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare const CaptchaSiteKeyContext: React.Context<string | undefined>;
|
3
|
+
export default function useCaptchaSiteKey(): string | undefined;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export const CaptchaSiteKeyContext = React.createContext(undefined);
|
3
|
-
export default function useCaptchaSiteKey() {
|
4
|
-
return React.useContext(CaptchaSiteKeyContext);
|
5
|
-
}
|
1
|
+
import * as React from 'react';
|
2
|
+
export const CaptchaSiteKeyContext = React.createContext(undefined);
|
3
|
+
export default function useCaptchaSiteKey() {
|
4
|
+
return React.useContext(CaptchaSiteKeyContext);
|
5
|
+
}
|
6
6
|
//# sourceMappingURL=useCaptchaSiteKey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function useChangeEffect(effect: () => void | (() => void), dependencies: unknown[]): void;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export default function useChangeEffect(effect, dependencies) {
|
3
|
+
const initializeRef = React.useRef(false);
|
4
|
+
React.useEffect(() => {
|
5
|
+
if (initializeRef.current) {
|
6
|
+
return effect();
|
7
|
+
}
|
8
|
+
else {
|
9
|
+
initializeRef.current = true;
|
10
|
+
}
|
11
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
12
|
+
}, [dependencies]);
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=useChangeEffect.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useChangeEffect.js","sourceRoot":"","sources":["../../src/hooks/useChangeEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,MAAiC,EACjC,YAAuB;IAEvB,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEzC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,aAAa,CAAC,OAAO,EAAE;YACzB,OAAO,MAAM,EAAE,CAAA;SAChB;aAAM;YACL,aAAa,CAAC,OAAO,GAAG,IAAI,CAAA;SAC7B;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;AACpB,CAAC","sourcesContent":["import * as React from 'react'\n\nexport default function useChangeEffect(\n effect: () => void | (() => void),\n dependencies: unknown[],\n) {\n const initializeRef = React.useRef(false)\n\n React.useEffect(() => {\n if (initializeRef.current) {\n return effect()\n } else {\n initializeRef.current = true\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dependencies])\n}\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export default function useClickOutsideElement(ref: {
|
2
|
-
current: HTMLElement | null;
|
3
|
-
}, callback: () => void): void;
|
1
|
+
export default function useClickOutsideElement(ref: {
|
2
|
+
current: HTMLElement | null;
|
3
|
+
}, callback: () => void): void;
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export default function useClickOutsideElement(ref, callback) {
|
3
|
-
const handleClickOutside = React.useCallback((event) => {
|
4
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
5
|
-
callback();
|
6
|
-
}
|
7
|
-
}, [callback, ref]);
|
8
|
-
React.useEffect(() => {
|
9
|
-
document.addEventListener('mousedown', handleClickOutside);
|
10
|
-
return () => {
|
11
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
12
|
-
};
|
13
|
-
}, [handleClickOutside]);
|
14
|
-
}
|
1
|
+
import * as React from 'react';
|
2
|
+
export default function useClickOutsideElement(ref, callback) {
|
3
|
+
const handleClickOutside = React.useCallback((event) => {
|
4
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
5
|
+
callback();
|
6
|
+
}
|
7
|
+
}, [callback, ref]);
|
8
|
+
React.useEffect(() => {
|
9
|
+
document.addEventListener('mousedown', handleClickOutside);
|
10
|
+
return () => {
|
11
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
12
|
+
};
|
13
|
+
}, [handleClickOutside]);
|
14
|
+
}
|
15
15
|
//# sourceMappingURL=useClickOutsideElement.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { FormTypes } from '@oneblink/types';
|
2
|
-
import { FormElementsConditionallyShown, FormSubmissionModel } from '../types/form';
|
3
|
-
export default function useConditionalLogic(definition: FormTypes.Form, submission: FormSubmissionModel): {
|
4
|
-
conditionalLogicError: Error | undefined;
|
5
|
-
formElementsConditionallyShown: FormElementsConditionallyShown;
|
6
|
-
};
|
1
|
+
import { FormTypes } from '@oneblink/types';
|
2
|
+
import { FormElementsConditionallyShown, FormSubmissionModel } from '../types/form';
|
3
|
+
export default function useConditionalLogic(definition: FormTypes.Form, submission: FormSubmissionModel): {
|
4
|
+
conditionalLogicError: Error | undefined;
|
5
|
+
formElementsConditionallyShown: FormElementsConditionallyShown;
|
6
|
+
};
|