@oneblink/apps-react 8.14.0 → 9.0.0-beta.10
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.d.ts +6 -10
- package/dist/OneBlinkForm.js +3 -6
- package/dist/OneBlinkForm.js.map +1 -1
- package/dist/OneBlinkFormBase.d.ts +2 -2
- package/dist/OneBlinkFormBase.js +51 -147
- package/dist/OneBlinkFormBase.js.map +1 -1
- package/dist/OneBlinkReadOnlyForm.d.ts +2 -2
- package/dist/OneBlinkReadOnlyForm.js +3 -2
- package/dist/OneBlinkReadOnlyForm.js.map +1 -1
- package/dist/PaymentReceipt.d.ts +2 -2
- package/dist/PaymentReceipt.js +12 -33
- package/dist/PaymentReceipt.js.map +1 -1
- package/dist/apps/Sentry.d.ts +7 -0
- package/dist/apps/Sentry.js +16 -0
- package/dist/apps/Sentry.js.map +1 -0
- package/dist/apps/approvals-service.d.ts +390 -0
- package/dist/apps/approvals-service.js +987 -0
- package/dist/apps/approvals-service.js.map +1 -0
- package/dist/apps/attachments-service.d.ts +49 -0
- package/dist/apps/attachments-service.js +134 -0
- package/dist/apps/attachments-service.js.map +1 -0
- package/dist/apps/auth-service.d.ts +114 -0
- package/dist/apps/auth-service.js +194 -0
- package/dist/apps/auth-service.js.map +1 -0
- package/dist/apps/auto-save-service.d.ts +82 -0
- package/dist/apps/auto-save-service.js +105 -0
- package/dist/apps/auto-save-service.js.map +1 -0
- package/dist/apps/draft-service.d.ts +148 -0
- package/dist/apps/draft-service.js +583 -0
- package/dist/apps/draft-service.js.map +1 -0
- package/dist/apps/form-service.d.ts +204 -0
- package/dist/apps/form-service.js +718 -0
- package/dist/apps/form-service.js.map +1 -0
- package/dist/apps/form-store-service.d.ts +141 -0
- package/dist/apps/form-store-service.js +114 -0
- package/dist/apps/form-store-service.js.map +1 -0
- package/dist/apps/forms-app-environment-service.d.ts +19 -0
- package/dist/apps/forms-app-environment-service.js +55 -0
- package/dist/apps/forms-app-environment-service.js.map +1 -0
- package/dist/apps/forms-app-service.d.ts +18 -0
- package/dist/apps/forms-app-service.js +53 -0
- package/dist/apps/forms-app-service.js.map +1 -0
- package/dist/apps/index.d.ts +253 -0
- package/dist/apps/index.js +255 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/job-service.d.ts +20 -0
- package/dist/apps/job-service.js +95 -0
- package/dist/apps/job-service.js.map +1 -0
- package/dist/apps/localisation-service.d.ts +207 -0
- package/dist/apps/localisation-service.js +321 -0
- package/dist/apps/localisation-service.js.map +1 -0
- package/dist/apps/notification-service.d.ts +83 -0
- package/dist/apps/notification-service.js +315 -0
- package/dist/apps/notification-service.js.map +1 -0
- package/dist/apps/offline-service.d.ts +18 -0
- package/dist/apps/offline-service.js +25 -0
- package/dist/apps/offline-service.js.map +1 -0
- package/dist/apps/payment-service.d.ts +110 -0
- package/dist/apps/payment-service.js +182 -0
- package/dist/apps/payment-service.js.map +1 -0
- package/dist/apps/prefill-service.d.ts +14 -0
- package/dist/apps/prefill-service.js +19 -0
- package/dist/apps/prefill-service.js.map +1 -0
- package/dist/apps/scheduled-tasks-service.d.ts +127 -0
- package/dist/apps/scheduled-tasks-service.js +240 -0
- package/dist/apps/scheduled-tasks-service.js.map +1 -0
- package/dist/apps/scheduling-service.d.ts +101 -0
- package/dist/apps/scheduling-service.js +171 -0
- package/dist/apps/scheduling-service.js.map +1 -0
- package/dist/apps/services/AWSCognitoClient.d.ts +55 -0
- package/dist/apps/services/AWSCognitoClient.js +436 -0
- package/dist/apps/services/AWSCognitoClient.js.map +1 -0
- package/dist/apps/services/api/drafts.d.ts +7 -0
- package/dist/apps/services/api/drafts.js +236 -0
- package/dist/apps/services/api/drafts.js.map +1 -0
- package/dist/apps/services/api/notifications.d.ts +3 -0
- package/dist/apps/services/api/notifications.js +60 -0
- package/dist/apps/services/api/notifications.js.map +1 -0
- package/dist/apps/services/api/payment.d.ts +23 -0
- package/dist/apps/services/api/payment.js +235 -0
- package/dist/apps/services/api/payment.js.map +1 -0
- package/dist/apps/services/api/post-submission-attachment-urls.d.ts +7 -0
- package/dist/apps/services/api/post-submission-attachment-urls.js +19 -0
- package/dist/apps/services/api/post-submission-attachment-urls.js.map +1 -0
- package/dist/apps/services/api/prefill.d.ts +1 -0
- package/dist/apps/services/api/prefill.js +70 -0
- package/dist/apps/services/api/prefill.js.map +1 -0
- package/dist/apps/services/api/receipt-id.d.ts +2 -0
- package/dist/apps/services/api/receipt-id.js +54 -0
- package/dist/apps/services/api/receipt-id.js.map +1 -0
- package/dist/apps/services/api/scheduling.d.ts +38 -0
- package/dist/apps/services/api/scheduling.js +142 -0
- package/dist/apps/services/api/scheduling.js.map +1 -0
- package/dist/apps/services/api/submissions.d.ts +18 -0
- package/dist/apps/services/api/submissions.js +166 -0
- package/dist/apps/services/api/submissions.js.map +1 -0
- package/dist/apps/services/cognito.d.ts +302 -0
- package/dist/apps/services/cognito.js +441 -0
- package/dist/apps/services/cognito.js.map +1 -0
- package/dist/apps/services/draft-data-store.d.ts +16 -0
- package/dist/apps/services/draft-data-store.js +115 -0
- package/dist/apps/services/draft-data-store.js.map +1 -0
- package/dist/apps/services/errors/oneBlinkAppsError.d.ts +35 -0
- package/dist/apps/services/errors/oneBlinkAppsError.js +32 -0
- package/dist/apps/services/errors/oneBlinkAppsError.js.map +1 -0
- package/dist/apps/services/external-id-generation.d.ts +4 -0
- package/dist/apps/services/external-id-generation.js +59 -0
- package/dist/apps/services/external-id-generation.js.map +1 -0
- package/dist/apps/services/fetch.d.ts +12 -0
- package/dist/apps/services/fetch.js +95 -0
- package/dist/apps/services/fetch.js.map +1 -0
- package/dist/apps/services/forms-key.d.ts +51 -0
- package/dist/apps/services/forms-key.js +83 -0
- package/dist/apps/services/forms-key.js.map +1 -0
- package/dist/apps/services/generate-generic-error.d.ts +3 -0
- package/dist/apps/services/generate-generic-error.js +52 -0
- package/dist/apps/services/generate-generic-error.js.map +1 -0
- package/dist/apps/services/generateOneBlinkDownloader.d.ts +2 -0
- package/dist/apps/services/generateOneBlinkDownloader.js +11 -0
- package/dist/apps/services/generateOneBlinkDownloader.js.map +1 -0
- package/dist/apps/services/generateOneBlinkUploader.d.ts +2 -0
- package/dist/apps/services/generateOneBlinkUploader.js +11 -0
- package/dist/apps/services/generateOneBlinkUploader.js.map +1 -0
- package/dist/apps/services/getDeviceInformation.d.ts +17 -0
- package/dist/apps/services/getDeviceInformation.js +38 -0
- package/dist/apps/services/getDeviceInformation.js.map +1 -0
- package/dist/apps/services/integration-elements.d.ts +383 -0
- package/dist/apps/services/integration-elements.js +761 -0
- package/dist/apps/services/integration-elements.js.map +1 -0
- package/dist/apps/services/job-prefill.d.ts +40 -0
- package/dist/apps/services/job-prefill.js +78 -0
- package/dist/apps/services/job-prefill.js.map +1 -0
- package/dist/apps/services/payment-providers/BPOINTPaymentProvider.d.ts +29 -0
- package/dist/apps/services/payment-providers/BPOINTPaymentProvider.js +59 -0
- package/dist/apps/services/payment-providers/BPOINTPaymentProvider.js.map +1 -0
- package/dist/apps/services/payment-providers/CPPayPaymentProvider.d.ts +27 -0
- package/dist/apps/services/payment-providers/CPPayPaymentProvider.js +63 -0
- package/dist/apps/services/payment-providers/CPPayPaymentProvider.js.map +1 -0
- package/dist/apps/services/payment-providers/NSWGovPayPaymentProvider.d.ts +30 -0
- package/dist/apps/services/payment-providers/NSWGovPayPaymentProvider.js +116 -0
- package/dist/apps/services/payment-providers/NSWGovPayPaymentProvider.js.map +1 -0
- package/dist/apps/services/payment-providers/WestpacQuickStreamPaymentProvider.d.ts +49 -0
- package/dist/apps/services/payment-providers/WestpacQuickStreamPaymentProvider.js +116 -0
- package/dist/apps/services/payment-providers/WestpacQuickStreamPaymentProvider.js.map +1 -0
- package/dist/apps/services/payment-providers/receipt-items.d.ts +8 -0
- package/dist/apps/services/payment-providers/receipt-items.js +58 -0
- package/dist/apps/services/payment-providers/receipt-items.js.map +1 -0
- package/dist/apps/services/pending-queue.d.ts +150 -0
- package/dist/apps/services/pending-queue.js +316 -0
- package/dist/apps/services/pending-queue.js.map +1 -0
- package/dist/apps/services/prepareSubmissionData.d.ts +2 -0
- package/dist/apps/services/prepareSubmissionData.js +113 -0
- package/dist/apps/services/prepareSubmissionData.js.map +1 -0
- package/dist/apps/services/query-string.d.ts +1 -0
- package/dist/apps/services/query-string.js +16 -0
- package/dist/apps/services/query-string.js.map +1 -0
- package/dist/apps/services/replaceInjectablesWithSubmissionValues.d.ts +3 -0
- package/dist/apps/services/replaceInjectablesWithSubmissionValues.js +18 -0
- package/dist/apps/services/replaceInjectablesWithSubmissionValues.js.map +1 -0
- package/dist/apps/services/schedulingHandlers.d.ts +36 -0
- package/dist/apps/services/schedulingHandlers.js +76 -0
- package/dist/apps/services/schedulingHandlers.js.map +1 -0
- package/dist/apps/services/server-validation.d.ts +2 -0
- package/dist/apps/services/server-validation.js +36 -0
- package/dist/apps/services/server-validation.js.map +1 -0
- package/dist/apps/services/serverRequest.d.ts +5 -0
- package/dist/apps/services/serverRequest.js +24 -0
- package/dist/apps/services/serverRequest.js.map +1 -0
- package/dist/apps/services/submit.d.ts +19 -0
- package/dist/apps/services/submit.js +219 -0
- package/dist/apps/services/submit.js.map +1 -0
- package/dist/apps/services/uploadAttachment.d.ts +52 -0
- package/dist/apps/services/uploadAttachment.js +73 -0
- package/dist/apps/services/uploadAttachment.js.map +1 -0
- package/dist/apps/services/user-token.d.ts +27 -0
- package/dist/apps/services/user-token.js +33 -0
- package/dist/apps/services/user-token.js.map +1 -0
- package/dist/apps/services/utils.d.ts +12 -0
- package/dist/apps/services/utils.js +100 -0
- package/dist/apps/services/utils.js.map +1 -0
- package/dist/apps/submission-service.d.ts +226 -0
- package/dist/apps/submission-service.js +425 -0
- package/dist/apps/submission-service.js.map +1 -0
- package/dist/apps/tenants.d.ts +30 -0
- package/dist/apps/tenants.js +155 -0
- package/dist/apps/tenants.js.map +1 -0
- package/dist/apps/types/form.d.ts +4 -0
- package/dist/apps/types/form.js +2 -0
- package/dist/apps/types/form.js.map +1 -0
- package/dist/apps/types/payments.d.ts +45 -0
- package/dist/apps/types/payments.js +2 -0
- package/dist/apps/types/payments.js.map +1 -0
- package/dist/apps/types/scheduling.d.ts +5 -0
- package/dist/apps/types/scheduling.js +2 -0
- package/dist/apps/types/scheduling.js.map +1 -0
- package/dist/apps/types/submissions.d.ts +175 -0
- package/dist/apps/types/submissions.js +2 -0
- package/dist/apps/types/submissions.js.map +1 -0
- package/dist/components/ArcGISWebMap.d.ts +3 -3
- package/dist/components/ArcGISWebMap.js +29 -39
- 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 +8 -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 +2 -19
- 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 -3
- 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 +6 -7
- 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 +2 -2
- package/dist/components/calendar-bookings/CalendarBookingsForm.js +34 -46
- 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 +6 -7
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js.map +1 -1
- package/dist/components/calendar-bookings/ErrorModal.d.ts +1 -1
- package/dist/components/calendar-bookings/ErrorModal.js +8 -12
- 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 +2 -2
- package/dist/components/downloadable-files/index.js +4 -6
- package/dist/components/downloadable-files/index.js.map +1 -1
- package/dist/components/downloadable-files/resource-components.d.ts +4 -4
- package/dist/components/downloadable-files/resource-components.js +10 -33
- 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 +6 -16
- 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 -4
- 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 +8 -27
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.js +5 -6
- package/dist/components/formStore/OneBlinkFormStoreProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js +2 -3
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.js +129 -95
- 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 +11 -14
- 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 +85 -101
- 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 +35 -98
- 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 +15 -14
- package/dist/components/formStore/table/Pickers.js.map +1 -1
- package/dist/components/formStore/table/RepeatableSetCell.js +17 -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 +6 -7
- 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 +268 -199
- package/dist/components/formStore/table/useFormStoreTable.js.map +1 -1
- package/dist/components/formStore/useFormStoreTableContext.d.ts +144 -35
- 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 +2 -2
- package/dist/components/mfa/MfaDialog.js +10 -49
- 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 +5 -10
- package/dist/components/payments/PaymentForm.js.map +1 -1
- package/dist/components/payments/WestpacQuickStreamPaymentForm.d.ts +2 -2
- package/dist/components/payments/WestpacQuickStreamPaymentForm.js +12 -46
- 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 +16 -35
- 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 +16 -38
- package/dist/components/renderer/LookupNotification.js.map +1 -1
- package/dist/components/renderer/Modal.d.ts +3 -3
- package/dist/components/renderer/Modal.js +7 -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 +3 -5
- 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 +3 -2
- 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 +5 -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 +4 -22
- 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 +6 -10
- package/dist/form-elements/FormElementAutocomplete.js.map +1 -1
- package/dist/form-elements/FormElementBSB.d.ts +1 -1
- package/dist/form-elements/FormElementBSB.js +22 -31
- 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 +4 -11
- 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 +3 -2
- package/dist/form-elements/FormElementCivicaNameRecord.js.map +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.d.ts +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.js +3 -5
- package/dist/form-elements/FormElementCivicaStreetName.js.map +1 -1
- package/dist/form-elements/FormElementCompliance.d.ts +2 -2
- 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 +3 -10
- package/dist/form-elements/FormElementDate.js.map +1 -1
- package/dist/form-elements/FormElementDateTime.d.ts +1 -1
- package/dist/form-elements/FormElementDateTime.js +3 -10
- 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.d.ts +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 +2 -2
- 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 +5 -11
- package/dist/form-elements/FormElementFreshdeskDependentField.js.map +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.js +3 -5
- package/dist/form-elements/FormElementGeoscapeAddress.js.map +1 -1
- package/dist/form-elements/FormElementGoogleAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGoogleAddress.js +3 -8
- 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 +21 -48
- package/dist/form-elements/FormElementLocation.js.map +1 -1
- package/dist/form-elements/FormElementLookupButton.d.ts +2 -3
- package/dist/form-elements/FormElementLookupButton.js +5 -8
- package/dist/form-elements/FormElementLookupButton.js.map +1 -1
- package/dist/form-elements/FormElementNumber.d.ts +1 -1
- package/dist/form-elements/FormElementNumber.js +4 -15
- package/dist/form-elements/FormElementNumber.js.map +1 -1
- package/dist/form-elements/FormElementPointAddress.d.ts +2 -2
- package/dist/form-elements/FormElementPointAddress.js +7 -14
- package/dist/form-elements/FormElementPointAddress.js.map +1 -1
- package/dist/form-elements/FormElementPointAddressV3.d.ts +1 -1
- package/dist/form-elements/FormElementPointAddressV3.js +3 -10
- package/dist/form-elements/FormElementPointAddressV3.js.map +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.d.ts +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.js +15 -27
- 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 +9 -6
- 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 +3 -10
- 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/useAttachment.d.ts +1 -1
- package/dist/hooks/attachments/useAttachment.js +1 -1
- package/dist/hooks/attachments/useAttachment.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/attachments/useAttachments.d.ts +1 -1
- package/dist/hooks/attachments/useAttachments.js.map +1 -1
- package/dist/hooks/form-date-picker/useFormDatePickerProps.d.ts +7 -8
- package/dist/hooks/form-date-picker/useFormDatePickerProps.js +10 -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 +3 -2
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useConditionalLogic.js +1 -1
- package/dist/hooks/useConditionalLogic.js.map +1 -1
- package/dist/hooks/useDrafts.d.ts +2 -2
- package/dist/hooks/useDrafts.js +3 -2
- package/dist/hooks/useDrafts.js.map +1 -1
- package/dist/hooks/useDynamicOptionsLoaderState.d.ts +2 -2
- package/dist/hooks/useDynamicOptionsLoaderState.js +5 -14
- package/dist/hooks/useDynamicOptionsLoaderState.js.map +1 -1
- package/dist/hooks/useFormElementLookups.d.ts +2 -2
- package/dist/hooks/useFormElementLookups.js +3 -2
- package/dist/hooks/useFormElementLookups.js.map +1 -1
- package/dist/hooks/useFormSubmissionAutoSaveState.d.ts +1 -1
- package/dist/hooks/useFormSubmissionAutoSaveState.js +1 -1
- package/dist/hooks/useFormSubmissionAutoSaveState.js.map +1 -1
- package/dist/hooks/useFormSubmissionDuration.js +2 -0
- package/dist/hooks/useFormSubmissionDuration.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 +3 -2
- 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/useLoadDataState.js +3 -1
- package/dist/hooks/useLoadDataState.js.map +1 -1
- package/dist/hooks/useLogin.js +1 -1
- package/dist/hooks/useLogin.js.map +1 -1
- package/dist/hooks/useMfa.d.ts +2 -2
- package/dist/hooks/useMfa.js +3 -2
- package/dist/hooks/useMfa.js.map +1 -1
- package/dist/hooks/useOnUploadAttachment.d.ts +1 -1
- package/dist/hooks/useOnUploadAttachment.js +1 -1
- package/dist/hooks/useOnUploadAttachment.js.map +1 -1
- package/dist/hooks/useOneBlinkFormContainer.d.ts +2 -1
- package/dist/hooks/useOneBlinkFormContainer.js +2 -2
- package/dist/hooks/useOneBlinkFormContainer.js.map +1 -1
- package/dist/hooks/usePages.d.ts +1 -1
- package/dist/hooks/usePendingSubmissions.d.ts +2 -2
- package/dist/hooks/usePendingSubmissions.js +3 -2
- 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/dist/hooks/useReplaceableText.js +1 -1
- package/dist/hooks/useReplaceableText.js.map +1 -1
- package/dist/hooks/useSignUp.js +1 -1
- package/dist/hooks/useSignUp.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/attachments.d.ts +1 -1
- package/dist/services/attachments.js +1 -1
- package/dist/services/attachments.js.map +1 -1
- package/dist/services/blob-utils.js +1 -1
- package/dist/services/blob-utils.js.map +1 -1
- package/dist/services/checkIfAttachmentsExist.d.ts +1 -1
- package/dist/services/checkIfAttachmentsExist.js.map +1 -1
- package/dist/services/defaultCoordinates.js +1 -1
- package/dist/services/defaultCoordinates.js.map +1 -1
- package/dist/services/download-file.d.ts +1 -1
- package/dist/services/download-file.js +2 -2
- package/dist/services/download-file.js.map +1 -1
- package/dist/services/drawTimestampOnCanvas.js +1 -1
- package/dist/services/drawTimestampOnCanvas.js.map +1 -1
- package/dist/services/form-validation/validateSubmission.js +1 -1
- package/dist/services/form-validation/validateSubmission.js.map +1 -1
- package/dist/services/form-validation/validators.d.ts +1 -1
- package/dist/services/form-validation/validators.js.map +1 -1
- package/dist/services/generate-default-data.js +1 -1
- package/dist/services/generate-default-data.js.map +1 -1
- package/dist/services/injectableOptions.js +1 -1
- package/dist/services/injectableOptions.js.map +1 -1
- package/dist/styles.css +208 -204
- package/dist/types/attachments.d.ts +1 -1
- package/dist/types/attachments.js.map +1 -1
- package/dist/utils/sendGoogleAnalyticsEvent.js +1 -1
- package/dist/utils/sendGoogleAnalyticsEvent.js.map +1 -1
- package/package.json +58 -51
|
@@ -15,7 +15,7 @@ declare function OneBlinkAutoSaveForm({ form, initialSubmission, resumeAtElement
|
|
|
15
15
|
* later, pass `false`.
|
|
16
16
|
*/
|
|
17
17
|
removeAutoSaveDataBeforeSaveDraft?: boolean;
|
|
18
|
-
}):
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
/**
|
|
20
20
|
* This component is a drop in replacement for {@link OneBlinkForm} with the
|
|
21
21
|
* addition of auto save happening periodically to prevent users from losing
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import OnLoading from './components/renderer/OnLoading';
|
|
3
4
|
import Modal from './components/renderer/Modal';
|
|
@@ -19,17 +20,14 @@ function OneBlinkAutoSaveForm({ form, initialSubmission, resumeAtElement, autoSa
|
|
|
19
20
|
resumePreviousElapsedDurationSeconds,
|
|
20
21
|
});
|
|
21
22
|
if (isLoadingAutoSaveSubmission) {
|
|
22
|
-
return (
|
|
23
|
-
React.createElement(OnLoading, { className: "has-text-centered" })));
|
|
23
|
+
return (_jsx("div", { className: "cypress-loading has-text-centered", children: _jsx(OnLoading, { className: "has-text-centered" }) }));
|
|
24
24
|
}
|
|
25
25
|
if (isAutoSaveSubmissionAvailable) {
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} }, "Start Again"),
|
|
30
|
-
React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-continue-auto-save-continue-button", onClick: continueAutoSaveSubmission, autoFocus: true }, "Continue")) }, "We found an in progress submission, would you like to pick up where you left off or start again?"));
|
|
26
|
+
return (_jsx(Modal, { isOpen: true, title: "Continue?", cardClassName: "cypress-continue-auto-save", actions: _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "button ob-button is-light cypress-continue-auto-save-start-again-button", onClick: () => {
|
|
27
|
+
startNewSubmission();
|
|
28
|
+
}, children: "Start Again" }), _jsx("button", { type: "button", className: "button ob-button is-primary cypress-continue-auto-save-continue-button", onClick: continueAutoSaveSubmission, autoFocus: true, children: "Continue" })] }), children: "We found an in progress submission, would you like to pick up where you left off or start again?" }));
|
|
31
29
|
}
|
|
32
|
-
return (
|
|
30
|
+
return (_jsx(OneBlinkFormBase, { ...props, isReadOnly: false, submission: submission, definition: definition, onCancel: handleCancel, onSubmit: handleSubmit, onSaveDraft: handleSaveDraft, setFormSubmission: setFormSubmission, handleNavigateAway: handleNavigateAway, lastElementUpdated: lastElementUpdated, executedLookups: executedLookups, sectionState: sectionState, getCurrentSubmissionDuration: getCurrentSubmissionDuration }));
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
35
33
|
* This component is a drop in replacement for {@link OneBlinkForm} with the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneBlinkAutoSaveForm.js","sourceRoot":"","sources":["../src/OneBlinkAutoSaveForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,SAAS,MAAM,iCAAiC,CAAA;AACvD,OAAO,KAAK,MAAM,6BAA6B,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,8BAA8B,MAAM,wCAAwC,CAAA;AAGnF,SAAS,oBAAoB,CAAC,EAC5B,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,8BAA8B,EAC9B,iCAAiC,EACjC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,oCAAoC,EACpC,GAAG,KAAK,EAgBT;IACC,MAAM,EACJ,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,4BAA4B,GAC7B,GAAG,8BAA8B,CAAC;QACjC,IAAI;QACJ,iBAAiB;QACjB,eAAe;QACf,WAAW;QACX,8BAA8B;QAC9B,iCAAiC;QACjC,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,cAAc,EAAE,QAAQ;QACxB,kBAAkB;QAClB,oCAAoC;KACrC,CAAC,CAAA;IAEF,IAAI,2BAA2B,EAAE,CAAC;QAChC,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"OneBlinkAutoSaveForm.js","sourceRoot":"","sources":["../src/OneBlinkAutoSaveForm.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,SAAS,MAAM,iCAAiC,CAAA;AACvD,OAAO,KAAK,MAAM,6BAA6B,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,8BAA8B,MAAM,wCAAwC,CAAA;AAGnF,SAAS,oBAAoB,CAAC,EAC5B,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,8BAA8B,EAC9B,iCAAiC,EACjC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,oCAAoC,EACpC,GAAG,KAAK,EAgBT;IACC,MAAM,EACJ,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,4BAA4B,GAC7B,GAAG,8BAA8B,CAAC;QACjC,IAAI;QACJ,iBAAiB;QACjB,eAAe;QACf,WAAW;QACX,8BAA8B;QAC9B,iCAAiC;QACjC,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,cAAc,EAAE,QAAQ;QACxB,kBAAkB;QAClB,oCAAoC;KACrC,CAAC,CAAA;IAEF,IAAI,2BAA2B,EAAE,CAAC;QAChC,OAAO,CACL,cAAK,SAAS,EAAC,mCAAmC,YAChD,KAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,GAAa,GACjD,CACP,CAAA;IACH,CAAC;IAED,IAAI,6BAA6B,EAAE,CAAC;QAClC,OAAO,CACL,KAAC,KAAK,IACJ,MAAM,QACN,KAAK,EAAC,WAAW,EACjB,aAAa,EAAC,4BAA4B,EAC1C,OAAO,EACL,8BACE,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yEAAyE,EACnF,OAAO,EAAE,GAAG,EAAE;4BACZ,kBAAkB,EAAE,CAAA;wBACtB,CAAC,4BAGM,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wEAAwE,EAClF,OAAO,EAAE,0BAA0B,EACnC,SAAS,+BAGF,IACR,iHAKC,CACT,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAC,gBAAgB,OACX,KAAK,EACT,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,eAAe,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,4BAA4B,EAAE,4BAA4B,GAC1D,CACH,CAAA;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,eAAe,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport OnLoading from './components/renderer/OnLoading'\nimport Modal from './components/renderer/Modal'\nimport OneBlinkFormBase from './OneBlinkFormBase'\nimport useFormSubmissionAutoSaveState from './hooks/useFormSubmissionAutoSaveState'\nimport { OneBlinkFormUncontrolled } from './OneBlinkForm'\n\nfunction OneBlinkAutoSaveForm({\n form,\n initialSubmission,\n resumeAtElement,\n autoSaveKey,\n removeAutoSaveDataBeforeSubmit,\n removeAutoSaveDataBeforeSaveDraft,\n disabled,\n onCancel,\n onSubmit,\n onSaveDraft,\n resumeSectionState,\n resumePreviousElapsedDurationSeconds,\n ...props\n}: React.ComponentProps<typeof OneBlinkFormUncontrolled> & {\n /** Pass a unique key for this submission e.g. the `externalId` the parameter */\n autoSaveKey: string\n /**\n * By default, auto save data is removed when the user clicks Submit. If you\n * would like auto save data to persist and clean up the auto save data later,\n * pass `false`.\n */\n removeAutoSaveDataBeforeSubmit?: boolean\n /**\n * By default, auto save data is removed when the user clicks Save Draft. If\n * you would like auto save data to persist and clean up the auto save data\n * later, pass `false`.\n */\n removeAutoSaveDataBeforeSaveDraft?: boolean\n}) {\n const {\n definition,\n submission,\n isLoadingAutoSaveSubmission,\n isAutoSaveSubmissionAvailable,\n startNewSubmission,\n continueAutoSaveSubmission,\n handleSubmit,\n handleCancel,\n handleSaveDraft,\n setFormSubmission,\n handleNavigateAway,\n lastElementUpdated,\n executedLookups,\n sectionState,\n getCurrentSubmissionDuration,\n } = useFormSubmissionAutoSaveState({\n form,\n initialSubmission,\n resumeAtElement,\n autoSaveKey,\n removeAutoSaveDataBeforeSubmit,\n removeAutoSaveDataBeforeSaveDraft,\n onCancel,\n onSubmit,\n onSaveDraft,\n formIsDisabled: disabled,\n resumeSectionState,\n resumePreviousElapsedDurationSeconds,\n })\n\n if (isLoadingAutoSaveSubmission) {\n return (\n <div className=\"cypress-loading has-text-centered\">\n <OnLoading className=\"has-text-centered\"></OnLoading>\n </div>\n )\n }\n\n if (isAutoSaveSubmissionAvailable) {\n return (\n <Modal\n isOpen\n title=\"Continue?\"\n cardClassName=\"cypress-continue-auto-save\"\n actions={\n <>\n <button\n type=\"button\"\n className=\"button ob-button is-light cypress-continue-auto-save-start-again-button\"\n onClick={() => {\n startNewSubmission()\n }}\n >\n Start Again\n </button>\n <button\n type=\"button\"\n className=\"button ob-button is-primary cypress-continue-auto-save-continue-button\"\n onClick={continueAutoSaveSubmission}\n autoFocus\n >\n Continue\n </button>\n </>\n }\n >\n We found an in progress submission, would you like to pick up where you\n left off or start again?\n </Modal>\n )\n }\n return (\n <OneBlinkFormBase\n {...props}\n isReadOnly={false}\n submission={submission}\n definition={definition}\n onCancel={handleCancel}\n onSubmit={handleSubmit}\n onSaveDraft={handleSaveDraft}\n setFormSubmission={setFormSubmission}\n handleNavigateAway={handleNavigateAway}\n lastElementUpdated={lastElementUpdated}\n executedLookups={executedLookups}\n sectionState={sectionState}\n getCurrentSubmissionDuration={getCurrentSubmissionDuration}\n />\n )\n}\n\n/**\n * This component is a drop in replacement for {@link OneBlinkForm} with the\n * addition of auto save happening periodically to prevent users from losing\n * submission data.\n *\n * If you need auto saving with a controlled form, see the\n * {@link OneBlinkFormControlled} component for a full example.\n *\n * @param props\n * @returns\n * @group Components\n */\nexport default React.memo(OneBlinkAutoSaveForm)\n"]}
|
package/dist/OneBlinkForm.d.ts
CHANGED
|
@@ -17,8 +17,6 @@ export { OneBlinkFormBaseProps, OneBlinkFormControlledProps };
|
|
|
17
17
|
* OneBlinkAppsError,
|
|
18
18
|
* draftService,
|
|
19
19
|
* submissionService,
|
|
20
|
-
* } from '@oneblink/apps'
|
|
21
|
-
* import {
|
|
22
20
|
* IsOfflineContextProvider,
|
|
23
21
|
* OneBlinkFormControlled,
|
|
24
22
|
* useIsMounted,
|
|
@@ -330,7 +328,7 @@ export { OneBlinkFormBaseProps, OneBlinkFormControlledProps };
|
|
|
330
328
|
*/
|
|
331
329
|
declare const OneBlinkFormControlled: React.NamedExoticComponent<import("./OneBlinkFormBase").OneBlinkReadOnlyFormProps & {
|
|
332
330
|
onCancel: () => unknown;
|
|
333
|
-
onSubmit: (newFormSubmission: import("
|
|
331
|
+
onSubmit: (newFormSubmission: import("./apps/submission-service").NewFormSubmission) => unknown;
|
|
334
332
|
disabled?: boolean;
|
|
335
333
|
isPreview?: boolean;
|
|
336
334
|
abnLookupAuthenticationGuid?: string;
|
|
@@ -339,10 +337,10 @@ declare const OneBlinkFormControlled: React.NamedExoticComponent<import("./OneBl
|
|
|
339
337
|
validationIcon?: import("@oneblink/types/typescript/environments").FormsAppEnvironmentStyles["validationIcon"];
|
|
340
338
|
attachmentRetentionInDays?: number;
|
|
341
339
|
isPendingQueueEnabled: boolean;
|
|
342
|
-
onSaveDraft?: (newDraftSubmission: import("
|
|
340
|
+
onSaveDraft?: (newDraftSubmission: import("./apps/submission-service").NewDraftSubmission) => unknown;
|
|
343
341
|
handleNavigateAway?: () => unknown;
|
|
344
342
|
isInfoPage?: "YES" | "NO" | "CALCULATED";
|
|
345
|
-
onUploadAttachment?: typeof import("
|
|
343
|
+
onUploadAttachment?: typeof import("./apps/attachments-service").uploadAttachment;
|
|
346
344
|
captchaType?: import("./types/form").CaptchaType;
|
|
347
345
|
shouldUseNavigableValidationErrorsNotification?: boolean;
|
|
348
346
|
navigableValidationErrorsNotificationSettings?: {
|
|
@@ -380,8 +378,6 @@ declare const OneBlinkFormControlled: React.NamedExoticComponent<import("./OneBl
|
|
|
380
378
|
* OneBlinkAppsError,
|
|
381
379
|
* draftService,
|
|
382
380
|
* submissionService,
|
|
383
|
-
* } from '@oneblink/apps'
|
|
384
|
-
* import {
|
|
385
381
|
* IsOfflineContextProvider,
|
|
386
382
|
* OneBlinkForm,
|
|
387
383
|
* useIsMounted,
|
|
@@ -581,7 +577,7 @@ declare const OneBlinkFormControlled: React.NamedExoticComponent<import("./OneBl
|
|
|
581
577
|
*/
|
|
582
578
|
declare const OneBlinkFormUncontrolled: React.NamedExoticComponent<import("./OneBlinkFormBase").OneBlinkReadOnlyFormProps & {
|
|
583
579
|
onCancel: () => unknown;
|
|
584
|
-
onSubmit: (newFormSubmission: import("
|
|
580
|
+
onSubmit: (newFormSubmission: import("./apps/submission-service").NewFormSubmission) => unknown;
|
|
585
581
|
disabled?: boolean;
|
|
586
582
|
isPreview?: boolean;
|
|
587
583
|
abnLookupAuthenticationGuid?: string;
|
|
@@ -590,10 +586,10 @@ declare const OneBlinkFormUncontrolled: React.NamedExoticComponent<import("./One
|
|
|
590
586
|
validationIcon?: import("@oneblink/types/typescript/environments").FormsAppEnvironmentStyles["validationIcon"];
|
|
591
587
|
attachmentRetentionInDays?: number;
|
|
592
588
|
isPendingQueueEnabled: boolean;
|
|
593
|
-
onSaveDraft?: (newDraftSubmission: import("
|
|
589
|
+
onSaveDraft?: (newDraftSubmission: import("./apps/submission-service").NewDraftSubmission) => unknown;
|
|
594
590
|
handleNavigateAway?: () => unknown;
|
|
595
591
|
isInfoPage?: "YES" | "NO" | "CALCULATED";
|
|
596
|
-
onUploadAttachment?: typeof import("
|
|
592
|
+
onUploadAttachment?: typeof import("./apps/attachments-service").uploadAttachment;
|
|
597
593
|
captchaType?: import("./types/form").CaptchaType;
|
|
598
594
|
shouldUseNavigableValidationErrorsNotification?: boolean;
|
|
599
595
|
navigableValidationErrorsNotificationSettings?: {
|
package/dist/OneBlinkForm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import OneBlinkFormBase from './OneBlinkFormBase';
|
|
3
4
|
import useFormSubmissionState from './hooks/useFormSubmissionState';
|
|
@@ -16,8 +17,6 @@ import useFormSubmissionDuration from './hooks/useFormSubmissionDuration';
|
|
|
16
17
|
* OneBlinkAppsError,
|
|
17
18
|
* draftService,
|
|
18
19
|
* submissionService,
|
|
19
|
-
* } from '@oneblink/apps'
|
|
20
|
-
* import {
|
|
21
20
|
* IsOfflineContextProvider,
|
|
22
21
|
* OneBlinkFormControlled,
|
|
23
22
|
* useIsMounted,
|
|
@@ -328,7 +327,7 @@ import useFormSubmissionDuration from './hooks/useFormSubmissionDuration';
|
|
|
328
327
|
* @group Components
|
|
329
328
|
*/
|
|
330
329
|
const OneBlinkFormControlled = React.memo(function OneBlinkFormControlled(props) {
|
|
331
|
-
return
|
|
330
|
+
return _jsx(OneBlinkFormBase, { ...props, isReadOnly: false });
|
|
332
331
|
});
|
|
333
332
|
/**
|
|
334
333
|
* Component for rendering a OneBlink Form. This component will render the
|
|
@@ -352,8 +351,6 @@ const OneBlinkFormControlled = React.memo(function OneBlinkFormControlled(props)
|
|
|
352
351
|
* OneBlinkAppsError,
|
|
353
352
|
* draftService,
|
|
354
353
|
* submissionService,
|
|
355
|
-
* } from '@oneblink/apps'
|
|
356
|
-
* import {
|
|
357
354
|
* IsOfflineContextProvider,
|
|
358
355
|
* OneBlinkForm,
|
|
359
356
|
* useIsMounted,
|
|
@@ -554,7 +551,7 @@ const OneBlinkFormControlled = React.memo(function OneBlinkFormControlled(props)
|
|
|
554
551
|
const OneBlinkFormUncontrolled = React.memo(function OneBlinkFormUncontrolled({ form, initialSubmission, resumeAtElement, resumeSectionState, resumePreviousElapsedDurationSeconds, ...props }) {
|
|
555
552
|
const [getCurrentSubmissionDuration] = useFormSubmissionDuration(resumePreviousElapsedDurationSeconds);
|
|
556
553
|
const [{ definition, submission, lastElementUpdated, executedLookups, sectionState, }, setFormSubmission,] = useFormSubmissionState(form, initialSubmission, resumeAtElement, resumeSectionState);
|
|
557
|
-
return (
|
|
554
|
+
return (_jsx(OneBlinkFormBase, { ...props, isReadOnly: false, definition: definition, submission: submission, setFormSubmission: setFormSubmission, lastElementUpdated: lastElementUpdated, executedLookups: executedLookups, sectionState: sectionState, getCurrentSubmissionDuration: getCurrentSubmissionDuration }));
|
|
558
555
|
});
|
|
559
556
|
export { OneBlinkFormControlled, OneBlinkFormUncontrolled };
|
|
560
557
|
//# sourceMappingURL=OneBlinkForm.js.map
|
package/dist/OneBlinkForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneBlinkForm.js","sourceRoot":"","sources":["../src/OneBlinkForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,gBAIN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,sBAAsB,MAAM,gCAAgC,CAAA;AACnE,OAAO,yBAAyB,MAAM,mCAAmC,CAAA;AAKzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoUG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,sBAAsB,CACvE,KAA0D;IAE1D,OAAO,oBAAC,gBAAgB,OAAK,KAAK,EAAE,UAAU,EAAE,KAAK,GAAI,CAAA;AAC3D,CAAC,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4NG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,wBAAwB,CAAC,EAC5E,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oCAAoC,EACpC,GAAG,KAAK,EAOP;IACD,MAAM,CAAC,4BAA4B,CAAC,GAAG,yBAAyB,CAC9D,oCAAoC,CACrC,CAAA;IACD,MAAM,CACJ,EACE,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,YAAY,GACb,EACD,iBAAiB,EAClB,GAAG,sBAAsB,CACxB,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,CACnB,CAAA;IACD,OAAO,CACL,oBAAC,gBAAgB,OACX,KAAK,EACT,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,4BAA4B,EAAE,4BAA4B,GAC1D,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAA","sourcesContent":["import * as React from 'react'\nimport { FormTypes } from '@oneblink/types'\nimport OneBlinkFormBase, {\n OneBlinkFormBaseProps,\n OneBlinkFormControlledProps,\n OneBlinkFormUncontrolledProps,\n} from './OneBlinkFormBase'\nimport useFormSubmissionState from './hooks/useFormSubmissionState'\nimport useFormSubmissionDuration from './hooks/useFormSubmissionDuration'\nimport { SectionState } from './types/form'\n\nexport { OneBlinkFormBaseProps, OneBlinkFormControlledProps }\n\n/**\n * Similar to {@link OneBlinkForm}, however requires props to control the\n * `definition` and `submission` values.\n *\n * #### Example\n *\n * ```tsx\n * import React from 'react'\n * import ReactDOM from 'react-dom'\n * import { FormTypes } from '@oneblink/types'\n * import {\n * OneBlinkAppsError,\n * draftService,\n * submissionService,\n * } from '@oneblink/apps'\n * import {\n * IsOfflineContextProvider,\n * OneBlinkFormControlled,\n * useIsMounted,\n * useFormSubmissionState,\n * } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n *\n * const captchaSiteKey = 'ENTER_YOUR_SITE_KEY_HERE'\n * const googleMapsApiKey = 'ENTER_YOUR_MAPS_API_KEY_HERE'\n * const formsAppId = 1\n * const form: FormTypes.Form = {\n * id: 1,\n * name: 'Name of Form',\n * description: '',\n * organisationId: 'abc123',\n * formsAppEnvironmentId: 1,\n * formsAppIds: [],\n * elements: [],\n * isAuthenticated: false,\n * isMultiPage: false,\n * isInfoPage: false,\n * publishStartDate: null,\n * publishEndDate: null,\n * postSubmissionAction: 'FORMS_LIBRARY',\n * submissionEvents: [],\n * tags: [],\n * }\n * const initialSubmission: Record<string, unknown> = {\n * data: 1,\n * }\n *\n * function FormContainer() {\n * const isMounted = useIsMounted()\n *\n * const [{ definition, submission }, setFormSubmission] =\n * useFormSubmissionState(form, initialSubmission)\n *\n * const [{ isSavingDraft, saveDraftError }, setSaveDraftState] =\n * React.useState({\n * isSavingDraft: false,\n * saveDraftError: null,\n * })\n *\n * const [\n * { isSubmitting, submitError, formSubmissionResult },\n * setSubmitState,\n * ] = React.useState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: null,\n * })\n *\n * const handleSubmit = React.useCallback(\n * async (newFormSubmission: FormTypes.NewFormSubmission) => {\n * const formSubmission: FormSubmission = Object.assign(\n * {},\n * newFormSubmission,\n * {\n * formsAppId,\n * jobId: null,\n * externalId: null,\n * draftId: null,\n * preFillFormDataId: null,\n * },\n * )\n *\n * setSubmitState({\n * formSubmissionResult: null,\n * submitError: null,\n * isSubmitting: true,\n * })\n *\n * try {\n * const newFormSubmissionResult = await submissionService.submit({\n * formSubmission,\n * })\n * if (\n * newFormSubmissionResult.isOffline &&\n * !newFormSubmissionResult.isInPendingQueue\n * ) {\n * throw new OneBlinkAppsError(\n * 'You cannot submit this form while offline, please try again when connectivity is restored.',\n * {\n * isOffline: true,\n * },\n * )\n * }\n *\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: newFormSubmissionResult,\n * isSubmitting: false,\n * submitError: null,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: error,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleSaveDraft = React.useCallback(\n * async (newDraftSubmission: FormTypes.NewDraftSubmission) => {\n * const draftSubmission: FormTypes.DraftSubmission = {\n * ...newDraftSubmission,\n * formsAppId,\n * }\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: true,\n * })\n *\n * try {\n * await draftService.addDraft(\n * {\n * title: form.name,\n * formId: form.id,\n * externalId: null,\n * jobId: null,\n * },\n * draftSubmission,\n * )\n *\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: false,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: error,\n * isSavingDraft: false,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleCancel = React.useCallback(() => {\n * // handle cancel here...\n * }, [])\n *\n * if (isSubmitting) {\n * // Render submitting animation/loading\n * }\n *\n * if (submitError) {\n * // Render error while submitting\n * }\n *\n * if (isSavingDraft) {\n * // Render saving draft animation/loading\n * }\n *\n * if (saveDraftError) {\n * // Render error while saving draft\n * }\n *\n * if (formSubmissionResult) {\n * // Render submission success\n * }\n *\n * return (\n * <OneBlinkFormControlled\n * captchaSiteKey={captchaSiteKey}\n * googleMapsApiKey={googleMapsApiKey}\n * formsAppId={formsAppId}\n * definition={definition}\n * submission={submission}\n * setFormSubmission={setFormSubmission}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * />\n * )\n * }\n *\n * function App() {\n * return (\n * <IsOfflineContextProvider>\n * <FormContainer />\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * #### Implementing Controlled Auto Save\n *\n * The {@link OneBlinkAutoSaveForm} component does not offer props to allow for a\n * controlled form (i.e. having access to `submission` and `definition` values).\n * To implement a controlled version of the `<OneBlinkAutoSaveForm />`\n * component, use the example component below.\n *\n * ```tsx\n * import * as React from 'react'\n * import {\n * OneBlinkAutoSaveForm,\n * OneBlinkFormControlled,\n * useFormSubmissionAutoSaveState,\n * } from '@oneblink/apps-react'\n *\n * function OneBlinkAutoSaveFormControlled({\n * form,\n * initialSubmission,\n * autoSaveKey,\n * onCancel,\n * onSubmit,\n * onSaveDraft,\n * ...props\n * }: React.ComponentProps<typeof OneBlinkAutoSaveForm>) {\n * const {\n * definition,\n * submission,\n * isLoadingAutoSaveSubmission,\n * isAutoSaveSubmissionAvailable,\n * startNewSubmission,\n * continueAutoSaveSubmission,\n * handleSubmit,\n * handleCancel,\n * handleSaveDraft,\n * setFormSubmission,\n * } = useFormSubmissionAutoSaveState({\n * form,\n * initialSubmission,\n * autoSaveKey,\n * onCancel,\n * onSubmit,\n * onSaveDraft,\n * })\n *\n * // This is just an example of how you could intercept\n * // the change event when a user enters/selects a value\n * // on the form.\n * const customSetFormSubmission = React.useCallback(\n * (formSubmission) => {\n * setFormSubmission((currentFormSubmission) => {\n * const newFormSubmission =\n * typeof formSubmission === 'function'\n * ? formSubmission(currentFormSubmission)\n * : formSubmission\n *\n * // This is where you can access the updated\n * // submission data or form definition.\n * // You could even change the form definition\n * // programmatically based on user inputs.\n * console.log(\n * 'A change has occurred to the submission',\n * newFormSubmission.submission,\n * )\n * newFormSubmission.definition.isInfoPage =\n * !newFormSubmission.submission.doesTheUserNeedToSubmit\n *\n * return newFormSubmission\n * })\n * },\n * [setFormSubmission],\n * )\n *\n * if (isLoadingAutoSaveSubmission) {\n * return <p>Checking for auto save data...</p>\n * }\n *\n * if (isAutoSaveSubmissionAvailable) {\n * return (\n * <>\n * <p>Do you want to use the auto save data?</p>\n * <button onClick={startNewSubmission}>No, start again</button>\n * <button onClick={continueAutoSaveSubmission}>\n * Yes, continue\n * </button>\n * </>\n * )\n * }\n *\n * return (\n * <OneBlinkFormControlled\n * {...props}\n * submission={submission}\n * definition={definition}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * setFormSubmission={customSetFormSubmission}\n * />\n * )\n * }\n *\n * export default React.memo(OneBlinkAutoSaveFormControlled)\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nconst OneBlinkFormControlled = React.memo(function OneBlinkFormControlled(\n props: OneBlinkFormBaseProps & OneBlinkFormControlledProps,\n) {\n return <OneBlinkFormBase {...props} isReadOnly={false} />\n})\n\n/**\n * Component for rendering a OneBlink Form. This component will render the\n * submit, cancel and save draft buttons but it is up to the developer to\n * implement what happens when those buttons are clicked.\n *\n * It is also recommended to import the `css` from this library as well.\n *\n * ```js\n * import { OneBlinkForm } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n * ```\n *\n * #### Example\n *\n * ```tsx\n * import React from 'react'\n * import ReactDOM from 'react-dom'\n * import { FormTypes } from '@oneblink/types'\n * import {\n * OneBlinkAppsError,\n * draftService,\n * submissionService,\n * } from '@oneblink/apps'\n * import {\n * IsOfflineContextProvider,\n * OneBlinkForm,\n * useIsMounted,\n * } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n *\n * const captchaSiteKey = 'ENTER_YOUR_SITE_KEY_HERE'\n * const googleMapsApiKey = 'ENTER_YOUR_MAPS_API_KEY_HERE'\n * const formsAppId = 1\n * const form: FormTypes.Form = {\n * id: 1,\n * name: 'Name of Form',\n * description: '',\n * organisationId: 'abc123',\n * formsAppEnvironmentId: 1,\n * formsAppIds: [],\n * elements: [],\n * isAuthenticated: false,\n * isMultiPage: false,\n * isInfoPage: false,\n * publishStartDate: null,\n * publishEndDate: null,\n * postSubmissionAction: 'FORMS_LIBRARY',\n * submissionEvents: [],\n * tags: [],\n * }\n *\n * function FormContainer() {\n * const isMounted = useIsMounted()\n *\n * const [{ isSavingDraft, saveDraftError }, setSaveDraftState] =\n * React.useState({\n * isSavingDraft: false,\n * saveDraftError: null,\n * })\n *\n * const [\n * { isSubmitting, submitError, formSubmissionResult },\n * setSubmitState,\n * ] = React.useState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: null,\n * })\n *\n * const handleSubmit = React.useCallback(\n * async (newFormSubmission: FormTypes.NewFormSubmission) => {\n * const formSubmission: FormSubmission = Object.assign(\n * {},\n * newFormSubmission,\n * {\n * formsAppId,\n * jobId: null,\n * externalId: null,\n * draftId: null,\n * preFillFormDataId: null,\n * },\n * )\n *\n * setSubmitState({\n * formSubmissionResult: null,\n * submitError: null,\n * isSubmitting: true,\n * })\n *\n * try {\n * const newFormSubmissionResult = await submissionService.submit({\n * formSubmission,\n * })\n * if (\n * newFormSubmissionResult.isOffline &&\n * !newFormSubmissionResult.isInPendingQueue\n * ) {\n * throw new OneBlinkAppsError(\n * 'You cannot submit this form while offline, please try again when connectivity is restored.',\n * {\n * isOffline: true,\n * },\n * )\n * }\n *\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: newFormSubmissionResult,\n * isSubmitting: false,\n * submitError: null,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: error,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleSaveDraft = React.useCallback(\n * async (newDraftSubmission: FormTypes.NewDraftSubmission) => {\n * const draftSubmission: FormTypes.DraftSubmission = {\n * ...newDraftSubmission,\n * formsAppId,\n * }\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: true,\n * })\n *\n * try {\n * await draftService.addDraft(\n * {\n * title: form.name,\n * formId: form.id,\n * externalId: null,\n * jobId: null,\n * },\n * draftSubmission,\n * )\n *\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: false,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: error,\n * isSavingDraft: false,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleCancel = React.useCallback(() => {\n * // handle cancel here...\n * }, [isMounted])\n *\n * if (isSubmitting) {\n * // Render submitting animation/loading\n * }\n *\n * if (submitError) {\n * // Render error while submitting\n * }\n *\n * if (isSavingDraft) {\n * // Render saving draft animation/loading\n * }\n *\n * if (saveDraftError) {\n * // Render error while saving draft\n * }\n *\n * if (formSubmissionResult) {\n * // Render submission success\n * }\n *\n * return (\n * <OneBlinkForm\n * captchaSiteKey={captchaSiteKey}\n * googleMapsApiKey={googleMapsApiKey}\n * formsAppId={formsAppId}\n * form={form}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * attachmentRetentionInDays={1}\n * />\n * )\n * }\n *\n * function App() {\n * return (\n * <IsOfflineContextProvider>\n * <FormContainer />\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nconst OneBlinkFormUncontrolled = React.memo(function OneBlinkFormUncontrolled({\n form,\n initialSubmission,\n resumeAtElement,\n resumeSectionState,\n resumePreviousElapsedDurationSeconds,\n ...props\n}: OneBlinkFormBaseProps &\n OneBlinkFormUncontrolledProps & {\n /** The element to resume the form at. */\n resumeAtElement?: FormTypes.FormElement\n resumeSectionState?: SectionState\n resumePreviousElapsedDurationSeconds?: number\n }) {\n const [getCurrentSubmissionDuration] = useFormSubmissionDuration(\n resumePreviousElapsedDurationSeconds,\n )\n const [\n {\n definition,\n submission,\n lastElementUpdated,\n executedLookups,\n sectionState,\n },\n setFormSubmission,\n ] = useFormSubmissionState(\n form,\n initialSubmission,\n resumeAtElement,\n resumeSectionState,\n )\n return (\n <OneBlinkFormBase\n {...props}\n isReadOnly={false}\n definition={definition}\n submission={submission}\n setFormSubmission={setFormSubmission}\n lastElementUpdated={lastElementUpdated}\n executedLookups={executedLookups}\n sectionState={sectionState}\n getCurrentSubmissionDuration={getCurrentSubmissionDuration}\n />\n )\n})\n\nexport { OneBlinkFormControlled, OneBlinkFormUncontrolled }\n"]}
|
|
1
|
+
{"version":3,"file":"OneBlinkForm.js","sourceRoot":"","sources":["../src/OneBlinkForm.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,gBAIN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,sBAAsB,MAAM,gCAAgC,CAAA;AACnE,OAAO,yBAAyB,MAAM,mCAAmC,CAAA;AAKzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkUG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,sBAAsB,CACvE,KAA0D;IAE1D,OAAO,KAAC,gBAAgB,OAAK,KAAK,EAAE,UAAU,EAAE,KAAK,GAAI,CAAA;AAC3D,CAAC,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0NG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,wBAAwB,CAAC,EAC5E,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oCAAoC,EACpC,GAAG,KAAK,EAOP;IACD,MAAM,CAAC,4BAA4B,CAAC,GAAG,yBAAyB,CAC9D,oCAAoC,CACrC,CAAA;IACD,MAAM,CACJ,EACE,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,YAAY,GACb,EACD,iBAAiB,EAClB,GAAG,sBAAsB,CACxB,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,CACnB,CAAA;IACD,OAAO,CACL,KAAC,gBAAgB,OACX,KAAK,EACT,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,4BAA4B,EAAE,4BAA4B,GAC1D,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAA","sourcesContent":["import * as React from 'react'\nimport { FormTypes } from '@oneblink/types'\nimport OneBlinkFormBase, {\n OneBlinkFormBaseProps,\n OneBlinkFormControlledProps,\n OneBlinkFormUncontrolledProps,\n} from './OneBlinkFormBase'\nimport useFormSubmissionState from './hooks/useFormSubmissionState'\nimport useFormSubmissionDuration from './hooks/useFormSubmissionDuration'\nimport { SectionState } from './types/form'\n\nexport { OneBlinkFormBaseProps, OneBlinkFormControlledProps }\n\n/**\n * Similar to {@link OneBlinkForm}, however requires props to control the\n * `definition` and `submission` values.\n *\n * #### Example\n *\n * ```tsx\n * import React from 'react'\n * import ReactDOM from 'react-dom'\n * import { FormTypes } from '@oneblink/types'\n * import {\n * OneBlinkAppsError,\n * draftService,\n * submissionService,\n * IsOfflineContextProvider,\n * OneBlinkFormControlled,\n * useIsMounted,\n * useFormSubmissionState,\n * } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n *\n * const captchaSiteKey = 'ENTER_YOUR_SITE_KEY_HERE'\n * const googleMapsApiKey = 'ENTER_YOUR_MAPS_API_KEY_HERE'\n * const formsAppId = 1\n * const form: FormTypes.Form = {\n * id: 1,\n * name: 'Name of Form',\n * description: '',\n * organisationId: 'abc123',\n * formsAppEnvironmentId: 1,\n * formsAppIds: [],\n * elements: [],\n * isAuthenticated: false,\n * isMultiPage: false,\n * isInfoPage: false,\n * publishStartDate: null,\n * publishEndDate: null,\n * postSubmissionAction: 'FORMS_LIBRARY',\n * submissionEvents: [],\n * tags: [],\n * }\n * const initialSubmission: Record<string, unknown> = {\n * data: 1,\n * }\n *\n * function FormContainer() {\n * const isMounted = useIsMounted()\n *\n * const [{ definition, submission }, setFormSubmission] =\n * useFormSubmissionState(form, initialSubmission)\n *\n * const [{ isSavingDraft, saveDraftError }, setSaveDraftState] =\n * React.useState({\n * isSavingDraft: false,\n * saveDraftError: null,\n * })\n *\n * const [\n * { isSubmitting, submitError, formSubmissionResult },\n * setSubmitState,\n * ] = React.useState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: null,\n * })\n *\n * const handleSubmit = React.useCallback(\n * async (newFormSubmission: FormTypes.NewFormSubmission) => {\n * const formSubmission: FormSubmission = Object.assign(\n * {},\n * newFormSubmission,\n * {\n * formsAppId,\n * jobId: null,\n * externalId: null,\n * draftId: null,\n * preFillFormDataId: null,\n * },\n * )\n *\n * setSubmitState({\n * formSubmissionResult: null,\n * submitError: null,\n * isSubmitting: true,\n * })\n *\n * try {\n * const newFormSubmissionResult = await submissionService.submit({\n * formSubmission,\n * })\n * if (\n * newFormSubmissionResult.isOffline &&\n * !newFormSubmissionResult.isInPendingQueue\n * ) {\n * throw new OneBlinkAppsError(\n * 'You cannot submit this form while offline, please try again when connectivity is restored.',\n * {\n * isOffline: true,\n * },\n * )\n * }\n *\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: newFormSubmissionResult,\n * isSubmitting: false,\n * submitError: null,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: error,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleSaveDraft = React.useCallback(\n * async (newDraftSubmission: FormTypes.NewDraftSubmission) => {\n * const draftSubmission: FormTypes.DraftSubmission = {\n * ...newDraftSubmission,\n * formsAppId,\n * }\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: true,\n * })\n *\n * try {\n * await draftService.addDraft(\n * {\n * title: form.name,\n * formId: form.id,\n * externalId: null,\n * jobId: null,\n * },\n * draftSubmission,\n * )\n *\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: false,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: error,\n * isSavingDraft: false,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleCancel = React.useCallback(() => {\n * // handle cancel here...\n * }, [])\n *\n * if (isSubmitting) {\n * // Render submitting animation/loading\n * }\n *\n * if (submitError) {\n * // Render error while submitting\n * }\n *\n * if (isSavingDraft) {\n * // Render saving draft animation/loading\n * }\n *\n * if (saveDraftError) {\n * // Render error while saving draft\n * }\n *\n * if (formSubmissionResult) {\n * // Render submission success\n * }\n *\n * return (\n * <OneBlinkFormControlled\n * captchaSiteKey={captchaSiteKey}\n * googleMapsApiKey={googleMapsApiKey}\n * formsAppId={formsAppId}\n * definition={definition}\n * submission={submission}\n * setFormSubmission={setFormSubmission}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * />\n * )\n * }\n *\n * function App() {\n * return (\n * <IsOfflineContextProvider>\n * <FormContainer />\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * #### Implementing Controlled Auto Save\n *\n * The {@link OneBlinkAutoSaveForm} component does not offer props to allow for a\n * controlled form (i.e. having access to `submission` and `definition` values).\n * To implement a controlled version of the `<OneBlinkAutoSaveForm />`\n * component, use the example component below.\n *\n * ```tsx\n * import * as React from 'react'\n * import {\n * OneBlinkAutoSaveForm,\n * OneBlinkFormControlled,\n * useFormSubmissionAutoSaveState,\n * } from '@oneblink/apps-react'\n *\n * function OneBlinkAutoSaveFormControlled({\n * form,\n * initialSubmission,\n * autoSaveKey,\n * onCancel,\n * onSubmit,\n * onSaveDraft,\n * ...props\n * }: React.ComponentProps<typeof OneBlinkAutoSaveForm>) {\n * const {\n * definition,\n * submission,\n * isLoadingAutoSaveSubmission,\n * isAutoSaveSubmissionAvailable,\n * startNewSubmission,\n * continueAutoSaveSubmission,\n * handleSubmit,\n * handleCancel,\n * handleSaveDraft,\n * setFormSubmission,\n * } = useFormSubmissionAutoSaveState({\n * form,\n * initialSubmission,\n * autoSaveKey,\n * onCancel,\n * onSubmit,\n * onSaveDraft,\n * })\n *\n * // This is just an example of how you could intercept\n * // the change event when a user enters/selects a value\n * // on the form.\n * const customSetFormSubmission = React.useCallback(\n * (formSubmission) => {\n * setFormSubmission((currentFormSubmission) => {\n * const newFormSubmission =\n * typeof formSubmission === 'function'\n * ? formSubmission(currentFormSubmission)\n * : formSubmission\n *\n * // This is where you can access the updated\n * // submission data or form definition.\n * // You could even change the form definition\n * // programmatically based on user inputs.\n * console.log(\n * 'A change has occurred to the submission',\n * newFormSubmission.submission,\n * )\n * newFormSubmission.definition.isInfoPage =\n * !newFormSubmission.submission.doesTheUserNeedToSubmit\n *\n * return newFormSubmission\n * })\n * },\n * [setFormSubmission],\n * )\n *\n * if (isLoadingAutoSaveSubmission) {\n * return <p>Checking for auto save data...</p>\n * }\n *\n * if (isAutoSaveSubmissionAvailable) {\n * return (\n * <>\n * <p>Do you want to use the auto save data?</p>\n * <button onClick={startNewSubmission}>No, start again</button>\n * <button onClick={continueAutoSaveSubmission}>\n * Yes, continue\n * </button>\n * </>\n * )\n * }\n *\n * return (\n * <OneBlinkFormControlled\n * {...props}\n * submission={submission}\n * definition={definition}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * setFormSubmission={customSetFormSubmission}\n * />\n * )\n * }\n *\n * export default React.memo(OneBlinkAutoSaveFormControlled)\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nconst OneBlinkFormControlled = React.memo(function OneBlinkFormControlled(\n props: OneBlinkFormBaseProps & OneBlinkFormControlledProps,\n) {\n return <OneBlinkFormBase {...props} isReadOnly={false} />\n})\n\n/**\n * Component for rendering a OneBlink Form. This component will render the\n * submit, cancel and save draft buttons but it is up to the developer to\n * implement what happens when those buttons are clicked.\n *\n * It is also recommended to import the `css` from this library as well.\n *\n * ```js\n * import { OneBlinkForm } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n * ```\n *\n * #### Example\n *\n * ```tsx\n * import React from 'react'\n * import ReactDOM from 'react-dom'\n * import { FormTypes } from '@oneblink/types'\n * import {\n * OneBlinkAppsError,\n * draftService,\n * submissionService,\n * IsOfflineContextProvider,\n * OneBlinkForm,\n * useIsMounted,\n * } from '@oneblink/apps-react'\n * import '@oneblink/apps-react/dist/styles.css'\n *\n * const captchaSiteKey = 'ENTER_YOUR_SITE_KEY_HERE'\n * const googleMapsApiKey = 'ENTER_YOUR_MAPS_API_KEY_HERE'\n * const formsAppId = 1\n * const form: FormTypes.Form = {\n * id: 1,\n * name: 'Name of Form',\n * description: '',\n * organisationId: 'abc123',\n * formsAppEnvironmentId: 1,\n * formsAppIds: [],\n * elements: [],\n * isAuthenticated: false,\n * isMultiPage: false,\n * isInfoPage: false,\n * publishStartDate: null,\n * publishEndDate: null,\n * postSubmissionAction: 'FORMS_LIBRARY',\n * submissionEvents: [],\n * tags: [],\n * }\n *\n * function FormContainer() {\n * const isMounted = useIsMounted()\n *\n * const [{ isSavingDraft, saveDraftError }, setSaveDraftState] =\n * React.useState({\n * isSavingDraft: false,\n * saveDraftError: null,\n * })\n *\n * const [\n * { isSubmitting, submitError, formSubmissionResult },\n * setSubmitState,\n * ] = React.useState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: null,\n * })\n *\n * const handleSubmit = React.useCallback(\n * async (newFormSubmission: FormTypes.NewFormSubmission) => {\n * const formSubmission: FormSubmission = Object.assign(\n * {},\n * newFormSubmission,\n * {\n * formsAppId,\n * jobId: null,\n * externalId: null,\n * draftId: null,\n * preFillFormDataId: null,\n * },\n * )\n *\n * setSubmitState({\n * formSubmissionResult: null,\n * submitError: null,\n * isSubmitting: true,\n * })\n *\n * try {\n * const newFormSubmissionResult = await submissionService.submit({\n * formSubmission,\n * })\n * if (\n * newFormSubmissionResult.isOffline &&\n * !newFormSubmissionResult.isInPendingQueue\n * ) {\n * throw new OneBlinkAppsError(\n * 'You cannot submit this form while offline, please try again when connectivity is restored.',\n * {\n * isOffline: true,\n * },\n * )\n * }\n *\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: newFormSubmissionResult,\n * isSubmitting: false,\n * submitError: null,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSubmitState({\n * formSubmissionResult: null,\n * isSubmitting: false,\n * submitError: error,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleSaveDraft = React.useCallback(\n * async (newDraftSubmission: FormTypes.NewDraftSubmission) => {\n * const draftSubmission: FormTypes.DraftSubmission = {\n * ...newDraftSubmission,\n * formsAppId,\n * }\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: true,\n * })\n *\n * try {\n * await draftService.addDraft(\n * {\n * title: form.name,\n * formId: form.id,\n * externalId: null,\n * jobId: null,\n * },\n * draftSubmission,\n * )\n *\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: null,\n * isSavingDraft: false,\n * })\n * }\n * } catch (error) {\n * if (isMounted.current) {\n * setSaveDraftState({\n * saveDraftError: error,\n * isSavingDraft: false,\n * })\n * }\n * }\n * },\n * [isMounted],\n * )\n *\n * const handleCancel = React.useCallback(() => {\n * // handle cancel here...\n * }, [isMounted])\n *\n * if (isSubmitting) {\n * // Render submitting animation/loading\n * }\n *\n * if (submitError) {\n * // Render error while submitting\n * }\n *\n * if (isSavingDraft) {\n * // Render saving draft animation/loading\n * }\n *\n * if (saveDraftError) {\n * // Render error while saving draft\n * }\n *\n * if (formSubmissionResult) {\n * // Render submission success\n * }\n *\n * return (\n * <OneBlinkForm\n * captchaSiteKey={captchaSiteKey}\n * googleMapsApiKey={googleMapsApiKey}\n * formsAppId={formsAppId}\n * form={form}\n * onCancel={handleCancel}\n * onSubmit={handleSubmit}\n * onSaveDraft={handleSaveDraft}\n * attachmentRetentionInDays={1}\n * />\n * )\n * }\n *\n * function App() {\n * return (\n * <IsOfflineContextProvider>\n * <FormContainer />\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nconst OneBlinkFormUncontrolled = React.memo(function OneBlinkFormUncontrolled({\n form,\n initialSubmission,\n resumeAtElement,\n resumeSectionState,\n resumePreviousElapsedDurationSeconds,\n ...props\n}: OneBlinkFormBaseProps &\n OneBlinkFormUncontrolledProps & {\n /** The element to resume the form at. */\n resumeAtElement?: FormTypes.FormElement\n resumeSectionState?: SectionState\n resumePreviousElapsedDurationSeconds?: number\n }) {\n const [getCurrentSubmissionDuration] = useFormSubmissionDuration(\n resumePreviousElapsedDurationSeconds,\n )\n const [\n {\n definition,\n submission,\n lastElementUpdated,\n executedLookups,\n sectionState,\n },\n setFormSubmission,\n ] = useFormSubmissionState(\n form,\n initialSubmission,\n resumeAtElement,\n resumeSectionState,\n )\n return (\n <OneBlinkFormBase\n {...props}\n isReadOnly={false}\n definition={definition}\n submission={submission}\n setFormSubmission={setFormSubmission}\n lastElementUpdated={lastElementUpdated}\n executedLookups={executedLookups}\n sectionState={sectionState}\n getCurrentSubmissionDuration={getCurrentSubmissionDuration}\n />\n )\n})\n\nexport { OneBlinkFormControlled, OneBlinkFormUncontrolled }\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { submissionService, attachmentsService } from '
|
|
2
|
+
import { submissionService, attachmentsService } from './apps';
|
|
3
3
|
import { EnvironmentTypes, FormTypes, FormsAppsTypes, ScheduledTasksTypes, SubmissionTypes } from '@oneblink/types';
|
|
4
4
|
import { ReplaceInjectablesOverrides } from './hooks/useReplaceInjectablesOverrides';
|
|
5
5
|
import { CaptchaType, ExecutedLookups, SetFormSubmission, SectionState } from './types/form';
|
|
@@ -155,6 +155,6 @@ export type OneBlinkFormControlledProps = {
|
|
|
155
155
|
type Props = OneBlinkFormBaseProps & OneBlinkFormControlledProps & {
|
|
156
156
|
isReadOnly: boolean;
|
|
157
157
|
};
|
|
158
|
-
declare function OneBlinkFormBase({ googleMapsApiKey, abnLookupAuthenticationGuid, captchaSiteKey, definition, disabled, isPreview, submission, isReadOnly, onCancel, onSubmit, onSaveDraft, setFormSubmission, buttons, validationIcon, primaryColour, attachmentRetentionInDays, isPendingQueueEnabled, handleNavigateAway, isInfoPage: isInfoPageProp, lastElementUpdated, executedLookups, task, taskGroup, taskGroupInstance, onUploadAttachment, captchaType, shouldUseNavigableValidationErrorsNotification, navigableValidationErrorsNotificationSettings, replaceInjectablesOverrides, sectionState, scrollToTopOfPage, getCurrentSubmissionDuration, onBeforeUnload, }: Props):
|
|
158
|
+
declare function OneBlinkFormBase({ googleMapsApiKey, abnLookupAuthenticationGuid, captchaSiteKey, definition, disabled, isPreview, submission, isReadOnly, onCancel, onSubmit, onSaveDraft, setFormSubmission, buttons, validationIcon, primaryColour, attachmentRetentionInDays, isPendingQueueEnabled, handleNavigateAway, isInfoPage: isInfoPageProp, lastElementUpdated, executedLookups, task, taskGroup, taskGroupInstance, onUploadAttachment, captchaType, shouldUseNavigableValidationErrorsNotification, navigableValidationErrorsNotificationSettings, replaceInjectablesOverrides, sectionState, scrollToTopOfPage, getCurrentSubmissionDuration, onBeforeUnload, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
159
159
|
declare const _default: React.MemoExoticComponent<typeof OneBlinkFormBase>;
|
|
160
160
|
export default _default;
|
package/dist/OneBlinkFormBase.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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 { createTheme as createMuiTheme, ThemeProvider } from '@mui/material';
|
|
3
4
|
import Tooltip from './components/renderer/Tooltip';
|
|
4
5
|
import { Prompt, useHistory } from 'react-router-dom';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import * as bulmaToast from 'bulma-toast';
|
|
7
|
-
import { localisationService, attachmentsService, } from '
|
|
8
|
+
import { localisationService, attachmentsService, } from './apps';
|
|
8
9
|
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
9
|
-
import { AdapterDateFns } from '@mui/x-date-pickers/
|
|
10
|
+
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV2';
|
|
10
11
|
import Modal from './components/renderer/Modal';
|
|
11
12
|
import cleanFormSubmissionModel from './services/cleanFormSubmissionModel';
|
|
12
13
|
import PageFormElements from './components/renderer/PageFormElements';
|
|
@@ -296,6 +297,7 @@ function OneBlinkFormBase({ googleMapsApiKey, abnLookupAuthenticationGuid, captc
|
|
|
296
297
|
position: 'bottom-right',
|
|
297
298
|
opacity: 0.95,
|
|
298
299
|
appendTo: obFormContainerHTMLElement,
|
|
300
|
+
message: '',
|
|
299
301
|
});
|
|
300
302
|
}
|
|
301
303
|
return () => {
|
|
@@ -729,153 +731,55 @@ function OneBlinkFormBase({ googleMapsApiKey, abnLookupAuthenticationGuid, captc
|
|
|
729
731
|
setFormSubmission,
|
|
730
732
|
]);
|
|
731
733
|
if (conditionalLogicError) {
|
|
732
|
-
return (
|
|
733
|
-
React.createElement("div", { className: "has-text-centered" },
|
|
734
|
-
React.createElement(MaterialIcon, { className: "has-text-warning icon-x-large" }, "error"),
|
|
735
|
-
React.createElement("h3", { className: "title is-3" }, "Bad Form Configuration"),
|
|
736
|
-
React.createElement("p", { className: "cypress-conditional-logic-error-message" }, conditionalLogicError.message),
|
|
737
|
-
React.createElement("p", { className: "has-text-grey" }, localisationService.formatDatetimeLong(new Date())))));
|
|
734
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "has-text-centered", children: [_jsx(MaterialIcon, { className: "has-text-warning icon-x-large", children: "error" }), _jsx("h3", { className: "title is-3", children: "Bad Form Configuration" }), _jsx("p", { className: "cypress-conditional-logic-error-message", children: conditionalLogicError.message }), _jsx("p", { className: "has-text-grey", children: localisationService.formatDatetimeLong(new Date()) })] }) }));
|
|
738
735
|
}
|
|
739
|
-
return (
|
|
740
|
-
React.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns },
|
|
741
|
-
React.createElement(ReplaceInjectablesOverridesContext.Provider, { value: replaceInjectablesOverrides },
|
|
742
|
-
React.createElement(FormDefinitionContext.Provider, { value: definition },
|
|
743
|
-
React.createElement(FormElementOptionsContextProvider, { formIsReadOnly: isReadOnly },
|
|
744
|
-
React.createElement(FormElementLookupsContextProvider, null,
|
|
745
|
-
React.createElement(OneBlinkFormContainerContext.Provider, { value: obFormContainerHTMLElementRef.current },
|
|
746
|
-
React.createElement("div", { className: clsx('ob-form-container', {
|
|
736
|
+
return (_jsx(ThemeProvider, { theme: theme, children: _jsx(LocalizationProvider, { dateAdapter: AdapterDateFns, children: _jsx(ReplaceInjectablesOverridesContext.Provider, { value: replaceInjectablesOverrides, children: _jsx(FormDefinitionContext.Provider, { value: definition, children: _jsx(FormElementOptionsContextProvider, { formIsReadOnly: isReadOnly, children: _jsx(FormElementLookupsContextProvider, { children: _jsx(OneBlinkFormContainerContext.Provider, { value: obFormContainerHTMLElementRef, children: _jsxs("div", { className: clsx('ob-form-container', {
|
|
747
737
|
'is-showing-pages': isShowingMultiplePages,
|
|
748
|
-
}), ref: obFormContainerHTMLElementRef },
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
React.createElement("div", { className: clsx('steps-content', {
|
|
794
|
-
'is-single-step': !isShowingMultiplePages,
|
|
795
|
-
}) },
|
|
796
|
-
React.createElement(InjectPagesContext.Provider, { value: handlePagesLookupResult },
|
|
797
|
-
React.createElement(GoogleMapsApiKeyContext.Provider, { value: googleMapsApiKey },
|
|
798
|
-
React.createElement(AbnLookupAuthenticationGuidContext.Provider, { value: abnLookupAuthenticationGuid },
|
|
799
|
-
React.createElement(ValidationIconConfigurationContext.Provider, { value: validationIcon },
|
|
800
|
-
React.createElement(CaptchaContext.Provider, { value: captchaContextValue },
|
|
801
|
-
React.createElement(AttachmentBlobsProvider, null,
|
|
802
|
-
React.createElement(FormIsReadOnlyContext.Provider, { value: isReadOnly },
|
|
803
|
-
React.createElement(TaskContext.Provider, { value: taskContextValue },
|
|
804
|
-
React.createElement(OnUploadAttachmentContext.Provider, { value: onUploadAttachment }, visiblePages.map((pageElement) => (React.createElement(PageFormElements, { key: pageElement.id, isActive: pageElement.id ===
|
|
805
|
-
currentPage.id, formId: definition.id, formElementsConditionallyShown: formElementsConditionallyShown, formElementsValidation: formElementsValidation, displayValidationMessages: hasAttemptedSubmit ||
|
|
806
|
-
isDisplayingCurrentPageError, pageElement: pageElement, onChange: handleChange, model: submission, setFormSubmission: setFormSubmission, sectionState: sectionState }))))))))))))),
|
|
807
|
-
isShowingMultiplePages && (React.createElement("div", { className: "steps-actions" },
|
|
808
|
-
React.createElement("div", { className: "steps-action" },
|
|
809
|
-
React.createElement("button", { type: "button", onClick: goToPreviousPage, disabled: isFirstVisiblePage, className: "button is-light cypress-pages-previous" },
|
|
810
|
-
React.createElement("span", { className: "icon" },
|
|
811
|
-
React.createElement(MaterialIcon, null, "keyboard_arrow_left")),
|
|
812
|
-
React.createElement("span", null, "Back"))),
|
|
813
|
-
React.createElement("div", { className: "step-progress-mobile cypress-steps-mobile" }, visiblePages.map((page, index) => (React.createElement("div", { key: page.id, className: clsx('step-progress-mobile-dot', {
|
|
814
|
-
'is-active': currentPage.id === page.id,
|
|
815
|
-
'is-completed': currentPageIndex > index,
|
|
816
|
-
'has-background-danger': currentPage.id !== page.id &&
|
|
817
|
-
checkDisplayPageError(page),
|
|
818
|
-
}) })))),
|
|
819
|
-
React.createElement("div", { className: "steps-action" },
|
|
820
|
-
React.createElement("button", { type: "button", onClick: goToNextPage, disabled: isLastVisiblePage, className: "button is-light cypress-pages-next" },
|
|
821
|
-
React.createElement("span", null, "Next"),
|
|
822
|
-
React.createElement("span", { className: "icon" },
|
|
823
|
-
React.createElement(MaterialIcon, null, "keyboard_arrow_right"))))))),
|
|
824
|
-
!isReadOnly && (React.createElement("div", { className: "buttons ob-buttons ob-buttons-submit" },
|
|
825
|
-
onSaveDraft && !isInfoPage && (React.createElement("button", { type: "button", className: "button ob-button is-primary ob-button-save-draft cypress-save-draft-form", onClick: () => handleSaveDraft(false), disabled: isPreview || disabled },
|
|
826
|
-
React.createElement(CustomisableButtonInner, { label: ((_a = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _a === void 0 ? void 0 : _a.label) || 'Save Draft', icon: (_b = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _b === void 0 ? void 0 : _b.icon }))),
|
|
827
|
-
React.createElement("span", { className: "ob-buttons-submit__spacer" }),
|
|
828
|
-
!isInfoPage && (React.createElement("button", { type: "button", className: "button ob-button is-light ob-button-submit-cancel cypress-cancel-form", onClick: handleCancel, disabled: isPreview || disabled },
|
|
829
|
-
React.createElement(CustomisableButtonInner, { label: ((_c = buttons === null || buttons === void 0 ? void 0 : buttons.cancel) === null || _c === void 0 ? void 0 : _c.label) || 'Cancel', icon: (_d = buttons === null || buttons === void 0 ? void 0 : buttons.cancel) === null || _d === void 0 ? void 0 : _d.icon }))),
|
|
830
|
-
isLastVisiblePage && (React.createElement(Tooltip, { title: submissionConditionallyEnabled
|
|
831
|
-
? ''
|
|
832
|
-
: 'Submission disabled: Your inputs have not met the criteria for submission' },
|
|
833
|
-
React.createElement("button", { type: "submit", className: clsx('button ob-button is-success ob-button-submit cypress-submit-form-button cypress-submit-form', { 'is-loading': isPreparingToSubmit }, {
|
|
834
|
-
'ob-button-submit-is-disabled': submissionConditionallyEnabled,
|
|
835
|
-
}), disabled: isPreview ||
|
|
836
|
-
disabled ||
|
|
837
|
-
isPreparingToSubmit ||
|
|
838
|
-
!submissionConditionallyEnabled },
|
|
839
|
-
React.createElement(CustomisableButtonInner, { label: isInfoPage
|
|
840
|
-
? 'Done'
|
|
841
|
-
: ((_e = buttons === null || buttons === void 0 ? void 0 : buttons.submit) === null || _e === void 0 ? void 0 : _e.label) || 'Submit', icon: (_f = buttons === null || buttons === void 0 ? void 0 : buttons.submit) === null || _f === void 0 ? void 0 : _f.icon })))))))),
|
|
842
|
-
!isReadOnly && !isPreview && (React.createElement(React.Fragment, null,
|
|
843
|
-
React.createElement(Prompt, { when: isDirty && !isNavigationAllowed, message: handleBlockedNavigation }),
|
|
844
|
-
React.createElement(Modal, { isOpen: hasConfirmedNavigation === false, title: "Unsaved Changes", cardClassName: "cypress-cancel-confirm", titleClassName: "cypress-cancel-confirm-title", bodyClassName: "cypress-cancel-confirm-body", actions: React.createElement(React.Fragment, null,
|
|
845
|
-
onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button is-success cypress-cancel-confirm-save-draft", onClick: () => handleSaveDraft(false) },
|
|
846
|
-
React.createElement(CustomisableButtonInner, { label: ((_g = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _g === void 0 ? void 0 : _g.label) || 'Save Draft', icon: (_h = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _h === void 0 ? void 0 : _h.icon }))),
|
|
847
|
-
React.createElement("span", { style: { flex: 1 } }),
|
|
848
|
-
React.createElement("button", { type: "button", className: "button ob-button is-light cypress-cancel-confirm-back", onClick: handleKeepGoing },
|
|
849
|
-
React.createElement(CustomisableButtonInner, { label: ((_j = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptNo) === null || _j === void 0 ? void 0 : _j.label) || 'Back', icon: (_k = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptNo) === null || _k === void 0 ? void 0 : _k.icon })),
|
|
850
|
-
React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-cancel-confirm-discard", onClick: handleDiscardUnsavedChanges, autoFocus: true },
|
|
851
|
-
React.createElement(CustomisableButtonInner, { label: ((_l = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptYes) === null || _l === void 0 ? void 0 : _l.label) || 'Discard', icon: (_m = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptYes) === null || _m === void 0 ? void 0 : _m.icon }))) },
|
|
852
|
-
React.createElement("p", null, "You have unsaved changes, are you sure you want discard them?")),
|
|
853
|
-
React.createElement(Modal, { isOpen: promptUploadingAttachments === true, title: "Attachment upload in progress", cardClassName: "cypress-attachments-wait-continue", titleClassName: "cypress-attachments-confirm-wait-title", bodyClassName: "cypress-attachments-confirm-wait-body", actions: React.createElement(React.Fragment, null,
|
|
854
|
-
React.createElement("span", { style: { flex: 1 } }),
|
|
855
|
-
React.createElement("button", { type: "button", className: "button ob-button is-light cypress-attachments-confirm-wait", onClick: handleWaitForAttachments }, "Wait"),
|
|
856
|
-
React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-attachments-confirm-continue", onClick: handleContinueWithAttachments, autoFocus: true }, "Continue")) },
|
|
857
|
-
React.createElement("p", null, "Your attachments are still uploading, do you want to wait for the uploads to complete or continue using the app? If you click continue the attachments will upload in the background. Do not close the app until the upload has been completed.")),
|
|
858
|
-
React.createElement(Modal, { isOpen: promptOfflineSubmissionAttempt, title: "It looks like you're Offline", className: "ob-modal__offline-submission-attempt", cardClassName: "cypress-submission-offline has-text-centered", titleClassName: "cypress-offline-title", bodyClassName: "cypress-offline-body", actions: React.createElement(React.Fragment, null,
|
|
859
|
-
onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button ob-button__offline-submission-attempt-save-draft is-success", onClick: () => handleSaveDraft(false) },
|
|
860
|
-
React.createElement(CustomisableButtonInner, { label: ((_o = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _o === void 0 ? void 0 : _o.label) || 'Save Draft', icon: (_p = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _p === void 0 ? void 0 : _p.icon }))),
|
|
861
|
-
React.createElement("span", { style: { flex: 1 } }),
|
|
862
|
-
React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-cancel is-light", onClick: () => setPromptOfflineSubmissionAttempt(false) }, "Cancel"),
|
|
863
|
-
React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-try-again is-primary", onClick: (e) => {
|
|
864
|
-
setPromptOfflineSubmissionAttempt(false);
|
|
865
|
-
handleSubmit(e, false);
|
|
866
|
-
}, autoFocus: true }, "Try Again")) },
|
|
867
|
-
React.createElement("p", { className: "ob-modal__offline-submission-attempt-message" },
|
|
868
|
-
"You cannot submit this form while offline, please try again when connectivity is restored.",
|
|
869
|
-
onSaveDraft && (React.createElement("span", { className: "ob-modal__offline-submission-attempt-save-draft-message" },
|
|
870
|
-
' ',
|
|
871
|
-
"Alternatively, click the",
|
|
872
|
-
' ',
|
|
873
|
-
React.createElement("b", null, ((_q = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _q === void 0 ? void 0 : _q.label) || 'Save Draft'),
|
|
874
|
-
' ',
|
|
875
|
-
"button below to come back to this later."))),
|
|
876
|
-
React.createElement(MaterialIcon, { className: "has-text-warning icon-x-large ob-modal__offline-submission-attempt-icon" }, "wifi_off")))),
|
|
877
|
-
shouldUseNavigableValidationErrorsNotification &&
|
|
878
|
-
isShowingValidationErrorsCard && (React.createElement(ValidationErrorsCard, { visiblePages: visiblePages, formElementsValidation: formElementsValidation, setPageId: setPageId, currentPage: currentPage, navigationTopOffset: (_r = navigableValidationErrorsNotificationSettings === null || navigableValidationErrorsNotificationSettings === void 0 ? void 0 : navigableValidationErrorsNotificationSettings.navigationTopOffset) !== null && _r !== void 0 ? _r : 'CALCULATE', scrollableContainerId: navigableValidationErrorsNotificationSettings === null || navigableValidationErrorsNotificationSettings === void 0 ? void 0 : navigableValidationErrorsNotificationSettings.scrollableContainerId, validationErrorToastFocusElementRef: validationErrorToastFocusElementRef })))))))))));
|
|
738
|
+
}), ref: obFormContainerHTMLElementRef, children: [_jsx("form", { name: "obForm", className: `ob-form cypress-ob-form ob-form__page-${currentPageIndex + 1}`, noValidate: true, onSubmit: (e) => handleSubmit(e, false), children: _jsxs("div", { children: [_jsx("div", { ref: scrollToTopOfPageHTMLElementRef }), isShowingMultiplePages && (_jsxs("div", { className: clsx('ob-steps-navigation', {
|
|
739
|
+
'is-active': isStepsHeaderActive,
|
|
740
|
+
}), children: [_jsxs(Clickable, { className: clsx('ob-steps-navigation__header', {
|
|
741
|
+
'is-active': isStepsHeaderActive,
|
|
742
|
+
}), onClick: toggleStepsNavigation, children: [_jsx("span", { className: "icon is-invisible", children: _jsx(MaterialIcon, { children: "keyboard_arrow_down" }) }), _jsxs("div", { className: "steps-header-active-page", children: [isDisplayingCurrentPageError ? (_jsx("span", { className: "icon", children: _jsx(MaterialIcon, { className: "has-text-danger is-size-4", children: "warning" }) })) : (_jsx("span", { className: "steps-header-active-page-icon", children: currentPageNumber })), _jsx("span", { className: "steps-header-active-page-label cypress-tablet-step-title", children: currentPage ? currentPage.label : '' })] }), _jsx("span", { className: "dropdown icon", children: _jsx(MaterialIcon, { children: "keyboard_arrow_down" }) })] }), _jsx("div", { role: "navigation", className: clsx('ob-steps-navigation__steps', {
|
|
743
|
+
'is-active': isStepsHeaderActive,
|
|
744
|
+
}), children: _jsx("div", { className: "steps is-small is-horizontal-tablet cypress-steps", children: visiblePages.map((page, index) => {
|
|
745
|
+
const hasErrors = checkDisplayPageError(page);
|
|
746
|
+
return (_jsxs(Clickable, { id: `steps-navigation-step-${page.id}`, className: clsx('step-item cypress-step-item', {
|
|
747
|
+
'is-active': currentPage.id === page.id,
|
|
748
|
+
'is-completed': currentPageIndex > index,
|
|
749
|
+
'is-error': hasErrors,
|
|
750
|
+
}), onClick: (e) => {
|
|
751
|
+
e.stopPropagation();
|
|
752
|
+
if (page.id !== currentPage.id) {
|
|
753
|
+
setPageId(page.id);
|
|
754
|
+
}
|
|
755
|
+
}, children: [_jsx("div", { className: "step-marker step-marker-error ob-step-marker cypress-step-marker",
|
|
756
|
+
// @ts-expect-error ???
|
|
757
|
+
name: `cypress-page-stepper-${index + 1}`, value: index + 1, children: hasErrors ? (_jsx(Tooltip, { title: "Page has errors", children: _jsx("span", { className: "icon tooltip has-tooltip-top cypress-page-error", children: _jsx(MaterialIcon, { className: "has-text-danger is-size-3", children: "warning" }) }) })) : (_jsx("span", { children: index + 1 })) }), _jsx("div", { className: "step-details ob-step-details", children: _jsx("p", { className: "step-title ob-step-title cypress-desktop-step-title", id: `steps-navigation-step-label-${page.id}`, children: page.label }) })] }, page.id));
|
|
758
|
+
}) }) })] })), _jsx("div", { className: clsx('ob-steps-navigation__background', {
|
|
759
|
+
'is-active': isStepsHeaderActive,
|
|
760
|
+
}), onClick: toggleStepsNavigation }), _jsxs("div", { className: "steps", children: [_jsx("div", { className: clsx('steps-content', {
|
|
761
|
+
'is-single-step': !isShowingMultiplePages,
|
|
762
|
+
}), children: _jsx(InjectPagesContext.Provider, { value: handlePagesLookupResult, children: _jsx(GoogleMapsApiKeyContext.Provider, { value: googleMapsApiKey, children: _jsx(AbnLookupAuthenticationGuidContext.Provider, { value: abnLookupAuthenticationGuid, children: _jsx(ValidationIconConfigurationContext.Provider, { value: validationIcon, children: _jsx(CaptchaContext.Provider, { value: captchaContextValue, children: _jsx(AttachmentBlobsProvider, { children: _jsx(FormIsReadOnlyContext.Provider, { value: isReadOnly, children: _jsx(TaskContext.Provider, { value: taskContextValue, children: _jsx(OnUploadAttachmentContext.Provider, { value: onUploadAttachment, children: visiblePages.map((pageElement) => (_jsx(PageFormElements, { isActive: pageElement.id ===
|
|
763
|
+
currentPage.id, formId: definition.id, formElementsConditionallyShown: formElementsConditionallyShown, formElementsValidation: formElementsValidation, displayValidationMessages: hasAttemptedSubmit ||
|
|
764
|
+
isDisplayingCurrentPageError, pageElement: pageElement, onChange: handleChange, model: submission, setFormSubmission: setFormSubmission, sectionState: sectionState }, pageElement.id))) }) }) }) }) }) }) }) }) }) }), isShowingMultiplePages && (_jsxs("div", { className: "steps-actions", children: [_jsx("div", { className: "steps-action", children: _jsxs("button", { type: "button", onClick: goToPreviousPage, disabled: isFirstVisiblePage, className: "button is-light cypress-pages-previous", children: [_jsx("span", { className: "icon", children: _jsx(MaterialIcon, { children: "keyboard_arrow_left" }) }), _jsx("span", { children: "Back" })] }) }), _jsx("div", { className: "step-progress-mobile cypress-steps-mobile", children: visiblePages.map((page, index) => (_jsx("div", { className: clsx('step-progress-mobile-dot', {
|
|
765
|
+
'is-active': currentPage.id === page.id,
|
|
766
|
+
'is-completed': currentPageIndex > index,
|
|
767
|
+
'has-background-danger': currentPage.id !== page.id &&
|
|
768
|
+
checkDisplayPageError(page),
|
|
769
|
+
}) }, page.id))) }), _jsx("div", { className: "steps-action", children: _jsxs("button", { type: "button", onClick: goToNextPage, disabled: isLastVisiblePage, className: "button is-light cypress-pages-next", children: [_jsx("span", { children: "Next" }), _jsx("span", { className: "icon", children: _jsx(MaterialIcon, { children: "keyboard_arrow_right" }) })] }) })] }))] }), !isReadOnly && (_jsxs("div", { className: "buttons ob-buttons ob-buttons-submit", children: [onSaveDraft && !isInfoPage && (_jsx("button", { type: "button", className: "button ob-button is-primary ob-button-save-draft cypress-save-draft-form", onClick: () => handleSaveDraft(false), disabled: isPreview || disabled, children: _jsx(CustomisableButtonInner, { label: ((_a = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _a === void 0 ? void 0 : _a.label) || 'Save Draft', icon: (_b = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _b === void 0 ? void 0 : _b.icon }) })), _jsx("span", { className: "ob-buttons-submit__spacer" }), !isInfoPage && (_jsx("button", { type: "button", className: "button ob-button is-light ob-button-submit-cancel cypress-cancel-form", onClick: handleCancel, disabled: isPreview || disabled, children: _jsx(CustomisableButtonInner, { label: ((_c = buttons === null || buttons === void 0 ? void 0 : buttons.cancel) === null || _c === void 0 ? void 0 : _c.label) || 'Cancel', icon: (_d = buttons === null || buttons === void 0 ? void 0 : buttons.cancel) === null || _d === void 0 ? void 0 : _d.icon }) })), isLastVisiblePage && (_jsx(Tooltip, { title: submissionConditionallyEnabled
|
|
770
|
+
? ''
|
|
771
|
+
: 'Submission disabled: Your inputs have not met the criteria for submission', children: _jsx("button", { type: "submit", className: clsx('button ob-button is-success ob-button-submit cypress-submit-form-button cypress-submit-form', { 'is-loading': isPreparingToSubmit }, {
|
|
772
|
+
'ob-button-submit-is-disabled': submissionConditionallyEnabled,
|
|
773
|
+
}), disabled: isPreview ||
|
|
774
|
+
disabled ||
|
|
775
|
+
isPreparingToSubmit ||
|
|
776
|
+
!submissionConditionallyEnabled, children: _jsx(CustomisableButtonInner, { label: isInfoPage
|
|
777
|
+
? 'Done'
|
|
778
|
+
: ((_e = buttons === null || buttons === void 0 ? void 0 : buttons.submit) === null || _e === void 0 ? void 0 : _e.label) || 'Submit', icon: (_f = buttons === null || buttons === void 0 ? void 0 : buttons.submit) === null || _f === void 0 ? void 0 : _f.icon }) }) }))] }))] }) }), !isReadOnly && !isPreview && (_jsxs(React.Fragment, { children: [_jsx(Prompt, { when: isDirty && !isNavigationAllowed, message: handleBlockedNavigation }), _jsx(Modal, { isOpen: hasConfirmedNavigation === false, title: "Unsaved Changes", cardClassName: "cypress-cancel-confirm", titleClassName: "cypress-cancel-confirm-title", bodyClassName: "cypress-cancel-confirm-body", actions: _jsxs(_Fragment, { children: [onSaveDraft && (_jsx("button", { type: "button", className: "button ob-button is-success cypress-cancel-confirm-save-draft", onClick: () => handleSaveDraft(false), children: _jsx(CustomisableButtonInner, { label: ((_g = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _g === void 0 ? void 0 : _g.label) || 'Save Draft', icon: (_h = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _h === void 0 ? void 0 : _h.icon }) })), _jsx("span", { style: { flex: 1 } }), _jsx("button", { type: "button", className: "button ob-button is-light cypress-cancel-confirm-back", onClick: handleKeepGoing, children: _jsx(CustomisableButtonInner, { label: ((_j = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptNo) === null || _j === void 0 ? void 0 : _j.label) || 'Back', icon: (_k = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptNo) === null || _k === void 0 ? void 0 : _k.icon }) }), _jsx("button", { type: "button", className: "button ob-button is-primary cypress-cancel-confirm-discard", onClick: handleDiscardUnsavedChanges, autoFocus: true, children: _jsx(CustomisableButtonInner, { label: ((_l = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptYes) === null || _l === void 0 ? void 0 : _l.label) || 'Discard', icon: (_m = buttons === null || buttons === void 0 ? void 0 : buttons.cancelPromptYes) === null || _m === void 0 ? void 0 : _m.icon }) })] }), children: _jsx("p", { children: "You have unsaved changes, are you sure you want discard them?" }) }), _jsx(Modal, { isOpen: promptUploadingAttachments === true, title: "Attachment upload in progress", cardClassName: "cypress-attachments-wait-continue", titleClassName: "cypress-attachments-confirm-wait-title", bodyClassName: "cypress-attachments-confirm-wait-body", actions: _jsxs(_Fragment, { children: [_jsx("span", { style: { flex: 1 } }), _jsx("button", { type: "button", className: "button ob-button is-light cypress-attachments-confirm-wait", onClick: handleWaitForAttachments, children: "Wait" }), _jsx("button", { type: "button", className: "button ob-button is-primary cypress-attachments-confirm-continue", onClick: handleContinueWithAttachments, autoFocus: true, children: "Continue" })] }), children: _jsx("p", { children: "Your attachments are still uploading, do you want to wait for the uploads to complete or continue using the app? If you click continue the attachments will upload in the background. Do not close the app until the upload has been completed." }) }), _jsxs(Modal, { isOpen: promptOfflineSubmissionAttempt, title: "It looks like you're Offline", className: "ob-modal__offline-submission-attempt", cardClassName: "cypress-submission-offline has-text-centered", titleClassName: "cypress-offline-title", bodyClassName: "cypress-offline-body", actions: _jsxs(_Fragment, { children: [onSaveDraft && (_jsx("button", { type: "button", className: "button ob-button ob-button__offline-submission-attempt-save-draft is-success", onClick: () => handleSaveDraft(false), children: _jsx(CustomisableButtonInner, { label: ((_o = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _o === void 0 ? void 0 : _o.label) || 'Save Draft', icon: (_p = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _p === void 0 ? void 0 : _p.icon }) })), _jsx("span", { style: { flex: 1 } }), _jsx("button", { className: "button ob-button ob-button__offline-submission-attempt-cancel is-light", onClick: () => setPromptOfflineSubmissionAttempt(false), children: "Cancel" }), _jsx("button", { className: "button ob-button ob-button__offline-submission-attempt-try-again is-primary", onClick: (e) => {
|
|
779
|
+
setPromptOfflineSubmissionAttempt(false);
|
|
780
|
+
handleSubmit(e, false);
|
|
781
|
+
}, autoFocus: true, children: "Try Again" })] }), children: [_jsxs("p", { className: "ob-modal__offline-submission-attempt-message", children: ["You cannot submit this form while offline, please try again when connectivity is restored.", onSaveDraft && (_jsxs("span", { className: "ob-modal__offline-submission-attempt-save-draft-message", children: [' ', "Alternatively, click the", ' ', _jsx("b", { children: ((_q = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _q === void 0 ? void 0 : _q.label) || 'Save Draft' }), ' ', "button below to come back to this later."] }))] }), _jsx(MaterialIcon, { className: "has-text-warning icon-x-large ob-modal__offline-submission-attempt-icon", children: "wifi_off" })] })] })), shouldUseNavigableValidationErrorsNotification &&
|
|
782
|
+
isShowingValidationErrorsCard && (_jsx(ValidationErrorsCard, { visiblePages: visiblePages, formElementsValidation: formElementsValidation, setPageId: setPageId, currentPage: currentPage, navigationTopOffset: (_r = navigableValidationErrorsNotificationSettings === null || navigableValidationErrorsNotificationSettings === void 0 ? void 0 : navigableValidationErrorsNotificationSettings.navigationTopOffset) !== null && _r !== void 0 ? _r : 'CALCULATE', scrollableContainerId: navigableValidationErrorsNotificationSettings === null || navigableValidationErrorsNotificationSettings === void 0 ? void 0 : navigableValidationErrorsNotificationSettings.scrollableContainerId, validationErrorToastFocusElementRef: validationErrorToastFocusElementRef }))] }) }) }) }) }) }) }) }));
|
|
879
783
|
}
|
|
880
784
|
export default React.memo(OneBlinkFormBase);
|
|
881
785
|
//# sourceMappingURL=OneBlinkFormBase.js.map
|