@oneblink/apps-react 8.14.0-beta.2 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OneBlinkAutoSaveForm.d.ts +1 -1
- package/dist/OneBlinkAutoSaveForm.js +6 -8
- package/dist/OneBlinkAutoSaveForm.js.map +1 -1
- package/dist/OneBlinkForm.js +3 -2
- package/dist/OneBlinkForm.js.map +1 -1
- package/dist/OneBlinkFormBase.d.ts +1 -1
- package/dist/OneBlinkFormBase.js +49 -146
- package/dist/OneBlinkFormBase.js.map +1 -1
- package/dist/OneBlinkReadOnlyForm.d.ts +1 -1
- package/dist/OneBlinkReadOnlyForm.js +2 -1
- package/dist/OneBlinkReadOnlyForm.js.map +1 -1
- package/dist/PaymentReceipt.d.ts +1 -1
- package/dist/PaymentReceipt.js +9 -30
- package/dist/PaymentReceipt.js.map +1 -1
- package/dist/components/ArcGISWebMap.d.ts +3 -3
- package/dist/components/ArcGISWebMap.js +25 -38
- package/dist/components/ArcGISWebMap.js.map +1 -1
- package/dist/components/Clickable.d.ts +1 -1
- package/dist/components/Clickable.js +2 -1
- package/dist/components/Clickable.js.map +1 -1
- package/dist/components/ConfirmDialog.d.ts +2 -2
- package/dist/components/ConfirmDialog.js +7 -14
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/CopyToClipboardIconButton.d.ts +1 -1
- package/dist/components/CopyToClipboardIconButton.js +10 -14
- package/dist/components/CopyToClipboardIconButton.js.map +1 -1
- package/dist/components/CustomAccordion.d.ts +3 -20
- package/dist/components/ErrorSnackbar.d.ts +1 -1
- package/dist/components/ErrorSnackbar.js +6 -7
- package/dist/components/ErrorSnackbar.js.map +1 -1
- package/dist/components/ImageCropper/CropModal.d.ts +1 -1
- package/dist/components/ImageCropper/CropModal.js +2 -8
- package/dist/components/ImageCropper/CropModal.js.map +1 -1
- package/dist/components/ImageCropper/index.d.ts +1 -1
- package/dist/components/ImageCropper/index.js +3 -5
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/InputClear.js +2 -3
- package/dist/components/InputClear.js.map +1 -1
- package/dist/components/InputField.d.ts +3 -2
- package/dist/components/InputField.js +5 -2
- package/dist/components/InputField.js.map +1 -1
- package/dist/components/Lists.d.ts +1 -6
- package/dist/components/Lists.js +2 -2
- package/dist/components/Lists.js.map +1 -1
- package/dist/components/LoadingWithMessage.js +2 -6
- package/dist/components/LoadingWithMessage.js.map +1 -1
- package/dist/components/MaterialIcon.d.ts +2 -4
- package/dist/components/MaterialIcon.js +4 -4
- package/dist/components/MaterialIcon.js.map +1 -1
- package/dist/components/NotificationGrid.d.ts +2 -2
- package/dist/components/NotificationGrid.js +4 -7
- package/dist/components/NotificationGrid.js.map +1 -1
- package/dist/components/QuillHTML.d.ts +1 -1
- package/dist/components/QuillHTML.js +2 -1
- package/dist/components/QuillHTML.js.map +1 -1
- package/dist/components/SuccessSnackbar.d.ts +1 -1
- package/dist/components/SuccessSnackbar.js +3 -6
- package/dist/components/SuccessSnackbar.js.map +1 -1
- package/dist/components/ValidationErrorsCard.d.ts +2 -2
- package/dist/components/ValidationErrorsCard.js +32 -49
- package/dist/components/ValidationErrorsCard.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js +5 -6
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsContainer.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsContainer.js +9 -11
- package/dist/components/calendar-bookings/CalendarBookingsContainer.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsForm.js +33 -45
- package/dist/components/calendar-bookings/CalendarBookingsForm.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsProvider.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsProvider.js +2 -6
- package/dist/components/calendar-bookings/CalendarBookingsProvider.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js +5 -6
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js.map +1 -1
- package/dist/components/calendar-bookings/ErrorModal.js +7 -11
- package/dist/components/calendar-bookings/ErrorModal.js.map +1 -1
- package/dist/components/downloadable-files/LayoutProvider.d.ts +1 -1
- package/dist/components/downloadable-files/LayoutProvider.js +2 -1
- package/dist/components/downloadable-files/LayoutProvider.js.map +1 -1
- package/dist/components/downloadable-files/index.d.ts +1 -1
- package/dist/components/downloadable-files/index.js +3 -5
- package/dist/components/downloadable-files/index.js.map +1 -1
- package/dist/components/downloadable-files/resource-components.d.ts +3 -3
- package/dist/components/downloadable-files/resource-components.js +9 -32
- package/dist/components/downloadable-files/resource-components.js.map +1 -1
- package/dist/components/formStore/FormStoreTableProvider.d.ts +1 -1
- package/dist/components/formStore/FormStoreTableProvider.js +5 -15
- package/dist/components/formStore/FormStoreTableProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js +3 -2
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js +21 -54
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.d.ts +2 -2
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js +7 -26
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.js +4 -5
- package/dist/components/formStore/OneBlinkFormStoreProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js +3 -2
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.js +128 -94
- package/dist/components/formStore/OneBlinkFormStoreTable.js.map +1 -1
- package/dist/components/formStore/display/ElementDisplay.d.ts +3 -4
- package/dist/components/formStore/display/ElementDisplay.js +9 -12
- package/dist/components/formStore/display/ElementDisplay.js.map +1 -1
- package/dist/components/formStore/display/FormStoreIcon.d.ts +1 -1
- package/dist/components/formStore/display/FormStoreIcon.js +2 -2
- package/dist/components/formStore/display/FormStoreIcon.js.map +1 -1
- package/dist/components/formStore/table/ActionedByTableCell.d.ts +1 -1
- package/dist/components/formStore/table/ActionedByTableCell.js +6 -7
- package/dist/components/formStore/table/ActionedByTableCell.js.map +1 -1
- package/dist/components/formStore/table/ColumnFilters.d.ts +3 -3
- package/dist/components/formStore/table/ColumnFilters.js +84 -100
- package/dist/components/formStore/table/ColumnFilters.js.map +1 -1
- package/dist/components/formStore/table/FormElementTableCell.d.ts +1 -1
- package/dist/components/formStore/table/FormElementTableCell.js +34 -97
- package/dist/components/formStore/table/FormElementTableCell.js.map +1 -1
- package/dist/components/formStore/table/HeaderCellMoreButton.d.ts +4 -4
- package/dist/components/formStore/table/HeaderCellMoreButton.js +26 -32
- package/dist/components/formStore/table/HeaderCellMoreButton.js.map +1 -1
- package/dist/components/formStore/table/Pickers.d.ts +4 -4
- package/dist/components/formStore/table/Pickers.js +14 -13
- package/dist/components/formStore/table/Pickers.js.map +1 -1
- package/dist/components/formStore/table/RepeatableSetCell.js +16 -21
- package/dist/components/formStore/table/RepeatableSetCell.js.map +1 -1
- package/dist/components/formStore/table/RepeatableSetCellAccordion.js +2 -4
- package/dist/components/formStore/table/RepeatableSetCellAccordion.js.map +1 -1
- package/dist/components/formStore/table/TableCellCopyButton.d.ts +1 -1
- package/dist/components/formStore/table/TableCellCopyButton.js +2 -3
- package/dist/components/formStore/table/TableCellCopyButton.js.map +1 -1
- package/dist/components/formStore/table/generateColumns.d.ts +5 -6
- package/dist/components/formStore/table/generateColumns.js +23 -18
- package/dist/components/formStore/table/generateColumns.js.map +1 -1
- package/dist/components/formStore/table/getVersionedState.d.ts +4 -3
- package/dist/components/formStore/table/getVersionedState.js +23 -6
- package/dist/components/formStore/table/getVersionedState.js.map +1 -1
- package/dist/components/formStore/table/useFormStoreTable.d.ts +146 -37
- package/dist/components/formStore/table/useFormStoreTable.js +266 -199
- package/dist/components/formStore/table/useFormStoreTable.js.map +1 -1
- package/dist/components/formStore/useFormStoreTableContext.d.ts +142 -33
- package/dist/components/messages/ErrorMessage.js +3 -3
- package/dist/components/messages/ErrorMessage.js.map +1 -1
- package/dist/components/messages/LargeIconMessage.js +2 -6
- package/dist/components/messages/LargeIconMessage.js.map +1 -1
- package/dist/components/messages/NoResourcesYet.d.ts +1 -1
- package/dist/components/messages/NoResourcesYet.js +2 -1
- package/dist/components/messages/NoResourcesYet.js.map +1 -1
- package/dist/components/mfa/MfaDialog.d.ts +1 -1
- package/dist/components/mfa/MfaDialog.js +9 -48
- package/dist/components/mfa/MfaDialog.js.map +1 -1
- package/dist/components/mfa/MultiFactorAuthentication.d.ts +2 -5
- package/dist/components/mfa/MultiFactorAuthentication.js +14 -45
- package/dist/components/mfa/MultiFactorAuthentication.js.map +1 -1
- package/dist/components/payments/PaymentForm.d.ts +1 -1
- package/dist/components/payments/PaymentForm.js +4 -9
- package/dist/components/payments/PaymentForm.js.map +1 -1
- package/dist/components/payments/WestpacQuickStreamPaymentForm.d.ts +1 -1
- package/dist/components/payments/WestpacQuickStreamPaymentForm.js +11 -45
- package/dist/components/payments/WestpacQuickStreamPaymentForm.js.map +1 -1
- package/dist/components/receipts/Receipt.d.ts +1 -1
- package/dist/components/receipts/Receipt.js +2 -2
- package/dist/components/receipts/Receipt.js.map +1 -1
- package/dist/components/receipts/ReceiptButton.d.ts +1 -1
- package/dist/components/receipts/ReceiptButton.js +3 -2
- package/dist/components/receipts/ReceiptButton.js.map +1 -1
- package/dist/components/receipts/ReceiptList.d.ts +1 -1
- package/dist/components/receipts/ReceiptList.js +2 -9
- package/dist/components/receipts/ReceiptList.js.map +1 -1
- package/dist/components/receipts/ReceiptListItem.d.ts +1 -1
- package/dist/components/receipts/ReceiptListItem.js +2 -11
- package/dist/components/receipts/ReceiptListItem.js.map +1 -1
- package/dist/components/renderer/AnnotationModal.d.ts +1 -1
- package/dist/components/renderer/AnnotationModal.js +6 -14
- package/dist/components/renderer/AnnotationModal.js.map +1 -1
- package/dist/components/renderer/AutocompleteDropdown.d.ts +1 -1
- package/dist/components/renderer/AutocompleteDropdown.js +15 -34
- package/dist/components/renderer/AutocompleteDropdown.js.map +1 -1
- package/dist/components/renderer/CopyToClipboardButton.d.ts +1 -1
- package/dist/components/renderer/CopyToClipboardButton.js +2 -4
- package/dist/components/renderer/CopyToClipboardButton.js.map +1 -1
- package/dist/components/renderer/CustomisableButtonInner.js +2 -4
- package/dist/components/renderer/CustomisableButtonInner.js.map +1 -1
- package/dist/components/renderer/FormElementLabelContainer.d.ts +3 -3
- package/dist/components/renderer/FormElementLabelContainer.js +7 -14
- package/dist/components/renderer/FormElementLabelContainer.js.map +1 -1
- package/dist/components/renderer/FormElementOptions.d.ts +1 -1
- package/dist/components/renderer/FormElementOptions.js +4 -5
- package/dist/components/renderer/FormElementOptions.js.map +1 -1
- package/dist/components/renderer/FormElementValidationMessage.js +3 -5
- package/dist/components/renderer/FormElementValidationMessage.js.map +1 -1
- package/dist/components/renderer/LookupButton.d.ts +1 -1
- package/dist/components/renderer/LookupButton.js +4 -8
- package/dist/components/renderer/LookupButton.js.map +1 -1
- package/dist/components/renderer/LookupNotification.d.ts +1 -1
- package/dist/components/renderer/LookupNotification.js +14 -36
- package/dist/components/renderer/LookupNotification.js.map +1 -1
- package/dist/components/renderer/Modal.d.ts +3 -3
- package/dist/components/renderer/Modal.js +5 -10
- package/dist/components/renderer/Modal.js.map +1 -1
- package/dist/components/renderer/OnLoading.d.ts +1 -1
- package/dist/components/renderer/OnLoading.js +3 -3
- package/dist/components/renderer/OnLoading.js.map +1 -1
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.d.ts +1 -1
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js +2 -4
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js.map +1 -1
- package/dist/components/renderer/OneBlinkFormElements.d.ts +1 -1
- package/dist/components/renderer/OneBlinkFormElements.js +61 -90
- package/dist/components/renderer/OneBlinkFormElements.js.map +1 -1
- package/dist/components/renderer/PageFormElements.d.ts +1 -1
- package/dist/components/renderer/PageFormElements.js +3 -5
- package/dist/components/renderer/PageFormElements.js.map +1 -1
- package/dist/components/renderer/ProgressBar.d.ts +1 -1
- package/dist/components/renderer/ProgressBar.js +2 -1
- package/dist/components/renderer/ProgressBar.js.map +1 -1
- package/dist/components/renderer/ReverseGeocode.d.ts +1 -1
- package/dist/components/renderer/ReverseGeocode.js +2 -1
- package/dist/components/renderer/ReverseGeocode.js.map +1 -1
- package/dist/components/renderer/ToggleAllCheckbox.js +4 -5
- package/dist/components/renderer/ToggleAllCheckbox.js.map +1 -1
- package/dist/components/renderer/Tooltip.d.ts +1 -1
- package/dist/components/renderer/Tooltip.js +3 -1
- package/dist/components/renderer/Tooltip.js.map +1 -1
- package/dist/components/renderer/attachments/AttachmentStatus.d.ts +1 -1
- package/dist/components/renderer/attachments/AttachmentStatus.js +6 -15
- package/dist/components/renderer/attachments/AttachmentStatus.js.map +1 -1
- package/dist/components/renderer/attachments/DropdownMenu.js +30 -42
- package/dist/components/renderer/attachments/DropdownMenu.js.map +1 -1
- package/dist/components/renderer/attachments/FileCard.d.ts +1 -1
- package/dist/components/renderer/attachments/FileCard.js +2 -10
- package/dist/components/renderer/attachments/FileCard.js.map +1 -1
- package/dist/components/renderer/attachments/FileCardContent.d.ts +1 -1
- package/dist/components/renderer/attachments/FileCardContent.js +3 -4
- package/dist/components/renderer/attachments/FileCardContent.js.map +1 -1
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.d.ts +1 -1
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.js +2 -5
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.js.map +1 -1
- package/dist/components/renderer/attachments/ProgressBar.js +2 -4
- package/dist/components/renderer/attachments/ProgressBar.js.map +1 -1
- package/dist/form-elements/ComplianceButton.js +3 -4
- package/dist/form-elements/ComplianceButton.js.map +1 -1
- package/dist/form-elements/FormElementABN.d.ts +1 -1
- package/dist/form-elements/FormElementABN.js +18 -28
- package/dist/form-elements/FormElementABN.js.map +1 -1
- package/dist/form-elements/FormElementAPINSWLiquorLicence.d.ts +2 -2
- package/dist/form-elements/FormElementAPINSWLiquorLicence.js +3 -21
- package/dist/form-elements/FormElementAPINSWLiquorLicence.js.map +1 -1
- package/dist/form-elements/FormElementArcGISWebMap.d.ts +1 -1
- package/dist/form-elements/FormElementArcGISWebMap.js +21 -36
- package/dist/form-elements/FormElementArcGISWebMap.js.map +1 -1
- package/dist/form-elements/FormElementAutocomplete.d.ts +1 -1
- package/dist/form-elements/FormElementAutocomplete.js +5 -9
- package/dist/form-elements/FormElementAutocomplete.js.map +1 -1
- package/dist/form-elements/FormElementBSB.d.ts +1 -1
- package/dist/form-elements/FormElementBSB.js +17 -30
- package/dist/form-elements/FormElementBSB.js.map +1 -1
- package/dist/form-elements/FormElementBarcodeScanner.d.ts +1 -1
- package/dist/form-elements/FormElementBarcodeScanner.js +16 -50
- package/dist/form-elements/FormElementBarcodeScanner.js.map +1 -1
- package/dist/form-elements/FormElementBoolean.d.ts +1 -1
- package/dist/form-elements/FormElementBoolean.js +4 -4
- package/dist/form-elements/FormElementBoolean.js.map +1 -1
- package/dist/form-elements/FormElementCalculation.d.ts +1 -1
- package/dist/form-elements/FormElementCalculation.js +2 -9
- package/dist/form-elements/FormElementCalculation.js.map +1 -1
- package/dist/form-elements/FormElementCamera.d.ts +1 -1
- package/dist/form-elements/FormElementCamera.js +7 -53
- package/dist/form-elements/FormElementCamera.js.map +1 -1
- package/dist/form-elements/FormElementCaptcha.d.ts +1 -1
- package/dist/form-elements/FormElementCaptcha.js +2 -4
- package/dist/form-elements/FormElementCaptcha.js.map +1 -1
- package/dist/form-elements/FormElementCheckBoxes.d.ts +1 -1
- package/dist/form-elements/FormElementCheckBoxes.js +23 -33
- package/dist/form-elements/FormElementCheckBoxes.js.map +1 -1
- package/dist/form-elements/FormElementCivicaNameRecord.d.ts +1 -1
- package/dist/form-elements/FormElementCivicaNameRecord.js +2 -1
- package/dist/form-elements/FormElementCivicaNameRecord.js.map +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.d.ts +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.js +2 -4
- package/dist/form-elements/FormElementCivicaStreetName.js.map +1 -1
- package/dist/form-elements/FormElementCompliance.d.ts +1 -1
- package/dist/form-elements/FormElementCompliance.js +13 -25
- package/dist/form-elements/FormElementCompliance.js.map +1 -1
- package/dist/form-elements/FormElementDate.d.ts +1 -1
- package/dist/form-elements/FormElementDate.js +2 -9
- package/dist/form-elements/FormElementDate.js.map +1 -1
- package/dist/form-elements/FormElementDateTime.d.ts +1 -1
- package/dist/form-elements/FormElementDateTime.js +2 -9
- package/dist/form-elements/FormElementDateTime.js.map +1 -1
- package/dist/form-elements/FormElementEmail.d.ts +1 -1
- package/dist/form-elements/FormElementEmail.js +4 -13
- package/dist/form-elements/FormElementEmail.js.map +1 -1
- package/dist/form-elements/FormElementFile.js +2 -12
- package/dist/form-elements/FormElementFile.js.map +1 -1
- package/dist/form-elements/FormElementFiles.d.ts +1 -1
- package/dist/form-elements/FormElementFiles.js +9 -17
- package/dist/form-elements/FormElementFiles.js.map +1 -1
- package/dist/form-elements/FormElementForm.d.ts +1 -1
- package/dist/form-elements/FormElementForm.js +2 -1
- package/dist/form-elements/FormElementForm.js.map +1 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.d.ts +1 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.js +2 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.js.map +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.js +2 -4
- package/dist/form-elements/FormElementGeoscapeAddress.js.map +1 -1
- package/dist/form-elements/FormElementGoogleAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGoogleAddress.js +2 -7
- package/dist/form-elements/FormElementGoogleAddress.js.map +1 -1
- package/dist/form-elements/FormElementHTML.d.ts +1 -1
- package/dist/form-elements/FormElementHTML.js +2 -3
- package/dist/form-elements/FormElementHTML.js.map +1 -1
- package/dist/form-elements/FormElementHeading.d.ts +1 -1
- package/dist/form-elements/FormElementHeading.js +7 -8
- package/dist/form-elements/FormElementHeading.js.map +1 -1
- package/dist/form-elements/FormElementImage.d.ts +1 -1
- package/dist/form-elements/FormElementImage.js +3 -3
- package/dist/form-elements/FormElementImage.js.map +1 -1
- package/dist/form-elements/FormElementLocation.d.ts +1 -1
- package/dist/form-elements/FormElementLocation.js +16 -47
- package/dist/form-elements/FormElementLocation.js.map +1 -1
- package/dist/form-elements/FormElementLookupButton.d.ts +2 -3
- package/dist/form-elements/FormElementLookupButton.js +4 -7
- package/dist/form-elements/FormElementLookupButton.js.map +1 -1
- package/dist/form-elements/FormElementNumber.d.ts +1 -1
- package/dist/form-elements/FormElementNumber.js +3 -14
- package/dist/form-elements/FormElementNumber.js.map +1 -1
- package/dist/form-elements/FormElementPointAddress.d.ts +2 -2
- package/dist/form-elements/FormElementPointAddress.js +6 -13
- package/dist/form-elements/FormElementPointAddress.js.map +1 -1
- package/dist/form-elements/FormElementPointAddressV3.d.ts +1 -1
- package/dist/form-elements/FormElementPointAddressV3.js +2 -9
- package/dist/form-elements/FormElementPointAddressV3.js.map +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.d.ts +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.js +14 -26
- package/dist/form-elements/FormElementPointCadastralParcel.js.map +1 -1
- package/dist/form-elements/FormElementRadio.d.ts +1 -1
- package/dist/form-elements/FormElementRadio.js +24 -30
- package/dist/form-elements/FormElementRadio.js.map +1 -1
- package/dist/form-elements/FormElementRepeatableSet.d.ts +1 -1
- package/dist/form-elements/FormElementRepeatableSet.js +21 -39
- package/dist/form-elements/FormElementRepeatableSet.js.map +1 -1
- package/dist/form-elements/FormElementSection.d.ts +1 -1
- package/dist/form-elements/FormElementSection.js +16 -34
- package/dist/form-elements/FormElementSection.js.map +1 -1
- package/dist/form-elements/FormElementSelect.d.ts +1 -1
- package/dist/form-elements/FormElementSelect.js +12 -23
- package/dist/form-elements/FormElementSelect.js.map +1 -1
- package/dist/form-elements/FormElementSignature.d.ts +1 -1
- package/dist/form-elements/FormElementSignature.js +21 -46
- package/dist/form-elements/FormElementSignature.js.map +1 -1
- package/dist/form-elements/FormElementSummary.d.ts +1 -1
- package/dist/form-elements/FormElementSummary.js +5 -4
- package/dist/form-elements/FormElementSummary.js.map +1 -1
- package/dist/form-elements/FormElementTelephone.d.ts +1 -1
- package/dist/form-elements/FormElementTelephone.js +4 -13
- package/dist/form-elements/FormElementTelephone.js.map +1 -1
- package/dist/form-elements/FormElementText.d.ts +1 -1
- package/dist/form-elements/FormElementText.js +6 -21
- package/dist/form-elements/FormElementText.js.map +1 -1
- package/dist/form-elements/FormElementTextarea.d.ts +1 -1
- package/dist/form-elements/FormElementTextarea.js +6 -20
- package/dist/form-elements/FormElementTextarea.js.map +1 -1
- package/dist/form-elements/FormElementTime.d.ts +1 -1
- package/dist/form-elements/FormElementTime.js +2 -9
- package/dist/form-elements/FormElementTime.js.map +1 -1
- package/dist/form-elements/OptionButton.js +3 -5
- package/dist/form-elements/OptionButton.js.map +1 -1
- package/dist/hooks/attachments/useAttachmentBlobs.d.ts +1 -1
- package/dist/hooks/attachments/useAttachmentBlobs.js +2 -1
- package/dist/hooks/attachments/useAttachmentBlobs.js.map +1 -1
- package/dist/hooks/form-date-picker/useFormDatePickerProps.d.ts +7 -8
- package/dist/hooks/form-date-picker/useFormDatePickerProps.js +8 -10
- package/dist/hooks/form-date-picker/useFormDatePickerProps.js.map +1 -1
- package/dist/hooks/useAuth.d.ts +1 -1
- package/dist/hooks/useAuth.js +2 -1
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useDrafts.d.ts +1 -1
- package/dist/hooks/useDrafts.js +2 -1
- package/dist/hooks/useDrafts.js.map +1 -1
- package/dist/hooks/useDynamicOptionsLoaderState.d.ts +1 -1
- package/dist/hooks/useDynamicOptionsLoaderState.js +4 -13
- package/dist/hooks/useDynamicOptionsLoaderState.js.map +1 -1
- package/dist/hooks/useFormElementLookups.d.ts +1 -1
- package/dist/hooks/useFormElementLookups.js +2 -1
- package/dist/hooks/useFormElementLookups.js.map +1 -1
- package/dist/hooks/useFormSubmissionModelContext.d.ts +1 -1
- package/dist/hooks/useFormSubmissionModelContext.js +2 -1
- package/dist/hooks/useFormSubmissionModelContext.js.map +1 -1
- package/dist/hooks/useFormSubmissionState.d.ts +1 -1
- package/dist/hooks/useFormSubmissionState.js +1 -1
- package/dist/hooks/useFormSubmissionState.js.map +1 -1
- package/dist/hooks/useIsHovering.d.ts +1 -1
- package/dist/hooks/useIsHovering.js +4 -4
- package/dist/hooks/useIsHovering.js.map +1 -1
- package/dist/hooks/useIsOffline.d.ts +1 -1
- package/dist/hooks/useIsOffline.js +2 -1
- package/dist/hooks/useIsOffline.js.map +1 -1
- package/dist/hooks/useIsPageVisible.d.ts +1 -1
- package/dist/hooks/useIsPageVisible.js +2 -1
- package/dist/hooks/useIsPageVisible.js.map +1 -1
- package/dist/hooks/useMfa.d.ts +1 -1
- package/dist/hooks/useMfa.js +2 -1
- package/dist/hooks/useMfa.js.map +1 -1
- package/dist/hooks/usePages.d.ts +1 -1
- package/dist/hooks/usePendingSubmissions.d.ts +1 -1
- package/dist/hooks/usePendingSubmissions.js +2 -1
- package/dist/hooks/usePendingSubmissions.js.map +1 -1
- package/dist/hooks/useReCAPTCHAProps.d.ts +1 -1
- package/dist/hooks/useReCAPTCHAProps.js.map +1 -1
- package/package.json +21 -25
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Link, Typography } from '@mui/material';
|
|
3
4
|
import { localisationService } from '@oneblink/apps';
|
|
@@ -20,7 +21,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
20
21
|
if (!Array.isArray(unknown)) {
|
|
21
22
|
break;
|
|
22
23
|
}
|
|
23
|
-
return
|
|
24
|
+
return _jsx(RepeatableSetCell, { formElement: formElement, value: unknown });
|
|
24
25
|
}
|
|
25
26
|
case 'location': {
|
|
26
27
|
const value = unknown;
|
|
@@ -28,38 +29,26 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
28
29
|
break;
|
|
29
30
|
}
|
|
30
31
|
const latLong = `${value.latitude},${value.longitude}`;
|
|
31
|
-
return (
|
|
32
|
-
React.createElement("div", null,
|
|
33
|
-
React.createElement(Typography, { variant: "inherit", component: "p" },
|
|
34
|
-
React.createElement(Link, { target: "_blank", rel: "noopener noreferrer", href: `https://maps.google.com/?q=${latLong}` }, "View in Google Maps")),
|
|
35
|
-
React.createElement(Typography, { variant: "inherit", component: "p", color: "textSecondary" },
|
|
36
|
-
"Latitude: ",
|
|
37
|
-
value.latitude),
|
|
38
|
-
React.createElement(Typography, { variant: "inherit", component: "p", color: "textSecondary" },
|
|
39
|
-
"Longitude: ",
|
|
40
|
-
value.longitude)),
|
|
41
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: latLong })));
|
|
32
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx(Typography, { variant: "inherit", component: "p", children: _jsx(Link, { target: "_blank", rel: "noopener noreferrer", href: `https://maps.google.com/?q=${latLong}`, children: "View in Google Maps" }) }), _jsxs(Typography, { variant: "inherit", component: "p", color: "textSecondary", children: ["Latitude: ", value.latitude] }), _jsxs(Typography, { variant: "inherit", component: "p", color: "textSecondary", children: ["Longitude: ", value.longitude] })] }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: latLong })] }));
|
|
42
33
|
}
|
|
43
34
|
case 'camera':
|
|
44
35
|
case 'draw': {
|
|
45
|
-
return (
|
|
36
|
+
return (_jsx(FileChip, { file: unknown }));
|
|
46
37
|
}
|
|
47
38
|
case 'arcGISWebMap': {
|
|
48
39
|
const arcGISWebMapElementValue = unknown;
|
|
49
40
|
if (!((_a = arcGISWebMapElementValue === null || arcGISWebMapElementValue === void 0 ? void 0 : arcGISWebMapElementValue.snapshotImages) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
50
41
|
break;
|
|
51
42
|
}
|
|
52
|
-
return (
|
|
43
|
+
return (_jsx(FilesElementDataTableCellContent, { value: arcGISWebMapElementValue.snapshotImages }));
|
|
53
44
|
}
|
|
54
45
|
case 'textarea': {
|
|
55
46
|
if (typeof unknown !== 'string') {
|
|
56
47
|
break;
|
|
57
48
|
}
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} }, unknown),
|
|
62
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })));
|
|
49
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { style: {
|
|
50
|
+
whiteSpace: 'pre-line',
|
|
51
|
+
}, children: unknown }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })] }));
|
|
63
52
|
}
|
|
64
53
|
case 'date': {
|
|
65
54
|
if (typeof unknown !== 'string') {
|
|
@@ -73,9 +62,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
73
62
|
break;
|
|
74
63
|
}
|
|
75
64
|
const text = localisationService.formatDate(date);
|
|
76
|
-
return (
|
|
77
|
-
text,
|
|
78
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
65
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
79
66
|
}
|
|
80
67
|
case 'time': {
|
|
81
68
|
if (typeof unknown !== 'string') {
|
|
@@ -87,9 +74,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
87
74
|
}
|
|
88
75
|
const { time: timeFormat } = localisationService.getDateFnsFormats();
|
|
89
76
|
const text = format(date, timeFormat);
|
|
90
|
-
return (
|
|
91
|
-
text,
|
|
92
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
77
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
93
78
|
}
|
|
94
79
|
case 'datetime': {
|
|
95
80
|
if (typeof unknown !== 'string') {
|
|
@@ -101,18 +86,14 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
101
86
|
}
|
|
102
87
|
const { shortDateTime: shortDateTimeFormat } = localisationService.getDateFnsFormats();
|
|
103
88
|
const text = format(date, shortDateTimeFormat);
|
|
104
|
-
return (
|
|
105
|
-
text,
|
|
106
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
89
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
107
90
|
}
|
|
108
91
|
case 'number': {
|
|
109
92
|
if (typeof unknown !== 'number') {
|
|
110
93
|
break;
|
|
111
94
|
}
|
|
112
95
|
const text = localisationService.formatNumber(unknown);
|
|
113
|
-
return (
|
|
114
|
-
text,
|
|
115
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
96
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
116
97
|
}
|
|
117
98
|
case 'radio':
|
|
118
99
|
case 'autocomplete':
|
|
@@ -128,35 +109,27 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
128
109
|
const text = unknown
|
|
129
110
|
.map((selection) => getSelectedOptionLabel(formElement, selection))
|
|
130
111
|
.join(', ');
|
|
131
|
-
return (
|
|
132
|
-
React.createElement(MultiSelectFormElementTableCellContent, { value: unknown, formElement: formElement }),
|
|
133
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
112
|
+
return (_jsxs(_Fragment, { children: [_jsx(MultiSelectFormElementTableCellContent, { value: unknown, formElement: formElement }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
134
113
|
}
|
|
135
114
|
else {
|
|
136
115
|
if (typeof unknown !== 'string') {
|
|
137
116
|
break;
|
|
138
117
|
}
|
|
139
118
|
const text = getSelectedOptionLabel(formElement, unknown);
|
|
140
|
-
return (
|
|
141
|
-
text,
|
|
142
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
119
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
143
120
|
}
|
|
144
121
|
}
|
|
145
122
|
case 'email': {
|
|
146
123
|
if (typeof unknown !== 'string') {
|
|
147
124
|
break;
|
|
148
125
|
}
|
|
149
|
-
return (
|
|
150
|
-
React.createElement(Link, { target: "_blank", rel: "noopener noreferrer", href: `mailto:${unknown}` }, unknown),
|
|
151
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })));
|
|
126
|
+
return (_jsxs(_Fragment, { children: [_jsx(Link, { target: "_blank", rel: "noopener noreferrer", href: `mailto:${unknown}`, children: unknown }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })] }));
|
|
152
127
|
}
|
|
153
128
|
case 'telephone': {
|
|
154
129
|
if (typeof unknown !== 'string') {
|
|
155
130
|
break;
|
|
156
131
|
}
|
|
157
|
-
return (
|
|
158
|
-
React.createElement(Link, { target: "_blank", rel: "noopener noreferrer", href: `tel:${unknown}` }, unknown),
|
|
159
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })));
|
|
132
|
+
return (_jsxs(_Fragment, { children: [_jsx(Link, { target: "_blank", rel: "noopener noreferrer", href: `tel:${unknown}`, children: unknown }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })] }));
|
|
160
133
|
}
|
|
161
134
|
case 'text':
|
|
162
135
|
case 'bsb':
|
|
@@ -164,9 +137,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
164
137
|
if (typeof unknown !== 'string') {
|
|
165
138
|
break;
|
|
166
139
|
}
|
|
167
|
-
return (
|
|
168
|
-
unknown,
|
|
169
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })));
|
|
140
|
+
return (_jsxs(_Fragment, { children: [unknown, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: unknown })] }));
|
|
170
141
|
}
|
|
171
142
|
case 'files': {
|
|
172
143
|
const value = unknown;
|
|
@@ -175,7 +146,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
175
146
|
typeof ((_b = value[0]) === null || _b === void 0 ? void 0 : _b.fileName) !== 'string') {
|
|
176
147
|
break;
|
|
177
148
|
}
|
|
178
|
-
return
|
|
149
|
+
return _jsx(FilesElementDataTableCellContent, { value: value });
|
|
179
150
|
}
|
|
180
151
|
case 'calculation': {
|
|
181
152
|
if (typeof unknown !== 'number') {
|
|
@@ -184,18 +155,14 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
184
155
|
const text = formElement.displayAsCurrency
|
|
185
156
|
? localisationService.formatCurrency(unknown)
|
|
186
157
|
: localisationService.formatNumber(unknown);
|
|
187
|
-
return (
|
|
188
|
-
text,
|
|
189
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: unknown.toString() })));
|
|
158
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: unknown.toString() })] }));
|
|
190
159
|
}
|
|
191
160
|
case 'civicaStreetName': {
|
|
192
161
|
const value = unknown;
|
|
193
162
|
if (typeof (value === null || value === void 0 ? void 0 : value.formattedStreet) !== 'string') {
|
|
194
163
|
break;
|
|
195
164
|
}
|
|
196
|
-
return (
|
|
197
|
-
value.formattedStreet,
|
|
198
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: value.formattedStreet })));
|
|
165
|
+
return (_jsxs(_Fragment, { children: [value.formattedStreet, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: value.formattedStreet })] }));
|
|
199
166
|
}
|
|
200
167
|
case 'civicaNameRecord': {
|
|
201
168
|
const value = unknown;
|
|
@@ -205,21 +172,15 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
205
172
|
const text = [value === null || value === void 0 ? void 0 : value.title, value === null || value === void 0 ? void 0 : value.givenName1, value === null || value === void 0 ? void 0 : value.familyName]
|
|
206
173
|
.filter((t) => t)
|
|
207
174
|
.join(' ') || (value === null || value === void 0 ? void 0 : value.emailAddress);
|
|
208
|
-
return (
|
|
209
|
-
text,
|
|
210
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
175
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
211
176
|
}
|
|
212
177
|
case 'geoscapeAddress': {
|
|
213
178
|
const value = unknown;
|
|
214
179
|
if (typeof value.addressId !== 'string') {
|
|
215
180
|
break;
|
|
216
181
|
}
|
|
217
|
-
const fullAddress = ((_c = value === null || value === void 0 ? void 0 : value.addressDetails) === null || _c === void 0 ? void 0 : _c.formattedAddress) || (
|
|
218
|
-
|
|
219
|
-
React.createElement("i", null, value.addressId)));
|
|
220
|
-
return (React.createElement(React.Fragment, null,
|
|
221
|
-
fullAddress,
|
|
222
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })));
|
|
182
|
+
const fullAddress = ((_c = value === null || value === void 0 ? void 0 : value.addressDetails) === null || _c === void 0 ? void 0 : _c.formattedAddress) || (_jsxs(_Fragment, { children: ["Geoscape Address ID: ", _jsx("i", { children: value.addressId })] }));
|
|
183
|
+
return (_jsxs(_Fragment, { children: [fullAddress, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })] }));
|
|
223
184
|
}
|
|
224
185
|
case 'pointCadastralParcel': {
|
|
225
186
|
const value = unknown;
|
|
@@ -227,51 +188,35 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
227
188
|
if (typeof parcelId !== 'string') {
|
|
228
189
|
break;
|
|
229
190
|
}
|
|
230
|
-
return (
|
|
231
|
-
parcelId,
|
|
232
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: parcelId })));
|
|
191
|
+
return (_jsxs(_Fragment, { children: [parcelId, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: parcelId })] }));
|
|
233
192
|
}
|
|
234
193
|
case 'pointAddress': {
|
|
235
194
|
const value = unknown;
|
|
236
195
|
if (typeof value.addressId !== 'string') {
|
|
237
196
|
break;
|
|
238
197
|
}
|
|
239
|
-
const fullAddress = ((_f = value === null || value === void 0 ? void 0 : value.addressDetails) === null || _f === void 0 ? void 0 : _f.formattedAddress) || (
|
|
240
|
-
|
|
241
|
-
React.createElement("i", null, value.addressId)));
|
|
242
|
-
return (React.createElement(React.Fragment, null,
|
|
243
|
-
fullAddress,
|
|
244
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })));
|
|
198
|
+
const fullAddress = ((_f = value === null || value === void 0 ? void 0 : value.addressDetails) === null || _f === void 0 ? void 0 : _f.formattedAddress) || (_jsxs(_Fragment, { children: ["NSW Point Address ID: ", _jsx("i", { children: value.addressId })] }));
|
|
199
|
+
return (_jsxs(_Fragment, { children: [fullAddress, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })] }));
|
|
245
200
|
}
|
|
246
201
|
case 'pointAddressV3': {
|
|
247
202
|
const value = unknown;
|
|
248
203
|
if (typeof ((_g = value.properties) === null || _g === void 0 ? void 0 : _g.addressId) !== 'string') {
|
|
249
204
|
break;
|
|
250
205
|
}
|
|
251
|
-
const fullAddress = ((_h = value === null || value === void 0 ? void 0 : value.properties) === null || _h === void 0 ? void 0 : _h.formattedAddress) || (
|
|
252
|
-
|
|
253
|
-
React.createElement("i", null, (_j = value.properties) === null || _j === void 0 ? void 0 : _j.addressId)));
|
|
254
|
-
return (React.createElement(React.Fragment, null,
|
|
255
|
-
fullAddress,
|
|
256
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })));
|
|
206
|
+
const fullAddress = ((_h = value === null || value === void 0 ? void 0 : value.properties) === null || _h === void 0 ? void 0 : _h.formattedAddress) || (_jsxs(_Fragment, { children: ["NSW Point Address ID: ", _jsx("i", { children: (_j = value.properties) === null || _j === void 0 ? void 0 : _j.addressId })] }));
|
|
207
|
+
return (_jsxs(_Fragment, { children: [fullAddress, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })] }));
|
|
257
208
|
}
|
|
258
209
|
case 'googleAddress': {
|
|
259
210
|
const value = unknown;
|
|
260
|
-
const fullAddress = (value === null || value === void 0 ? void 0 : value.formatted_address) || (
|
|
261
|
-
|
|
262
|
-
React.createElement("i", null, value === null || value === void 0 ? void 0 : value.place_id)));
|
|
263
|
-
return (React.createElement(React.Fragment, null,
|
|
264
|
-
fullAddress,
|
|
265
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })));
|
|
211
|
+
const fullAddress = (value === null || value === void 0 ? void 0 : value.formatted_address) || (_jsxs(_Fragment, { children: ["Google Address: ", _jsx("i", { children: value === null || value === void 0 ? void 0 : value.place_id })] }));
|
|
212
|
+
return (_jsxs(_Fragment, { children: [fullAddress, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: fullAddress })] }));
|
|
266
213
|
}
|
|
267
214
|
case 'boolean': {
|
|
268
215
|
if (typeof unknown !== 'boolean') {
|
|
269
216
|
break;
|
|
270
217
|
}
|
|
271
218
|
const text = unknown ? 'Yes' : 'No';
|
|
272
|
-
return (
|
|
273
|
-
text,
|
|
274
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: text })));
|
|
219
|
+
return (_jsxs(_Fragment, { children: [text, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: text })] }));
|
|
275
220
|
}
|
|
276
221
|
case 'abn': {
|
|
277
222
|
const value = unknown;
|
|
@@ -279,13 +224,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
279
224
|
break;
|
|
280
225
|
}
|
|
281
226
|
const abnNumber = abnService.displayABNNumberFromABNRecord(value);
|
|
282
|
-
return (
|
|
283
|
-
React.createElement(Link, { target: "_blank", rel: "noopener noreferrer", href: `https://www.abr.business.gov.au/ABN/View/${abnNumber}` },
|
|
284
|
-
abnNumber,
|
|
285
|
-
" |",
|
|
286
|
-
' ',
|
|
287
|
-
React.createElement("i", null, abnService.displayBusinessNameFromABNRecord(value))),
|
|
288
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: abnNumber })));
|
|
227
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Link, { target: "_blank", rel: "noopener noreferrer", href: `https://www.abr.business.gov.au/ABN/View/${abnNumber}`, children: [abnNumber, " |", ' ', _jsx("i", { children: abnService.displayBusinessNameFromABNRecord(value) })] }), _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: abnNumber })] }));
|
|
289
228
|
}
|
|
290
229
|
case 'apiNSWLiquorLicence': {
|
|
291
230
|
const value = unknown;
|
|
@@ -293,9 +232,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
293
232
|
if (!licenceNumber) {
|
|
294
233
|
break;
|
|
295
234
|
}
|
|
296
|
-
return (
|
|
297
|
-
licenceNumber,
|
|
298
|
-
React.createElement(TableCellCopyButton, { isHidden: !allowCopy, text: licenceNumber })));
|
|
235
|
+
return (_jsxs(_Fragment, { children: [licenceNumber, _jsx(TableCellCopyButton, { isHidden: !allowCopy, text: licenceNumber })] }));
|
|
299
236
|
}
|
|
300
237
|
case 'lookupButton':
|
|
301
238
|
case 'html':
|
|
@@ -315,7 +252,7 @@ function FormElementTableCell({ formElement, submission, allowCopy }) {
|
|
|
315
252
|
return null;
|
|
316
253
|
}
|
|
317
254
|
}
|
|
318
|
-
return
|
|
255
|
+
return _jsx(_Fragment, { children: JSON.stringify(unknown) });
|
|
319
256
|
}
|
|
320
257
|
export default React.memo(FormElementTableCell);
|
|
321
258
|
//# sourceMappingURL=FormElementTableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormElementTableCell.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/FormElementTableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAWpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,QAAQ,EACR,gCAAgC,EAChC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAQjC,SAAS,oBAAoB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAS;;IACzE,IAAI,WAAW,CAAC,IAAI,KAAK,MAAM,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClE,OAAO,IAAI,CAAA;IACb,CAA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,GAAG,OAA2C,CAAA;YACzD,MAAM,aAAa,GACjB,GAAG,MAAA,KAAK,CAAC,aAAa,0CAAE,aAAa,MAAM,MAAA,KAAK,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;YACtF,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAK;YACP,CAAC;YACD,OAAO,CACL;gBACG,aAAa;gBACd,oBAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,aAAa,GAAI,CACjE,CACJ,CAAA;QACH,CAAC;QAED,KAAK,cAAc,CAAC;QACpB,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,yBAAyB,CAAC;QAC/B,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,KAAK,GAAU,WAAW,CAAA;YAChC,OAAO,CAAC,IAAI,CACV,uDAAuD,EACvD,KAAK,CACN,CAAA;YACD,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,OAAO,0CAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAI,CAAA;AACvC,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Link, Typography } from '@mui/material'\nimport { localisationService } from '@oneblink/apps'\nimport {\n APINSWTypes,\n ArcGISTypes,\n FormTypes,\n GeoscapeTypes,\n GoogleTypes,\n MiscTypes,\n PointTypes,\n SubmissionTypes,\n} from '@oneblink/types'\nimport { abnService } from '@oneblink/sdk-core'\nimport {\n FileChip,\n FilesElementDataTableCellContent,\n MultiSelectFormElementTableCellContent,\n getSelectedOptionLabel,\n} from '../display/ElementDisplay'\nimport RepeatableSetCell from './RepeatableSetCell'\nimport TableCellCopyButton from './TableCellCopyButton'\nimport { format } from 'date-fns'\n\ntype Props = {\n formElement: FormTypes.FormElement\n submission: SubmissionTypes.S3SubmissionData['submission'] | undefined\n allowCopy: boolean\n}\n\nfunction FormElementTableCell({ formElement, submission, allowCopy }: Props) {\n if (formElement.type === 'page' || formElement.type === 'section') {\n return null\n }\n const unknown = submission?.[formElement.name]\n if (unknown === undefined || unknown === null) {\n return null\n }\n\n switch (formElement.type) {\n case 'repeatableSet': {\n if (!Array.isArray(unknown)) {\n break\n }\n return <RepeatableSetCell formElement={formElement} value={unknown} />\n }\n\n case 'location': {\n const value = unknown as {\n latitude: number\n longitude: number\n }\n if (!value.latitude || !value.longitude) {\n break\n }\n\n const latLong = `${value.latitude},${value.longitude}`\n return (\n <>\n <div>\n <Typography variant=\"inherit\" component=\"p\">\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`https://maps.google.com/?q=${latLong}`}\n >\n View in Google Maps\n </Link>\n </Typography>\n <Typography variant=\"inherit\" component=\"p\" color=\"textSecondary\">\n Latitude: {value.latitude}\n </Typography>\n <Typography variant=\"inherit\" component=\"p\" color=\"textSecondary\">\n Longitude: {value.longitude}\n </Typography>\n </div>\n <TableCellCopyButton isHidden={!allowCopy} text={latLong} />\n </>\n )\n }\n\n case 'camera':\n case 'draw': {\n return (\n <FileChip\n file={unknown as React.ComponentProps<typeof FileChip>['file']}\n />\n )\n }\n\n case 'arcGISWebMap': {\n const arcGISWebMapElementValue = unknown as\n | ArcGISTypes.ArcGISWebMapElementValue\n | undefined\n if (!arcGISWebMapElementValue?.snapshotImages?.length) {\n break\n }\n return (\n <FilesElementDataTableCellContent\n value={arcGISWebMapElementValue.snapshotImages}\n />\n )\n }\n\n case 'textarea': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <span\n style={{\n whiteSpace: 'pre-line',\n }}\n >\n {unknown}\n </span>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n\n case 'date': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = localisationService.generateDate({\n daysOffset: undefined,\n value: unknown,\n })\n if (!date) {\n break\n }\n const text = localisationService.formatDate(date)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'time': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = new Date(unknown)\n if (isNaN(date.getTime())) {\n break\n }\n const { time: timeFormat } = localisationService.getDateFnsFormats()\n const text = format(date, timeFormat)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'datetime': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = new Date(unknown)\n if (isNaN(date.getTime())) {\n break\n }\n const { shortDateTime: shortDateTimeFormat } =\n localisationService.getDateFnsFormats()\n const text = format(date, shortDateTimeFormat)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'number': {\n if (typeof unknown !== 'number') {\n break\n }\n const text = localisationService.formatNumber(unknown)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'radio':\n case 'autocomplete':\n case 'checkboxes':\n case 'select': {\n if (\n formElement.type === 'checkboxes' ||\n (formElement.type === 'select' && formElement.multi)\n ) {\n if (\n !Array.isArray(unknown) ||\n !unknown.length ||\n typeof unknown[0] !== 'string'\n ) {\n break\n }\n const text = (unknown as string[])\n .map((selection) => getSelectedOptionLabel(formElement, selection))\n .join(', ')\n return (\n <>\n <MultiSelectFormElementTableCellContent\n value={unknown}\n formElement={formElement}\n />\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n } else {\n if (typeof unknown !== 'string') {\n break\n }\n const text = getSelectedOptionLabel(formElement, unknown)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n }\n\n case 'email': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`mailto:${unknown}`}\n >\n {unknown}\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n case 'telephone': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`tel:${unknown}`}\n >\n {unknown}\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n case 'text':\n case 'bsb':\n case 'barcodeScanner': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n {unknown}\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n\n case 'files': {\n const value = unknown as React.ComponentProps<\n typeof FilesElementDataTableCellContent\n >['value']\n if (\n !Array.isArray(value) ||\n !value.length ||\n typeof value[0]?.fileName !== 'string'\n ) {\n break\n }\n return <FilesElementDataTableCellContent value={value} />\n }\n\n case 'calculation': {\n if (typeof unknown !== 'number') {\n break\n }\n const text = formElement.displayAsCurrency\n ? localisationService.formatCurrency(unknown)\n : localisationService.formatNumber(unknown)\n return (\n <>\n {text}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={unknown.toString()}\n />\n </>\n )\n }\n\n case 'civicaStreetName': {\n const value = unknown as {\n formattedStreet: string\n }\n if (typeof value?.formattedStreet !== 'string') {\n break\n }\n return (\n <>\n {value.formattedStreet}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={value.formattedStreet}\n />\n </>\n )\n }\n\n case 'civicaNameRecord': {\n const value = unknown as {\n title?: string\n givenName1?: string\n familyName?: string\n emailAddress: string\n }\n if (typeof value?.emailAddress !== 'string') {\n break\n }\n const text =\n [value?.title, value?.givenName1, value?.familyName]\n .filter((t) => t)\n .join(' ') || value?.emailAddress\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'geoscapeAddress': {\n const value = unknown as GeoscapeTypes.GeoscapeAddress\n if (typeof value.addressId !== 'string') {\n break\n }\n const fullAddress = value?.addressDetails?.formattedAddress || (\n <>\n Geoscape Address ID: <i>{value.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'pointCadastralParcel': {\n const value = unknown as PointTypes.PointCadastralParcelResponse\n const parcelId = value?.parcelBundle?.[0]?.parcelId\n if (typeof parcelId !== 'string') {\n break\n }\n return (\n <>\n {parcelId}\n <TableCellCopyButton isHidden={!allowCopy} text={parcelId} />\n </>\n )\n }\n\n case 'pointAddress': {\n const value = unknown as PointTypes.PointAddress\n if (typeof value.addressId !== 'string') {\n break\n }\n const fullAddress = value?.addressDetails?.formattedAddress || (\n <>\n NSW Point Address ID: <i>{value.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'pointAddressV3': {\n const value =\n unknown as PointTypes.PointAddressV3GetAddressDetailsResponse\n if (typeof value.properties?.addressId !== 'string') {\n break\n }\n const fullAddress = value?.properties?.formattedAddress || (\n <>\n NSW Point Address ID: <i>{value.properties?.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'googleAddress': {\n const value = unknown as GoogleTypes.GoogleMapsAddress\n const fullAddress = value?.formatted_address || (\n <>\n Google Address: <i>{value?.place_id}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'boolean': {\n if (typeof unknown !== 'boolean') {\n break\n }\n const text = unknown ? 'Yes' : 'No'\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'abn': {\n const value = unknown as MiscTypes.ABNRecord\n if (!value.ABN || !value.entityType) {\n break\n }\n const abnNumber = abnService.displayABNNumberFromABNRecord(value)\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`https://www.abr.business.gov.au/ABN/View/${abnNumber}`}\n >\n {abnNumber} |{' '}\n <i>{abnService.displayBusinessNameFromABNRecord(value)}</i>\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={abnNumber} />\n </>\n )\n }\n case 'apiNSWLiquorLicence': {\n const value = unknown as APINSWTypes.LiquorLicenceDetails\n const licenceNumber =\n `${value.licenceDetail?.licenceNumber} | ${value.licenceDetail?.licenceName}`.trim()\n if (!licenceNumber) {\n break\n }\n return (\n <>\n {licenceNumber}\n <TableCellCopyButton isHidden={!allowCopy} text={licenceNumber} />\n </>\n )\n }\n\n case 'lookupButton':\n case 'html':\n case 'form':\n case 'infoPage':\n case 'captcha':\n case 'image':\n case 'heading':\n case 'summary':\n case 'freshdeskDependentField':\n case 'compliance': {\n return null\n }\n\n default: {\n const never: never = formElement\n console.warn(\n 'Unsupported element type in Submission Data rendering',\n never,\n )\n return null\n }\n }\n\n return <>{JSON.stringify(unknown)}</>\n}\n\nexport default React.memo(FormElementTableCell)\n"]}
|
|
1
|
+
{"version":3,"file":"FormElementTableCell.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/FormElementTableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAWpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,QAAQ,EACR,gCAAgC,EAChC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,iBAA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,sBAAI,UAAU,CAAC,gCAAgC,CAAC,KAAK,CAAC,GAAK,IACtD,EACP,KAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,GAAI,IAC7D,CACJ,CAAA;QACH,CAAC;QACD,KAAK,qBAAqB,CAAC,CAAC,CAAC;YAC3B,MAAM,KAAK,GAAG,OAA2C,CAAA;YACzD,MAAM,aAAa,GACjB,GAAG,MAAA,KAAK,CAAC,aAAa,0CAAE,aAAa,MAAM,MAAA,KAAK,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;YACtF,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAK;YACP,CAAC;YACD,OAAO,CACL,8BACG,aAAa,EACd,KAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,aAAa,GAAI,IACjE,CACJ,CAAA;QACH,CAAC;QAED,KAAK,cAAc,CAAC;QACpB,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,yBAAyB,CAAC;QAC/B,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,KAAK,GAAU,WAAW,CAAA;YAChC,OAAO,CAAC,IAAI,CACV,uDAAuD,EACvD,KAAK,CACN,CAAA;YACD,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,OAAO,4BAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAI,CAAA;AACvC,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Link, Typography } from '@mui/material'\nimport { localisationService } from '@oneblink/apps'\nimport {\n APINSWTypes,\n ArcGISTypes,\n FormTypes,\n GeoscapeTypes,\n GoogleTypes,\n MiscTypes,\n PointTypes,\n SubmissionTypes,\n} from '@oneblink/types'\nimport { abnService } from '@oneblink/sdk-core'\nimport {\n FileChip,\n FilesElementDataTableCellContent,\n MultiSelectFormElementTableCellContent,\n getSelectedOptionLabel,\n} from '../display/ElementDisplay'\nimport RepeatableSetCell from './RepeatableSetCell'\nimport TableCellCopyButton from './TableCellCopyButton'\nimport { format } from 'date-fns'\n\ntype Props = {\n formElement: FormTypes.FormElement\n submission: SubmissionTypes.S3SubmissionData['submission'] | undefined\n allowCopy: boolean\n}\n\nfunction FormElementTableCell({ formElement, submission, allowCopy }: Props) {\n if (formElement.type === 'page' || formElement.type === 'section') {\n return null\n }\n const unknown = submission?.[formElement.name]\n if (unknown === undefined || unknown === null) {\n return null\n }\n\n switch (formElement.type) {\n case 'repeatableSet': {\n if (!Array.isArray(unknown)) {\n break\n }\n return <RepeatableSetCell formElement={formElement} value={unknown} />\n }\n\n case 'location': {\n const value = unknown as {\n latitude: number\n longitude: number\n }\n if (!value.latitude || !value.longitude) {\n break\n }\n\n const latLong = `${value.latitude},${value.longitude}`\n return (\n <>\n <div>\n <Typography variant=\"inherit\" component=\"p\">\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`https://maps.google.com/?q=${latLong}`}\n >\n View in Google Maps\n </Link>\n </Typography>\n <Typography variant=\"inherit\" component=\"p\" color=\"textSecondary\">\n Latitude: {value.latitude}\n </Typography>\n <Typography variant=\"inherit\" component=\"p\" color=\"textSecondary\">\n Longitude: {value.longitude}\n </Typography>\n </div>\n <TableCellCopyButton isHidden={!allowCopy} text={latLong} />\n </>\n )\n }\n\n case 'camera':\n case 'draw': {\n return (\n <FileChip\n file={unknown as React.ComponentProps<typeof FileChip>['file']}\n />\n )\n }\n\n case 'arcGISWebMap': {\n const arcGISWebMapElementValue = unknown as\n | ArcGISTypes.ArcGISWebMapElementValue\n | undefined\n if (!arcGISWebMapElementValue?.snapshotImages?.length) {\n break\n }\n return (\n <FilesElementDataTableCellContent\n value={arcGISWebMapElementValue.snapshotImages}\n />\n )\n }\n\n case 'textarea': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <span\n style={{\n whiteSpace: 'pre-line',\n }}\n >\n {unknown}\n </span>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n\n case 'date': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = localisationService.generateDate({\n daysOffset: undefined,\n value: unknown,\n })\n if (!date) {\n break\n }\n const text = localisationService.formatDate(date)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'time': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = new Date(unknown)\n if (isNaN(date.getTime())) {\n break\n }\n const { time: timeFormat } = localisationService.getDateFnsFormats()\n const text = format(date, timeFormat)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'datetime': {\n if (typeof unknown !== 'string') {\n break\n }\n const date = new Date(unknown)\n if (isNaN(date.getTime())) {\n break\n }\n const { shortDateTime: shortDateTimeFormat } =\n localisationService.getDateFnsFormats()\n const text = format(date, shortDateTimeFormat)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'number': {\n if (typeof unknown !== 'number') {\n break\n }\n const text = localisationService.formatNumber(unknown)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'radio':\n case 'autocomplete':\n case 'checkboxes':\n case 'select': {\n if (\n formElement.type === 'checkboxes' ||\n (formElement.type === 'select' && formElement.multi)\n ) {\n if (\n !Array.isArray(unknown) ||\n !unknown.length ||\n typeof unknown[0] !== 'string'\n ) {\n break\n }\n const text = (unknown as string[])\n .map((selection) => getSelectedOptionLabel(formElement, selection))\n .join(', ')\n return (\n <>\n <MultiSelectFormElementTableCellContent\n value={unknown}\n formElement={formElement}\n />\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n } else {\n if (typeof unknown !== 'string') {\n break\n }\n const text = getSelectedOptionLabel(formElement, unknown)\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n }\n\n case 'email': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`mailto:${unknown}`}\n >\n {unknown}\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n case 'telephone': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`tel:${unknown}`}\n >\n {unknown}\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n case 'text':\n case 'bsb':\n case 'barcodeScanner': {\n if (typeof unknown !== 'string') {\n break\n }\n return (\n <>\n {unknown}\n <TableCellCopyButton isHidden={!allowCopy} text={unknown} />\n </>\n )\n }\n\n case 'files': {\n const value = unknown as React.ComponentProps<\n typeof FilesElementDataTableCellContent\n >['value']\n if (\n !Array.isArray(value) ||\n !value.length ||\n typeof value[0]?.fileName !== 'string'\n ) {\n break\n }\n return <FilesElementDataTableCellContent value={value} />\n }\n\n case 'calculation': {\n if (typeof unknown !== 'number') {\n break\n }\n const text = formElement.displayAsCurrency\n ? localisationService.formatCurrency(unknown)\n : localisationService.formatNumber(unknown)\n return (\n <>\n {text}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={unknown.toString()}\n />\n </>\n )\n }\n\n case 'civicaStreetName': {\n const value = unknown as {\n formattedStreet: string\n }\n if (typeof value?.formattedStreet !== 'string') {\n break\n }\n return (\n <>\n {value.formattedStreet}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={value.formattedStreet}\n />\n </>\n )\n }\n\n case 'civicaNameRecord': {\n const value = unknown as {\n title?: string\n givenName1?: string\n familyName?: string\n emailAddress: string\n }\n if (typeof value?.emailAddress !== 'string') {\n break\n }\n const text =\n [value?.title, value?.givenName1, value?.familyName]\n .filter((t) => t)\n .join(' ') || value?.emailAddress\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'geoscapeAddress': {\n const value = unknown as GeoscapeTypes.GeoscapeAddress\n if (typeof value.addressId !== 'string') {\n break\n }\n const fullAddress = value?.addressDetails?.formattedAddress || (\n <>\n Geoscape Address ID: <i>{value.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'pointCadastralParcel': {\n const value = unknown as PointTypes.PointCadastralParcelResponse\n const parcelId = value?.parcelBundle?.[0]?.parcelId\n if (typeof parcelId !== 'string') {\n break\n }\n return (\n <>\n {parcelId}\n <TableCellCopyButton isHidden={!allowCopy} text={parcelId} />\n </>\n )\n }\n\n case 'pointAddress': {\n const value = unknown as PointTypes.PointAddress\n if (typeof value.addressId !== 'string') {\n break\n }\n const fullAddress = value?.addressDetails?.formattedAddress || (\n <>\n NSW Point Address ID: <i>{value.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'pointAddressV3': {\n const value =\n unknown as PointTypes.PointAddressV3GetAddressDetailsResponse\n if (typeof value.properties?.addressId !== 'string') {\n break\n }\n const fullAddress = value?.properties?.formattedAddress || (\n <>\n NSW Point Address ID: <i>{value.properties?.addressId}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'googleAddress': {\n const value = unknown as GoogleTypes.GoogleMapsAddress\n const fullAddress = value?.formatted_address || (\n <>\n Google Address: <i>{value?.place_id}</i>\n </>\n )\n return (\n <>\n {fullAddress}\n <TableCellCopyButton\n isHidden={!allowCopy}\n text={fullAddress as string}\n />\n </>\n )\n }\n\n case 'boolean': {\n if (typeof unknown !== 'boolean') {\n break\n }\n const text = unknown ? 'Yes' : 'No'\n return (\n <>\n {text}\n <TableCellCopyButton isHidden={!allowCopy} text={text} />\n </>\n )\n }\n\n case 'abn': {\n const value = unknown as MiscTypes.ABNRecord\n if (!value.ABN || !value.entityType) {\n break\n }\n const abnNumber = abnService.displayABNNumberFromABNRecord(value)\n return (\n <>\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={`https://www.abr.business.gov.au/ABN/View/${abnNumber}`}\n >\n {abnNumber} |{' '}\n <i>{abnService.displayBusinessNameFromABNRecord(value)}</i>\n </Link>\n <TableCellCopyButton isHidden={!allowCopy} text={abnNumber} />\n </>\n )\n }\n case 'apiNSWLiquorLicence': {\n const value = unknown as APINSWTypes.LiquorLicenceDetails\n const licenceNumber =\n `${value.licenceDetail?.licenceNumber} | ${value.licenceDetail?.licenceName}`.trim()\n if (!licenceNumber) {\n break\n }\n return (\n <>\n {licenceNumber}\n <TableCellCopyButton isHidden={!allowCopy} text={licenceNumber} />\n </>\n )\n }\n\n case 'lookupButton':\n case 'html':\n case 'form':\n case 'infoPage':\n case 'captcha':\n case 'image':\n case 'heading':\n case 'summary':\n case 'freshdeskDependentField':\n case 'compliance': {\n return null\n }\n\n default: {\n const never: never = formElement\n console.warn(\n 'Unsupported element type in Submission Data rendering',\n never,\n )\n return null\n }\n }\n\n return <>{JSON.stringify(unknown)}</>\n}\n\nexport default React.memo(FormElementTableCell)\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Header } from '@tanstack/react-table';
|
|
3
3
|
import { FormStoreRecord } from '@oneblink/types/typescript/submissions';
|
|
4
|
-
declare function HeaderCellMoreButton({
|
|
5
|
-
|
|
4
|
+
declare function HeaderCellMoreButton({ header, onHide, }: {
|
|
5
|
+
header: Header<FormStoreRecord, unknown>;
|
|
6
6
|
onHide: () => void;
|
|
7
|
-
}):
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const _default: React.MemoExoticComponent<typeof HeaderCellMoreButton>;
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { Box, Button,
|
|
3
|
+
import { Box, Button, Grid, IconButton, Popover, styled, } from '@mui/material';
|
|
3
4
|
import MaterialIcon from '../../MaterialIcon';
|
|
4
5
|
import { useIsHovering } from '../../../hooks/useIsHovering';
|
|
5
6
|
import useNullableState from '../../../hooks/useNullableState';
|
|
@@ -10,39 +11,32 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
|
|
10
11
|
const paperStyles = {
|
|
11
12
|
maxWidth: 500,
|
|
12
13
|
};
|
|
13
|
-
function HeaderCellMoreButton({
|
|
14
|
+
function HeaderCellMoreButton({ header, onHide, }) {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
14
16
|
const isHovering = useIsHovering();
|
|
15
17
|
const [anchorEl, setAnchorEl, clearAnchorEl] = useNullableState(null);
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
React.createElement(ColumnFilters, { filter: headerGroup.filter })),
|
|
39
|
-
React.createElement(Divider, null))),
|
|
40
|
-
React.createElement(Box, { paddingX: 2, paddingY: 1 },
|
|
41
|
-
React.createElement(Grid, { container: true, justifyContent: "flex-end", spacing: 1 },
|
|
42
|
-
headerGroup.filter && (React.createElement(Grid, { item: true },
|
|
43
|
-
React.createElement(Button, { variant: "outlined", disabled: headerGroup.filter.value === undefined, onClick: () => { var _a; return (_a = headerGroup.filter) === null || _a === void 0 ? void 0 : _a.onChange(undefined, false); }, size: "small", startIcon: React.createElement(MaterialIcon, null, "filter_list") }, "Clear"))),
|
|
44
|
-
React.createElement(Grid, { item: true },
|
|
45
|
-
React.createElement(Button, { variant: "outlined", onClick: onHide, size: "small", startIcon: React.createElement(MaterialIcon, null, "visibility_off") }, "Hide")))))));
|
|
18
|
+
return (_jsxs("span", { children: [_jsx(StyledIconButton, { color: "inherit", onClick: (event) => {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
setAnchorEl(event.currentTarget);
|
|
21
|
+
}, children: _jsx(MaterialIcon, { fontSize: "small", color: isHovering ? 'action' : 'disabled', children: "more_vert" }) }), _jsxs(Popover, { open: !!anchorEl, anchorEl: anchorEl, onClose: (event) => {
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
clearAnchorEl();
|
|
24
|
+
}, anchorOrigin: {
|
|
25
|
+
vertical: 'bottom',
|
|
26
|
+
horizontal: 'right',
|
|
27
|
+
}, transformOrigin: {
|
|
28
|
+
vertical: 'top',
|
|
29
|
+
horizontal: 'right',
|
|
30
|
+
}, slotProps: {
|
|
31
|
+
paper: {
|
|
32
|
+
sx: paperStyles,
|
|
33
|
+
},
|
|
34
|
+
}, onClick: (event) => {
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
}, children: [((_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.filter) && (_jsx(Box, { padding: 2, children: _jsx(ColumnFilters, { filter: (_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.filter }) })), _jsx(Box, { paddingX: 2, paddingY: 1, children: _jsxs(Grid, { container: true, justifyContent: "flex-end", spacing: 1, children: [((_c = header.column.columnDef.meta) === null || _c === void 0 ? void 0 : _c.filter) && (_jsx(Grid, { children: _jsx(Button, { variant: "outlined", disabled: ((_d = header.column.columnDef.meta) === null || _d === void 0 ? void 0 : _d.filter.value) === undefined, onClick: () => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
return (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.onChange(undefined, false);
|
|
39
|
+
}, size: "small", startIcon: _jsx(MaterialIcon, { children: "filter_list" }), children: "Clear" }) })), _jsx(Grid, { children: _jsx(Button, { variant: "outlined", onClick: onHide, size: "small", startIcon: _jsx(MaterialIcon, { children: "visibility_off" }), children: "Hide" }) })] }) })] })] }));
|
|
46
40
|
}
|
|
47
41
|
export default React.memo(HeaderCellMoreButton);
|
|
48
42
|
//# sourceMappingURL=HeaderCellMoreButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCellMoreButton.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/HeaderCellMoreButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EACL,GAAG,EACH,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"HeaderCellMoreButton.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/HeaderCellMoreButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,gBAAgB,MAAM,iCAAiC,CAAA;AAC9D,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAG3C,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,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,\n Grid,\n IconButton,\n Popover,\n SxProps,\n styled,\n} from '@mui/material'\nimport MaterialIcon from '../../MaterialIcon'\nimport { useIsHovering } from '../../../hooks/useIsHovering'\nimport useNullableState from '../../../hooks/useNullableState'\nimport ColumnFilters from './ColumnFilters'\nimport { FormStoreRecord } from '@oneblink/types/typescript/submissions'\n\nconst StyledIconButton = styled(IconButton)(({ theme }) => ({\n margin: theme.spacing(-1, -1, -1, 1),\n}))\n\nconst paperStyles: SxProps = {\n maxWidth: 500,\n}\n\nfunction HeaderCellMoreButton({\n header,\n onHide,\n}: {\n header: Header<FormStoreRecord, unknown>\n onHide: () => void\n}) {\n const isHovering = useIsHovering()\n const [anchorEl, setAnchorEl, clearAnchorEl] =\n useNullableState<HTMLButtonElement>(null)\n\n return (\n <span>\n <StyledIconButton\n color=\"inherit\"\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n setAnchorEl(event.currentTarget)\n }}\n >\n <MaterialIcon\n fontSize=\"small\"\n color={isHovering ? 'action' : 'disabled'}\n >\n more_vert\n </MaterialIcon>\n </StyledIconButton>\n <Popover\n open={!!anchorEl}\n anchorEl={anchorEl}\n onClose={(event: React.MouseEvent) => {\n event.stopPropagation()\n clearAnchorEl()\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n slotProps={{\n paper: {\n sx: paperStyles,\n },\n }}\n onClick={(event) => {\n event.stopPropagation()\n }}\n >\n {header.column.columnDef.meta?.filter && (\n <Box padding={2}>\n <ColumnFilters filter={header.column.columnDef.meta?.filter} />\n </Box>\n )}\n\n <Box paddingX={2} paddingY={1}>\n <Grid container justifyContent=\"flex-end\" spacing={1}>\n {header.column.columnDef.meta?.filter && (\n <Grid>\n <Button\n variant=\"outlined\"\n disabled={\n header.column.columnDef.meta?.filter.value === undefined\n }\n onClick={() =>\n header.column.columnDef.meta?.filter?.onChange(\n undefined,\n false,\n )\n }\n size=\"small\"\n startIcon={<MaterialIcon>filter_list</MaterialIcon>}\n >\n Clear\n </Button>\n </Grid>\n )}\n <Grid>\n <Button\n variant=\"outlined\"\n onClick={onHide}\n size=\"small\"\n startIcon={<MaterialIcon>visibility_off</MaterialIcon>}\n >\n Hide\n </Button>\n </Grid>\n </Grid>\n </Box>\n </Popover>\n </span>\n )\n}\n\nexport default React.memo(HeaderCellMoreButton)\n"]}
|
|
@@ -4,13 +4,13 @@ type DatePickersProps = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
value: string | undefined;
|
|
6
6
|
onChange: (newDate: string | undefined) => void;
|
|
7
|
-
renderHelperText: (errorType: DateValidationError) =>
|
|
7
|
+
renderHelperText: (errorType: DateValidationError) => React.ReactNode;
|
|
8
8
|
maxDate?: string;
|
|
9
9
|
minDate?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const FiltersDatePicker: (props: DatePickersProps) =>
|
|
11
|
+
export declare const FiltersDatePicker: (props: DatePickersProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
type DateTimePickersProps = DatePickersProps & {
|
|
13
|
-
renderHelperText: (errorType: DateTimeValidationError) =>
|
|
13
|
+
renderHelperText: (errorType: DateTimeValidationError) => React.ReactNode;
|
|
14
14
|
};
|
|
15
|
-
export declare const FiltersDateTimePicker: (props: DateTimePickersProps) =>
|
|
15
|
+
export declare const FiltersDateTimePicker: (props: DateTimePickersProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export {};
|