@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 @@
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../src/components/renderer/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAS,EAAE,EAAE;IACrD,OAAO,CACL,oBAAC,cAAc,IACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,aAAa,EACrB,KAAK,EAAE,QAAQ,GACf,CACH,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,WAAW,CAAC,CAAA","sourcesContent":["import { LinearProgress } from '@mui/material'\nimport * as React from 'react'\n\ninterface Props {\n progress: number\n className?: string\n}\n\nconst ProgressBar = ({ progress, className }: Props) => {\n return (\n <LinearProgress\n className={className}\n variant=\"determinate\"\n value={progress}\n />\n )\n}\n\nexport default React.memo<Props>(ProgressBar)\n"]}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { FormTypes } from '@oneblink/types';
|
3
|
-
import { FormElementValueChangeHandler } from '../../types/form';
|
4
|
-
interface Props {
|
5
|
-
id: string;
|
6
|
-
element: FormTypes.CheckboxElement | FormTypes.SelectElement;
|
7
|
-
options: FormTypes.ChoiceElementOption[];
|
8
|
-
selected: string[];
|
9
|
-
onChange: FormElementValueChangeHandler<string[]>;
|
10
|
-
disabled?: boolean;
|
11
|
-
}
|
12
|
-
declare const _default: React.NamedExoticComponent<Props>;
|
13
|
-
export default _default;
|
1
|
+
import * as React from 'react';
|
2
|
+
import { FormTypes } from '@oneblink/types';
|
3
|
+
import { FormElementValueChangeHandler } from '../../types/form';
|
4
|
+
interface Props {
|
5
|
+
id: string;
|
6
|
+
element: FormTypes.CheckboxElement | FormTypes.SelectElement;
|
7
|
+
options: FormTypes.ChoiceElementOption[];
|
8
|
+
selected: string[];
|
9
|
+
onChange: FormElementValueChangeHandler<string[]>;
|
10
|
+
disabled?: boolean;
|
11
|
+
}
|
12
|
+
declare const _default: React.NamedExoticComponent<Props>;
|
13
|
+
export default _default;
|
@@ -1,27 +1,27 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Checkbox } from '@mui/material';
|
3
|
-
const ToggleAllCheckbox = ({ id, element, options, selected, onChange, disabled, }) => {
|
4
|
-
const allSelected = React.useMemo(() => {
|
5
|
-
return options.every((option) => {
|
6
|
-
return selected.includes(option.value);
|
7
|
-
});
|
8
|
-
}, [options, selected]);
|
9
|
-
const handleToggleAll = React.useCallback((isSelectingAll) => {
|
10
|
-
if (isSelectingAll) {
|
11
|
-
onChange(element, options.map((opt) => opt.value));
|
12
|
-
}
|
13
|
-
else {
|
14
|
-
onChange(element, undefined);
|
15
|
-
}
|
16
|
-
}, [element, options, onChange]);
|
17
|
-
return (React.createElement("label", { className: "checkbox ob-checkbox__input-label cypress-checkbox-label", htmlFor: `${id}_select-all`, style: {
|
18
|
-
fontStyle: 'italic',
|
19
|
-
marginBottom: '1.25rem',
|
20
|
-
} },
|
21
|
-
React.createElement(Checkbox, { color: "default", classes: {
|
22
|
-
checked: 'ob-checkbox__input-checked',
|
23
|
-
}, className: "ob-checkbox__input cypress-checkbox-control", id: `${id}_select-all`, disableRipple: true, checked: allSelected, indeterminate: !!selected.length && !allSelected, onChange: (e) => handleToggleAll(e.target.checked), disabled: disabled }),
|
24
|
-
allSelected ? 'Deselect All' : 'Select All'));
|
25
|
-
};
|
26
|
-
export default React.memo(ToggleAllCheckbox);
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Checkbox } from '@mui/material';
|
3
|
+
const ToggleAllCheckbox = ({ id, element, options, selected, onChange, disabled, }) => {
|
4
|
+
const allSelected = React.useMemo(() => {
|
5
|
+
return options.every((option) => {
|
6
|
+
return selected.includes(option.value);
|
7
|
+
});
|
8
|
+
}, [options, selected]);
|
9
|
+
const handleToggleAll = React.useCallback((isSelectingAll) => {
|
10
|
+
if (isSelectingAll) {
|
11
|
+
onChange(element, options.map((opt) => opt.value));
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
onChange(element, undefined);
|
15
|
+
}
|
16
|
+
}, [element, options, onChange]);
|
17
|
+
return (React.createElement("label", { className: "checkbox ob-checkbox__input-label cypress-checkbox-label", htmlFor: `${id}_select-all`, style: {
|
18
|
+
fontStyle: 'italic',
|
19
|
+
marginBottom: '1.25rem',
|
20
|
+
} },
|
21
|
+
React.createElement(Checkbox, { color: "default", classes: {
|
22
|
+
checked: 'ob-checkbox__input-checked',
|
23
|
+
}, className: "ob-checkbox__input cypress-checkbox-control", id: `${id}_select-all`, disableRipple: true, checked: allSelected, indeterminate: !!selected.length && !allSelected, onChange: (e) => handleToggleAll(e.target.checked), disabled: disabled }),
|
24
|
+
allSelected ? 'Deselect All' : 'Select All'));
|
25
|
+
};
|
26
|
+
export default React.memo(ToggleAllCheckbox);
|
27
27
|
//# sourceMappingURL=ToggleAllCheckbox.js.map
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
declare const _default: React.MemoExoticComponent<({ isUploading, isUploadPaused, uploadError, loadImageUrlError, isLoadingImageUrl, imageUrl, }: {
|
3
|
-
isUploading?: boolean | undefined;
|
4
|
-
isUploadPaused?: boolean | undefined;
|
5
|
-
uploadError?: Error | undefined;
|
6
|
-
loadImageUrlError?: Error | undefined;
|
7
|
-
isLoadingImageUrl?: boolean | undefined;
|
8
|
-
imageUrl: string | null | undefined;
|
9
|
-
}) => JSX.Element>;
|
10
|
-
export default _default;
|
1
|
+
import * as React from 'react';
|
2
|
+
declare const _default: React.MemoExoticComponent<({ isUploading, isUploadPaused, uploadError, loadImageUrlError, isLoadingImageUrl, imageUrl, }: {
|
3
|
+
isUploading?: boolean | undefined;
|
4
|
+
isUploadPaused?: boolean | undefined;
|
5
|
+
uploadError?: Error | undefined;
|
6
|
+
loadImageUrlError?: Error | undefined;
|
7
|
+
isLoadingImageUrl?: boolean | undefined;
|
8
|
+
imageUrl: string | null | undefined;
|
9
|
+
}) => JSX.Element | null>;
|
10
|
+
export default _default;
|
@@ -1,31 +1,37 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Tooltip } from '@mui/material';
|
3
|
-
import
|
4
|
-
const AttachmentStatus = ({ isUploading, isUploadPaused, uploadError, loadImageUrlError, isLoadingImageUrl, imageUrl, }) => {
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Tooltip } from '@mui/material';
|
3
|
+
import useIsOffline from '../../../hooks/useIsOffline';
|
4
|
+
const AttachmentStatus = ({ isUploading, isUploadPaused, uploadError, loadImageUrlError, isLoadingImageUrl, imageUrl, }) => {
|
5
|
+
const isOffline = useIsOffline();
|
6
|
+
const tooltip = React.useMemo(() => {
|
7
|
+
if (isLoadingImageUrl && !imageUrl) {
|
8
|
+
return 'Attempting to load file preview. File is synced with submission.';
|
9
|
+
}
|
10
|
+
if (loadImageUrlError && !imageUrl) {
|
11
|
+
return 'File preview not available, however file is synced with submission.';
|
12
|
+
}
|
13
|
+
return 'Synced with submission.';
|
14
|
+
}, [imageUrl, isLoadingImageUrl, loadImageUrlError]);
|
15
|
+
if (uploadError) {
|
16
|
+
return (React.createElement(Tooltip, { title: uploadError.message },
|
17
|
+
React.createElement("span", { className: "attachment__status-wrapper" },
|
18
|
+
React.createElement("i", { className: "material-icons has-text-danger" }, "error"))));
|
19
|
+
}
|
20
|
+
if (isUploading) {
|
21
|
+
if (isUploadPaused) {
|
22
|
+
return (React.createElement("span", { className: "attachment__status-wrapper" },
|
23
|
+
React.createElement("i", { className: "material-icons" }, "pause")));
|
24
|
+
}
|
25
|
+
if (isOffline) {
|
26
|
+
return (React.createElement(Tooltip, { title: "Upload will start when you connect to the internet" },
|
27
|
+
React.createElement("div", { className: "cypress-attachment-uploading" },
|
28
|
+
React.createElement("i", { className: "material-icons has-text-warning" }, "wifi_off"))));
|
29
|
+
}
|
30
|
+
return null;
|
31
|
+
}
|
32
|
+
return (React.createElement(Tooltip, { title: tooltip },
|
33
|
+
React.createElement("span", { className: "attachment__status-wrapper" },
|
34
|
+
React.createElement("i", { className: "material-icons has-text-success" }, "check_circle"))));
|
35
|
+
};
|
36
|
+
export default React.memo(AttachmentStatus);
|
31
37
|
//# sourceMappingURL=AttachmentStatus.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentStatus.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/AttachmentStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,
|
1
|
+
{"version":3,"file":"AttachmentStatus.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/AttachmentStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,YAAY,MAAM,6BAA6B,CAAA;AAEtD,MAAM,gBAAgB,GAAG,CAAC,EACxB,WAAW,EACX,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,GAQT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,iBAAiB,IAAI,CAAC,QAAQ,EAAE;YAClC,OAAO,kEAAkE,CAAA;SAC1E;QACD,IAAI,iBAAiB,IAAI,CAAC,QAAQ,EAAE;YAClC,OAAO,qEAAqE,CAAA;SAC7E;QAED,OAAO,yBAAyB,CAAA;IAClC,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAEpD,IAAI,WAAW,EAAE;QACf,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,WAAW,CAAC,OAAO;YACjC,8BAAM,SAAS,EAAC,4BAA4B;gBAC1C,2BAAG,SAAS,EAAC,gCAAgC,YAAU,CAClD,CACC,CACX,CAAA;KACF;IAED,IAAI,WAAW,EAAE;QACf,IAAI,cAAc,EAAE;YAClB,OAAO,CACL,8BAAM,SAAS,EAAC,4BAA4B;gBAC1C,2BAAG,SAAS,EAAC,gBAAgB,YAAU,CAClC,CACR,CAAA;SACF;QACD,IAAI,SAAS,EAAE;YACb,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAC,oDAAoD;gBACjE,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,2BAAG,SAAS,EAAC,iCAAiC,eAAa,CACvD,CACE,CACX,CAAA;SACF;QACD,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,OAAO;QACrB,8BAAM,SAAS,EAAC,4BAA4B;YAC1C,2BAAG,SAAS,EAAC,iCAAiC,mBAAiB,CAC1D,CACC,CACX,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Tooltip } from '@mui/material'\nimport useIsOffline from '../../../hooks/useIsOffline'\n\nconst AttachmentStatus = ({\n isUploading,\n isUploadPaused,\n uploadError,\n loadImageUrlError,\n isLoadingImageUrl,\n imageUrl,\n}: {\n isUploading?: boolean\n isUploadPaused?: boolean\n uploadError?: Error\n loadImageUrlError?: Error\n isLoadingImageUrl?: boolean\n imageUrl: string | null | undefined\n}) => {\n const isOffline = useIsOffline()\n\n const tooltip = React.useMemo(() => {\n if (isLoadingImageUrl && !imageUrl) {\n return 'Attempting to load file preview. File is synced with submission.'\n }\n if (loadImageUrlError && !imageUrl) {\n return 'File preview not available, however file is synced with submission.'\n }\n\n return 'Synced with submission.'\n }, [imageUrl, isLoadingImageUrl, loadImageUrlError])\n\n if (uploadError) {\n return (\n <Tooltip title={uploadError.message}>\n <span className=\"attachment__status-wrapper\">\n <i className=\"material-icons has-text-danger\">error</i>\n </span>\n </Tooltip>\n )\n }\n\n if (isUploading) {\n if (isUploadPaused) {\n return (\n <span className=\"attachment__status-wrapper\">\n <i className=\"material-icons\">pause</i>\n </span>\n )\n }\n if (isOffline) {\n return (\n <Tooltip title=\"Upload will start when you connect to the internet\">\n <div className=\"cypress-attachment-uploading\">\n <i className=\"material-icons has-text-warning\">wifi_off</i>\n </div>\n </Tooltip>\n )\n }\n return null\n }\n\n return (\n <Tooltip title={tooltip}>\n <span className=\"attachment__status-wrapper\">\n <i className=\"material-icons has-text-success\">check_circle</i>\n </span>\n </Tooltip>\n )\n}\n\nexport default React.memo(AttachmentStatus)\n"]}
|
@@ -1,18 +1,19 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { FormTypes } from '@oneblink/types';
|
3
|
-
declare type Props = {
|
4
|
-
element: FormTypes.FilesElement;
|
5
|
-
isUploading?: boolean;
|
6
|
-
isUploadPaused?: boolean;
|
7
|
-
uploadErrorMessage?: string;
|
8
|
-
loadImageUrlError?: Error;
|
9
|
-
isLoadingImageUrl?: boolean;
|
10
|
-
fileName: string;
|
11
|
-
imageUrl: string | undefined | null;
|
12
|
-
onRemove: () => void;
|
13
|
-
onDownload?: () => void;
|
14
|
-
onRetry?: () => void;
|
15
|
-
|
16
|
-
|
17
|
-
declare
|
18
|
-
|
1
|
+
import * as React from 'react';
|
2
|
+
import { FormTypes } from '@oneblink/types';
|
3
|
+
declare type Props = {
|
4
|
+
element: FormTypes.FilesElement;
|
5
|
+
isUploading?: boolean;
|
6
|
+
isUploadPaused?: boolean;
|
7
|
+
uploadErrorMessage?: string;
|
8
|
+
loadImageUrlError?: Error;
|
9
|
+
isLoadingImageUrl?: boolean;
|
10
|
+
fileName: string;
|
11
|
+
imageUrl: string | undefined | null;
|
12
|
+
onRemove: () => void;
|
13
|
+
onDownload?: () => void;
|
14
|
+
onRetry?: () => void;
|
15
|
+
progress: undefined | number;
|
16
|
+
};
|
17
|
+
declare function FileCard({ element, isUploading, isUploadPaused, uploadErrorMessage, loadImageUrlError, isLoadingImageUrl, imageUrl, fileName, onDownload, onRemove, onRetry, progress, }: Props): JSX.Element;
|
18
|
+
declare const _default: React.MemoExoticComponent<typeof FileCard>;
|
19
|
+
export default _default;
|
@@ -1,58 +1,61 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import clsx from 'clsx';
|
3
|
-
import useBooleanState from '../../../hooks/useBooleanState';
|
4
|
-
import useClickOutsideElement from '../../../hooks/useClickOutsideElement';
|
5
|
-
import FileCardContent from './FileCardContent';
|
6
|
-
import AttachmentStatus from './AttachmentStatus';
|
7
|
-
import { checkFileNameIsValid, checkFileNameExtensionIsValid, } from '../../../services/form-validation';
|
8
|
-
|
9
|
-
|
10
|
-
const
|
11
|
-
const
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
React.createElement("div", { className:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
}
|
57
|
-
|
1
|
+
import * as React from 'react';
|
2
|
+
import clsx from 'clsx';
|
3
|
+
import useBooleanState from '../../../hooks/useBooleanState';
|
4
|
+
import useClickOutsideElement from '../../../hooks/useClickOutsideElement';
|
5
|
+
import FileCardContent from './FileCardContent';
|
6
|
+
import AttachmentStatus from './AttachmentStatus';
|
7
|
+
import { checkFileNameIsValid, checkFileNameExtensionIsValid, } from '../../../services/form-validation';
|
8
|
+
import ProgressBar from './ProgressBar';
|
9
|
+
function FileCard({ element, isUploading, isUploadPaused, uploadErrorMessage, loadImageUrlError, isLoadingImageUrl, imageUrl, fileName, onDownload, onRemove, onRetry, progress, }) {
|
10
|
+
const dropDownRef = React.useRef(null);
|
11
|
+
const [isShowingMore, showMore, hideMore] = useBooleanState(false);
|
12
|
+
const uploadError = React.useMemo(() => {
|
13
|
+
if (!checkFileNameIsValid(element, fileName)) {
|
14
|
+
return new Error(`${fileName.split('.').pop()} files are not allowed`);
|
15
|
+
}
|
16
|
+
if (!checkFileNameExtensionIsValid(element, fileName)) {
|
17
|
+
return new Error(`${fileName} must have an extension`);
|
18
|
+
}
|
19
|
+
if (uploadErrorMessage) {
|
20
|
+
return new Error(uploadErrorMessage);
|
21
|
+
}
|
22
|
+
}, [element, fileName, uploadErrorMessage]);
|
23
|
+
useClickOutsideElement(dropDownRef, React.useCallback(() => {
|
24
|
+
if (isShowingMore) {
|
25
|
+
hideMore();
|
26
|
+
}
|
27
|
+
}, [hideMore, isShowingMore]));
|
28
|
+
const progressTooltipRef = React.useRef(null);
|
29
|
+
return (React.createElement("div", { className: "column is-one-quarter" },
|
30
|
+
React.createElement("div", { className: "ob-files__box" },
|
31
|
+
React.createElement("div", { className: "ob-files__content" },
|
32
|
+
React.createElement(FileCardContent, { imageUrl: imageUrl })),
|
33
|
+
React.createElement("div", { className: clsx('dropdown is-right ob-files__menu', {
|
34
|
+
'is-active': isShowingMore,
|
35
|
+
}), ref: dropDownRef },
|
36
|
+
React.createElement("div", { className: "dropdown-trigger" },
|
37
|
+
React.createElement("button", { type: "button", className: "button ob-files__menu-button cypress-file-menu-button", "aria-haspopup": "true", "aria-controls": "dropdown-menu", onClick: isShowingMore ? hideMore : showMore },
|
38
|
+
React.createElement("i", { className: "material-icons ob-files__menu-icon" }, "more_vert"))),
|
39
|
+
React.createElement("div", { className: "dropdown-menu", role: "menu" },
|
40
|
+
React.createElement("div", { className: "dropdown-content" },
|
41
|
+
onRetry && (React.createElement("a", { className: "dropdown-item cypress-file-retry-button", onClick: () => {
|
42
|
+
hideMore();
|
43
|
+
onRetry();
|
44
|
+
} }, "Retry")),
|
45
|
+
onDownload && (React.createElement("a", { className: "dropdown-item cypress-file-download-button", onClick: () => {
|
46
|
+
hideMore();
|
47
|
+
onDownload();
|
48
|
+
} }, "Download")),
|
49
|
+
React.createElement("a", { className: clsx('dropdown-item cypress-file-remove-button', {
|
50
|
+
'ob-files__menu-remove-hidden': element.readOnly,
|
51
|
+
}), onClick: () => {
|
52
|
+
hideMore();
|
53
|
+
onRemove();
|
54
|
+
} }, "Remove")))),
|
55
|
+
React.createElement("div", { className: "ob-files__file-name is-size-6", ref: progressTooltipRef },
|
56
|
+
React.createElement("span", { className: "ob-files__file-name-inner" }, fileName),
|
57
|
+
React.createElement(AttachmentStatus, { isUploading: isUploading, isUploadPaused: isUploadPaused, uploadError: uploadError, loadImageUrlError: loadImageUrlError, isLoadingImageUrl: isLoadingImageUrl, imageUrl: imageUrl }),
|
58
|
+
progressTooltipRef.current && (React.createElement(ProgressBar, { progress: progress, isShowing: !!isUploading, tooltipAnchorEl: progressTooltipRef.current }))))));
|
59
|
+
}
|
60
|
+
export default React.memo(FileCard);
|
58
61
|
//# sourceMappingURL=FileCard.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileCard.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/FileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,eAAe,MAAM,gCAAgC,CAAA;AAC5D,OAAO,sBAAsB,MAAM,uCAAuC,CAAA;AAE1E,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EACL,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAA;
|
1
|
+
{"version":3,"file":"FileCard.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/FileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,eAAe,MAAM,gCAAgC,CAAA;AAC5D,OAAO,sBAAsB,MAAM,uCAAuC,CAAA;AAE1E,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EACL,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,WAAW,MAAM,eAAe,CAAA;AAiBvC,SAAS,QAAQ,CAAC,EAChB,OAAO,EACP,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,GACF;IACN,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACtC,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAElE,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACrC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;YAC5C,OAAO,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAA;SACvE;QACD,IAAI,CAAC,6BAA6B,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;YACrD,OAAO,IAAI,KAAK,CAAC,GAAG,QAAQ,yBAAyB,CAAC,CAAA;SACvD;QACD,IAAI,kBAAkB,EAAE;YACtB,OAAO,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;SACrC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAA;IAE3C,sBAAsB,CACpB,WAAW,EACX,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACrB,IAAI,aAAa,EAAE;YACjB,QAAQ,EAAE,CAAA;SACX;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAC9B,CAAA;IAED,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC7D,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,6BAAK,SAAS,EAAC,eAAe;YAC5B,6BAAK,SAAS,EAAC,mBAAmB;gBAChC,oBAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACnC;YACN,6BACE,SAAS,EAAE,IAAI,CAAC,kCAAkC,EAAE;oBAClD,WAAW,EAAE,aAAa;iBAC3B,CAAC,EACF,GAAG,EAAE,WAAW;gBAEhB,6BAAK,SAAS,EAAC,kBAAkB;oBAC/B,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uDAAuD,mBACnD,MAAM,mBACN,eAAe,EAC7B,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;wBAE5C,2BAAG,SAAS,EAAC,oCAAoC,gBAAc,CACxD,CACL;gBACN,6BAAK,SAAS,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM;oBACxC,6BAAK,SAAS,EAAC,kBAAkB;wBAC9B,OAAO,IAAI,CACV,2BACE,SAAS,EAAC,yCAAyC,EACnD,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAA;gCACV,OAAO,EAAE,CAAA;4BACX,CAAC,YAGC,CACL;wBACA,UAAU,IAAI,CACb,2BACE,SAAS,EAAC,4CAA4C,EACtD,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAA;gCACV,UAAU,EAAE,CAAA;4BACd,CAAC,eAGC,CACL;wBACD,2BACE,SAAS,EAAE,IAAI,CAAC,0CAA0C,EAAE;gCAC1D,8BAA8B,EAAE,OAAO,CAAC,QAAQ;6BACjD,CAAC,EACF,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAA;gCACV,QAAQ,EAAE,CAAA;4BACZ,CAAC,aAGC,CACA,CACF,CACF;YAEN,6BAAK,SAAS,EAAC,+BAA+B,EAAC,GAAG,EAAE,kBAAkB;gBACpE,8BAAM,SAAS,EAAC,2BAA2B,IAAE,QAAQ,CAAQ;gBAC7D,oBAAC,gBAAgB,IACf,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,QAAQ,GAClB;gBACD,kBAAkB,CAAC,OAAO,IAAI,CAC7B,oBAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,CAAC,WAAW,EACxB,eAAe,EAAE,kBAAkB,CAAC,OAAO,GAC3C,CACH,CACG,CACF,CACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport clsx from 'clsx'\nimport useBooleanState from '../../../hooks/useBooleanState'\nimport useClickOutsideElement from '../../../hooks/useClickOutsideElement'\nimport { FormTypes } from '@oneblink/types'\nimport FileCardContent from './FileCardContent'\nimport AttachmentStatus from './AttachmentStatus'\nimport {\n checkFileNameIsValid,\n checkFileNameExtensionIsValid,\n} from '../../../services/form-validation'\nimport ProgressBar from './ProgressBar'\n\ntype Props = {\n element: FormTypes.FilesElement\n isUploading?: boolean\n isUploadPaused?: boolean\n uploadErrorMessage?: string\n loadImageUrlError?: Error\n isLoadingImageUrl?: boolean\n fileName: string\n imageUrl: string | undefined | null\n onRemove: () => void\n onDownload?: () => void\n onRetry?: () => void\n progress: undefined | number\n}\n\nfunction FileCard({\n element,\n isUploading,\n isUploadPaused,\n uploadErrorMessage,\n loadImageUrlError,\n isLoadingImageUrl,\n imageUrl,\n fileName,\n onDownload,\n onRemove,\n onRetry,\n progress,\n}: Props) {\n const dropDownRef = React.useRef(null)\n const [isShowingMore, showMore, hideMore] = useBooleanState(false)\n\n const uploadError = React.useMemo(() => {\n if (!checkFileNameIsValid(element, fileName)) {\n return new Error(`${fileName.split('.').pop()} files are not allowed`)\n }\n if (!checkFileNameExtensionIsValid(element, fileName)) {\n return new Error(`${fileName} must have an extension`)\n }\n if (uploadErrorMessage) {\n return new Error(uploadErrorMessage)\n }\n }, [element, fileName, uploadErrorMessage])\n\n useClickOutsideElement(\n dropDownRef,\n React.useCallback(() => {\n if (isShowingMore) {\n hideMore()\n }\n }, [hideMore, isShowingMore]),\n )\n\n const progressTooltipRef = React.useRef<HTMLDivElement>(null)\n return (\n <div className=\"column is-one-quarter\">\n <div className=\"ob-files__box\">\n <div className=\"ob-files__content\">\n <FileCardContent imageUrl={imageUrl} />\n </div>\n <div\n className={clsx('dropdown is-right ob-files__menu', {\n 'is-active': isShowingMore,\n })}\n ref={dropDownRef}\n >\n <div className=\"dropdown-trigger\">\n <button\n type=\"button\"\n className=\"button ob-files__menu-button cypress-file-menu-button\"\n aria-haspopup=\"true\"\n aria-controls=\"dropdown-menu\"\n onClick={isShowingMore ? hideMore : showMore}\n >\n <i className=\"material-icons ob-files__menu-icon\">more_vert</i>\n </button>\n </div>\n <div className=\"dropdown-menu\" role=\"menu\">\n <div className=\"dropdown-content\">\n {onRetry && (\n <a\n className=\"dropdown-item cypress-file-retry-button\"\n onClick={() => {\n hideMore()\n onRetry()\n }}\n >\n Retry\n </a>\n )}\n {onDownload && (\n <a\n className=\"dropdown-item cypress-file-download-button\"\n onClick={() => {\n hideMore()\n onDownload()\n }}\n >\n Download\n </a>\n )}\n <a\n className={clsx('dropdown-item cypress-file-remove-button', {\n 'ob-files__menu-remove-hidden': element.readOnly,\n })}\n onClick={() => {\n hideMore()\n onRemove()\n }}\n >\n Remove\n </a>\n </div>\n </div>\n </div>\n\n <div className=\"ob-files__file-name is-size-6\" ref={progressTooltipRef}>\n <span className=\"ob-files__file-name-inner\">{fileName}</span>\n <AttachmentStatus\n isUploading={isUploading}\n isUploadPaused={isUploadPaused}\n uploadError={uploadError}\n loadImageUrlError={loadImageUrlError}\n isLoadingImageUrl={isLoadingImageUrl}\n imageUrl={imageUrl}\n />\n {progressTooltipRef.current && (\n <ProgressBar\n progress={progress}\n isShowing={!!isUploading}\n tooltipAnchorEl={progressTooltipRef.current}\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nexport default React.memo(FileCard)\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
declare const _default: React.MemoExoticComponent<({ imageUrl, }: {
|
3
|
-
imageUrl: string | null | undefined;
|
4
|
-
}) => JSX.Element>;
|
5
|
-
export default _default;
|
1
|
+
import * as React from 'react';
|
2
|
+
declare const _default: React.MemoExoticComponent<({ imageUrl, }: {
|
3
|
+
imageUrl: string | null | undefined;
|
4
|
+
}) => JSX.Element>;
|
5
|
+
export default _default;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
const FileCardContent = ({ imageUrl, }) => {
|
3
|
-
if (imageUrl) {
|
4
|
-
return (React.createElement("div", { className: "ob-files__content-image" },
|
5
|
-
React.createElement("img", { className: "ob-files__image", src: imageUrl })));
|
6
|
-
}
|
7
|
-
return (React.createElement("div", { className: "ob-files__content-file has-text-centered" },
|
8
|
-
React.createElement("i", { className: "material-icons icon-large ob-files__attach-icon has-text-grey" }, "attach_file")));
|
9
|
-
};
|
10
|
-
export default React.memo(FileCardContent);
|
1
|
+
import * as React from 'react';
|
2
|
+
const FileCardContent = ({ imageUrl, }) => {
|
3
|
+
if (imageUrl) {
|
4
|
+
return (React.createElement("div", { className: "ob-files__content-image" },
|
5
|
+
React.createElement("img", { className: "ob-files__image", src: imageUrl })));
|
6
|
+
}
|
7
|
+
return (React.createElement("div", { className: "ob-files__content-file has-text-centered" },
|
8
|
+
React.createElement("i", { className: "material-icons icon-large ob-files__attach-icon has-text-grey" }, "attach_file")));
|
9
|
+
};
|
10
|
+
export default React.memo(FileCardContent);
|
11
11
|
//# sourceMappingURL=FileCardContent.js.map
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { FormTypes } from '@oneblink/types';
|
3
|
+
declare function Files<T>({ id, element, isDirty, attachments, validationMessage, displayValidationMessage, onAddFiles, onRenderAttachment, }: {
|
4
|
+
id: string;
|
5
|
+
element: FormTypes.FilesElement;
|
6
|
+
isDirty: boolean;
|
7
|
+
attachments: T[];
|
8
|
+
displayValidationMessage: boolean;
|
9
|
+
validationMessage: string | undefined;
|
10
|
+
onAddFiles: (files: File[]) => void;
|
11
|
+
onRenderAttachment: (attachment: T, index: number) => React.ReactNode;
|
12
|
+
}): JSX.Element;
|
13
|
+
declare const _default: React.MemoExoticComponent<typeof Files>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import FormElementLabelContainer from '../FormElementLabelContainer';
|
3
|
+
function Files({ id, element, isDirty, attachments, validationMessage, displayValidationMessage, onAddFiles, onRenderAttachment, }) {
|
4
|
+
const inputRef = React.useRef(null);
|
5
|
+
const handleAdd = React.useCallback(() => {
|
6
|
+
if (!inputRef.current)
|
7
|
+
return;
|
8
|
+
// RESET HTML FILE INPUT VALUE SO FILES PREVIOUSLY ADDED AND REMOVED ARE RECOGNISED
|
9
|
+
inputRef.current.value = '';
|
10
|
+
inputRef.current.click();
|
11
|
+
}, []);
|
12
|
+
return (React.createElement("div", { className: "cypress-files-element" },
|
13
|
+
React.createElement(FormElementLabelContainer, { className: "ob-files", element: element, id: id, required: !!element.minEntries },
|
14
|
+
React.createElement("input", { ref: inputRef, type: "file", name: element.name, id: id, className: "file-input ob-input", multiple: element.maxEntries !== 1, disabled: element.readOnly, onChange: (event) => onAddFiles(event.target.files ? Array.from(event.target.files) : []) }),
|
15
|
+
React.createElement("div", { className: "control cypress-files-control" },
|
16
|
+
React.createElement("div", { className: "columns is-multiline" },
|
17
|
+
attachments.map(onRenderAttachment),
|
18
|
+
!element.readOnly &&
|
19
|
+
(!element.maxEntries ||
|
20
|
+
attachments.length < element.maxEntries) && (React.createElement("div", { className: "column is-one-quarter" },
|
21
|
+
React.createElement("button", { type: "button", className: "button ob-files__add-new-button", onClick: handleAdd },
|
22
|
+
React.createElement("i", { className: "material-icons icon-x-large" }, "add")))))),
|
23
|
+
(isDirty || displayValidationMessage) && !!validationMessage && (React.createElement("div", { role: "alert", className: "has-margin-top-8" },
|
24
|
+
React.createElement("div", { className: "has-text-danger ob-error__text cypress-validation-message" }, validationMessage))))));
|
25
|
+
}
|
26
|
+
export default React.memo(Files);
|
27
|
+
//# sourceMappingURL=Files.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Files.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/Files.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,yBAAyB,MAAM,8BAA8B,CAAA;AAEpE,SAAS,KAAK,CAAI,EAChB,EAAE,EACF,OAAO,EACP,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,UAAU,EACV,kBAAkB,GAUnB;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAM;QAC7B,mFAAmF;QACnF,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAA;QAC3B,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,oBAAC,yBAAyB,IACxB,SAAS,EAAC,UAAU,EACpB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU;YAE9B,+BACE,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,EAAE,EAAE,EAAE,EACN,SAAS,EAAC,qBAAqB,EAC/B,QAAQ,EAAE,OAAO,CAAC,UAAU,KAAK,CAAC,EAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAEtE;YACF,6BAAK,SAAS,EAAC,+BAA+B;gBAC5C,6BAAK,SAAS,EAAC,sBAAsB;oBAClC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC;oBACnC,CAAC,OAAO,CAAC,QAAQ;wBAChB,CAAC,CAAC,OAAO,CAAC,UAAU;4BAClB,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAC5C,6BAAK,SAAS,EAAC,uBAAuB;wBACpC,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,SAAS;4BAElB,2BAAG,SAAS,EAAC,6BAA6B,UAAQ,CAC3C,CACL,CACP,CACC,CACF;YAEL,CAAC,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,CAC/D,6BAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,kBAAkB;gBAC5C,6BAAK,SAAS,EAAC,2DAA2D,IACvE,iBAAiB,CACd,CACF,CACP,CACyB,CACxB,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA","sourcesContent":["import * as React from 'react'\n\nimport { FormTypes } from '@oneblink/types'\nimport FormElementLabelContainer from '../FormElementLabelContainer'\n\nfunction Files<T>({\n id,\n element,\n isDirty,\n attachments,\n validationMessage,\n displayValidationMessage,\n onAddFiles,\n onRenderAttachment,\n}: {\n id: string\n element: FormTypes.FilesElement\n isDirty: boolean\n attachments: T[]\n displayValidationMessage: boolean\n validationMessage: string | undefined\n onAddFiles: (files: File[]) => void\n onRenderAttachment: (attachment: T, index: number) => React.ReactNode\n}) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const handleAdd = React.useCallback(() => {\n if (!inputRef.current) return\n // RESET HTML FILE INPUT VALUE SO FILES PREVIOUSLY ADDED AND REMOVED ARE RECOGNISED\n inputRef.current.value = ''\n inputRef.current.click()\n }, [])\n\n return (\n <div className=\"cypress-files-element\">\n <FormElementLabelContainer\n className=\"ob-files\"\n element={element}\n id={id}\n required={!!element.minEntries}\n >\n <input\n ref={inputRef}\n type=\"file\"\n name={element.name}\n id={id}\n className=\"file-input ob-input\"\n multiple={element.maxEntries !== 1}\n disabled={element.readOnly}\n onChange={(event) =>\n onAddFiles(event.target.files ? Array.from(event.target.files) : [])\n }\n />\n <div className=\"control cypress-files-control\">\n <div className=\"columns is-multiline\">\n {attachments.map(onRenderAttachment)}\n {!element.readOnly &&\n (!element.maxEntries ||\n attachments.length < element.maxEntries) && (\n <div className=\"column is-one-quarter\">\n <button\n type=\"button\"\n className=\"button ob-files__add-new-button\"\n onClick={handleAdd}\n >\n <i className=\"material-icons icon-x-large\">add</i>\n </button>\n </div>\n )}\n </div>\n </div>\n\n {(isDirty || displayValidationMessage) && !!validationMessage && (\n <div role=\"alert\" className=\"has-margin-top-8\">\n <div className=\"has-text-danger ob-error__text cypress-validation-message\">\n {validationMessage}\n </div>\n </div>\n )}\n </FormElementLabelContainer>\n </div>\n )\n}\n\nexport default React.memo(Files)\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
declare function ImagePreviewUnavailable(): JSX.Element;
|
3
|
-
declare const _default: React.MemoExoticComponent<typeof ImagePreviewUnavailable>;
|
4
|
-
export default _default;
|
1
|
+
import * as React from 'react';
|
2
|
+
declare function ImagePreviewUnavailable(): JSX.Element;
|
3
|
+
declare const _default: React.MemoExoticComponent<typeof ImagePreviewUnavailable>;
|
4
|
+
export default _default;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import useIsOffline from '../../../hooks/useIsOffline';
|
3
|
-
function ImagePreviewUnavailable() {
|
4
|
-
const isOffline = useIsOffline();
|
5
|
-
return (React.createElement(React.Fragment, null, isOffline ? (React.createElement(React.Fragment, null,
|
6
|
-
React.createElement("i", { className: "material-icons has-text-warning icon-large has-margin-bottom-6" }, "wifi_off"),
|
7
|
-
React.createElement("p", null, "It looks like you're offline. Image preview will be available when connectivity is restored."))) : (React.createElement(React.Fragment, null,
|
8
|
-
React.createElement("i", { className: "material-icons has-text-grey icon-large has-margin-bottom-6" }, "attach_file"),
|
9
|
-
React.createElement("p", null, "You do not have access to preview this image, however, it will be included with your submission.")))));
|
10
|
-
}
|
11
|
-
export default React.memo(ImagePreviewUnavailable);
|
1
|
+
import * as React from 'react';
|
2
|
+
import useIsOffline from '../../../hooks/useIsOffline';
|
3
|
+
function ImagePreviewUnavailable() {
|
4
|
+
const isOffline = useIsOffline();
|
5
|
+
return (React.createElement(React.Fragment, null, isOffline ? (React.createElement(React.Fragment, null,
|
6
|
+
React.createElement("i", { className: "material-icons has-text-warning icon-large has-margin-bottom-6" }, "wifi_off"),
|
7
|
+
React.createElement("p", null, "It looks like you're offline. Image preview will be available when connectivity is restored."))) : (React.createElement(React.Fragment, null,
|
8
|
+
React.createElement("i", { className: "material-icons has-text-grey icon-large has-margin-bottom-6" }, "attach_file"),
|
9
|
+
React.createElement("p", null, "You do not have access to preview this image, however, it will be included with your submission.")))));
|
10
|
+
}
|
11
|
+
export default React.memo(ImagePreviewUnavailable);
|
12
12
|
//# sourceMappingURL=ImagePreviewUnavailable.js.map
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Tooltip, Fade } from '@mui/material';
|
3
|
+
import ProgressBar from '../ProgressBar';
|
4
|
+
import useBooleanState from '../../../hooks/useBooleanState';
|
5
|
+
const AttachmentProgressBar = ({ progress, isShowing, tooltipAnchorEl, }) => {
|
6
|
+
const [tooltipIsOpen, openTooltip, closeTooltip] = useBooleanState(false);
|
7
|
+
React.useEffect(() => {
|
8
|
+
if (tooltipAnchorEl && isShowing) {
|
9
|
+
console.log('Applying tooltip events...');
|
10
|
+
tooltipAnchorEl.onmouseenter = openTooltip;
|
11
|
+
tooltipAnchorEl.onmouseleave = closeTooltip;
|
12
|
+
}
|
13
|
+
if (!isShowing) {
|
14
|
+
closeTooltip();
|
15
|
+
}
|
16
|
+
return () => {
|
17
|
+
if (tooltipAnchorEl) {
|
18
|
+
console.log('Removing tooltip events...');
|
19
|
+
tooltipAnchorEl.onmouseenter = null;
|
20
|
+
tooltipAnchorEl.onmouseleave = null;
|
21
|
+
}
|
22
|
+
};
|
23
|
+
}, [closeTooltip, isShowing, openTooltip, tooltipAnchorEl]);
|
24
|
+
return (React.createElement(Fade, { in: isShowing },
|
25
|
+
React.createElement("span", null,
|
26
|
+
React.createElement("div", { className: "ob-progress__attachment-wrapper" },
|
27
|
+
React.createElement(Tooltip, { title: typeof progress === 'number'
|
28
|
+
? `Attachment upload progress: ${Math.round(progress)}%`
|
29
|
+
: '', open: tooltipIsOpen },
|
30
|
+
React.createElement("span", { className: "ob-progress__attachment-tooltip-element" })),
|
31
|
+
React.createElement(ProgressBar, { className: "ob-progress__attachment-bar", progress: progress || 0 })))));
|
32
|
+
};
|
33
|
+
export default React.memo(AttachmentProgressBar);
|
34
|
+
//# sourceMappingURL=ProgressBar.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../../src/components/renderer/attachments/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,eAAe,MAAM,gCAAgC,CAAA;AAQ5D,MAAM,qBAAqB,GAAG,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,eAAe,GACT,EAAE,EAAE;IACV,MAAM,CAAC,aAAa,EAAE,WAAW,EAAE,YAAY,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IACzE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,eAAe,IAAI,SAAS,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;YACzC,eAAe,CAAC,YAAY,GAAG,WAAW,CAAA;YAC1C,eAAe,CAAC,YAAY,GAAG,YAAY,CAAA;SAC5C;QACD,IAAI,CAAC,SAAS,EAAE;YACd,YAAY,EAAE,CAAA;SACf;QACD,OAAO,GAAG,EAAE;YACV,IAAI,eAAe,EAAE;gBACnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;gBACzC,eAAe,CAAC,YAAY,GAAG,IAAI,CAAA;gBACnC,eAAe,CAAC,YAAY,GAAG,IAAI,CAAA;aACpC;QACH,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAA;IAC3D,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,SAAS;QACjB;YACE,6BAAK,SAAS,EAAC,iCAAiC;gBAC9C,oBAAC,OAAO,IACN,KAAK,EACH,OAAO,QAAQ,KAAK,QAAQ;wBAC1B,CAAC,CAAC,+BAA+B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG;wBACxD,CAAC,CAAC,EAAE,EAER,IAAI,EAAE,aAAa;oBAEnB,8BAAM,SAAS,EAAC,yCAAyC,GAAG,CACpD;gBACV,oBAAC,WAAW,IACV,SAAS,EAAC,6BAA6B,EACvC,QAAQ,EAAE,QAAQ,IAAI,CAAC,GACvB,CACE,CACD,CACF,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,qBAAqB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Tooltip, Fade } from '@mui/material'\nimport ProgressBar from '../ProgressBar'\nimport useBooleanState from '../../../hooks/useBooleanState'\n\ninterface Props {\n progress: number | undefined\n isShowing: boolean\n tooltipAnchorEl?: HTMLDivElement\n}\n\nconst AttachmentProgressBar = ({\n progress,\n isShowing,\n tooltipAnchorEl,\n}: Props) => {\n const [tooltipIsOpen, openTooltip, closeTooltip] = useBooleanState(false)\n React.useEffect(() => {\n if (tooltipAnchorEl && isShowing) {\n console.log('Applying tooltip events...')\n tooltipAnchorEl.onmouseenter = openTooltip\n tooltipAnchorEl.onmouseleave = closeTooltip\n }\n if (!isShowing) {\n closeTooltip()\n }\n return () => {\n if (tooltipAnchorEl) {\n console.log('Removing tooltip events...')\n tooltipAnchorEl.onmouseenter = null\n tooltipAnchorEl.onmouseleave = null\n }\n }\n }, [closeTooltip, isShowing, openTooltip, tooltipAnchorEl])\n return (\n <Fade in={isShowing}>\n <span>\n <div className=\"ob-progress__attachment-wrapper\">\n <Tooltip\n title={\n typeof progress === 'number'\n ? `Attachment upload progress: ${Math.round(progress)}%`\n : ''\n }\n open={tooltipIsOpen}\n >\n <span className=\"ob-progress__attachment-tooltip-element\" />\n </Tooltip>\n <ProgressBar\n className=\"ob-progress__attachment-bar\"\n progress={progress || 0}\n />\n </div>\n </span>\n </Fade>\n )\n}\n\nexport default React.memo<Props>(AttachmentProgressBar)\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
declare function UploadingAttachment(): JSX.Element;
|
3
|
-
declare const _default: React.MemoExoticComponent<typeof UploadingAttachment>;
|
4
|
-
export default _default;
|
1
|
+
import * as React from 'react';
|
2
|
+
declare function UploadingAttachment(): JSX.Element;
|
3
|
+
declare const _default: React.MemoExoticComponent<typeof UploadingAttachment>;
|
4
|
+
export default _default;
|