@oneblink/apps-react 4.3.0-beta.10 → 4.3.0-beta.11

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.
Files changed (46) hide show
  1. package/dist/OneBlinkFormBase.js +116 -114
  2. package/dist/OneBlinkFormBase.js.map +1 -1
  3. package/dist/components/renderer/LookupButton.d.ts +1 -2
  4. package/dist/components/renderer/LookupButton.js +9 -4
  5. package/dist/components/renderer/LookupButton.js.map +1 -1
  6. package/dist/components/renderer/LookupNotification.js +35 -25
  7. package/dist/components/renderer/LookupNotification.js.map +1 -1
  8. package/dist/form-elements/FormElementABN.js +1 -1
  9. package/dist/form-elements/FormElementABN.js.map +1 -1
  10. package/dist/form-elements/FormElementBSB.js +1 -1
  11. package/dist/form-elements/FormElementBSB.js.map +1 -1
  12. package/dist/form-elements/FormElementBarcodeScanner.js +1 -1
  13. package/dist/form-elements/FormElementBarcodeScanner.js.map +1 -1
  14. package/dist/form-elements/FormElementCheckBoxes.js +1 -1
  15. package/dist/form-elements/FormElementCheckBoxes.js.map +1 -1
  16. package/dist/form-elements/FormElementDate.js +1 -1
  17. package/dist/form-elements/FormElementDate.js.map +1 -1
  18. package/dist/form-elements/FormElementDateTime.js +1 -1
  19. package/dist/form-elements/FormElementDateTime.js.map +1 -1
  20. package/dist/form-elements/FormElementEmail.js +1 -1
  21. package/dist/form-elements/FormElementEmail.js.map +1 -1
  22. package/dist/form-elements/FormElementNumber.js +1 -1
  23. package/dist/form-elements/FormElementNumber.js.map +1 -1
  24. package/dist/form-elements/FormElementSelect.js +1 -1
  25. package/dist/form-elements/FormElementSelect.js.map +1 -1
  26. package/dist/form-elements/FormElementTelephone.js +1 -1
  27. package/dist/form-elements/FormElementTelephone.js.map +1 -1
  28. package/dist/form-elements/FormElementText.js +1 -1
  29. package/dist/form-elements/FormElementText.js.map +1 -1
  30. package/dist/form-elements/FormElementTextarea.js +1 -1
  31. package/dist/form-elements/FormElementTextarea.js.map +1 -1
  32. package/dist/form-elements/FormElementTime.js +1 -1
  33. package/dist/form-elements/FormElementTime.js.map +1 -1
  34. package/dist/hooks/useFormElementLookups.d.ts +13 -0
  35. package/dist/hooks/useFormElementLookups.js +40 -0
  36. package/dist/hooks/useFormElementLookups.js.map +1 -0
  37. package/dist/hooks/useLoadResourcesState.d.ts +61 -0
  38. package/dist/hooks/useLoadResourcesState.js +66 -0
  39. package/dist/hooks/useLoadResourcesState.js.map +1 -0
  40. package/dist/hooks/useLookupNotification.d.ts +4 -0
  41. package/dist/hooks/useLookupNotification.js +2 -0
  42. package/dist/hooks/useLookupNotification.js.map +1 -1
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +1 -0
  45. package/dist/index.js.map +1 -1
  46. package/package.json +2 -2
@@ -16,6 +16,7 @@ import { FormDefinitionContext } from './hooks/useFormDefinition';
16
16
  import { InjectPagesContext } from './hooks/useInjectPages';
17
17
  import { ExecutedLookupProvider } from './hooks/useExecutedLookupCallback';
18
18
  import { FormElementOptionsContextProvider } from './hooks/useDynamicOptionsLoaderState';
19
+ import { FormElementLookupsContextProvider } from './hooks/useFormElementLookups';
19
20
  import { GoogleMapsApiKeyContext } from './hooks/useGoogleMapsApiKey';
20
21
  import { AbnLookupAuthenticationGuidContext } from './hooks/useAbnLookupAuthenticationGuid';
21
22
  import { CaptchaSiteKeyContext } from './hooks/useCaptchaSiteKey';
@@ -477,124 +478,125 @@ function OneBlinkFormBase({ googleMapsApiKey, abnLookupAuthenticationGuid, captc
477
478
  return (React.createElement(ThemeProvider, { theme: theme },
478
479
  React.createElement(FormDefinitionContext.Provider, { value: definition },
479
480
  React.createElement(FormElementOptionsContextProvider, null,
480
- React.createElement("div", { className: "ob-form-container", ref: obFormContainerHTMLElementRef },
481
- React.createElement("form", { name: "obForm", className: `ob-form cypress-ob-form ob-form__page-${currentPageIndex + 1}`, noValidate: true, onSubmit: (e) => handleSubmit(e, false) },
482
- React.createElement("div", null,
483
- React.createElement("div", { ref: scrollToTopOfPageHTMLElementRef }),
484
- isShowingMultiplePages && (React.createElement("div", { className: clsx('ob-steps-navigation', {
485
- 'is-active': isStepsHeaderActive,
486
- }) },
487
- React.createElement("div", { className: clsx('ob-steps-navigation__header', {
488
- 'is-active': isStepsHeaderActive,
489
- }), onClick: toggleStepsNavigation },
490
- React.createElement("span", { className: "icon is-invisible" },
491
- React.createElement("i", { className: "material-icons" }, "keyboard_arrow_down")),
492
- React.createElement("div", { className: "steps-header-active-page" },
493
- isDisplayingCurrentPageError ? (React.createElement("span", { className: "icon" },
494
- React.createElement("i", { className: "material-icons has-text-danger is-size-4" }, "warning"))) : (React.createElement("span", { className: "steps-header-active-page-icon" }, currentPageNumber)),
495
- React.createElement("span", { className: "steps-header-active-page-label cypress-tablet-step-title" }, currentPage ? currentPage.label : '')),
496
- React.createElement("span", { className: "dropdown icon" },
497
- React.createElement("i", { className: "material-icons" }, "keyboard_arrow_down"))),
498
- React.createElement("div", { className: clsx('ob-steps-navigation__steps', {
481
+ React.createElement(FormElementLookupsContextProvider, null,
482
+ React.createElement("div", { className: "ob-form-container", ref: obFormContainerHTMLElementRef },
483
+ React.createElement("form", { name: "obForm", className: `ob-form cypress-ob-form ob-form__page-${currentPageIndex + 1}`, noValidate: true, onSubmit: (e) => handleSubmit(e, false) },
484
+ React.createElement("div", null,
485
+ React.createElement("div", { ref: scrollToTopOfPageHTMLElementRef }),
486
+ isShowingMultiplePages && (React.createElement("div", { className: clsx('ob-steps-navigation', {
499
487
  'is-active': isStepsHeaderActive,
500
488
  }) },
501
- React.createElement("div", { className: "steps is-small is-horizontal-tablet cypress-steps" }, visiblePages.map((page, index) => {
502
- const hasErrors = checkDisplayPageError(page);
503
- return (React.createElement("div", { key: page.id, id: `steps-navigation-step-${page.id}`, className: clsx('step-item cypress-step-item', {
489
+ React.createElement("div", { className: clsx('ob-steps-navigation__header', {
490
+ 'is-active': isStepsHeaderActive,
491
+ }), onClick: toggleStepsNavigation },
492
+ React.createElement("span", { className: "icon is-invisible" },
493
+ React.createElement("i", { className: "material-icons" }, "keyboard_arrow_down")),
494
+ React.createElement("div", { className: "steps-header-active-page" },
495
+ isDisplayingCurrentPageError ? (React.createElement("span", { className: "icon" },
496
+ React.createElement("i", { className: "material-icons has-text-danger is-size-4" }, "warning"))) : (React.createElement("span", { className: "steps-header-active-page-icon" }, currentPageNumber)),
497
+ React.createElement("span", { className: "steps-header-active-page-label cypress-tablet-step-title" }, currentPage ? currentPage.label : '')),
498
+ React.createElement("span", { className: "dropdown icon" },
499
+ React.createElement("i", { className: "material-icons" }, "keyboard_arrow_down"))),
500
+ React.createElement("div", { className: clsx('ob-steps-navigation__steps', {
501
+ 'is-active': isStepsHeaderActive,
502
+ }) },
503
+ React.createElement("div", { className: "steps is-small is-horizontal-tablet cypress-steps" }, visiblePages.map((page, index) => {
504
+ const hasErrors = checkDisplayPageError(page);
505
+ return (React.createElement("div", { key: page.id, id: `steps-navigation-step-${page.id}`, className: clsx('step-item cypress-step-item', {
506
+ 'is-active': currentPage.id === page.id,
507
+ 'is-completed': currentPageIndex > index,
508
+ 'is-error': hasErrors,
509
+ }), onClick: (e) => {
510
+ e.stopPropagation();
511
+ if (page.id !== currentPage.id) {
512
+ setPageId(page.id);
513
+ }
514
+ } },
515
+ React.createElement("div", { className: "step-marker step-marker-error ob-step-marker cypress-step-marker",
516
+ // @ts-expect-error ???
517
+ name: `cypress-page-stepper-${index + 1}`, value: index + 1 }, hasErrors ? (React.createElement(Tooltip, { title: "Page has errors" },
518
+ React.createElement("span", { className: "icon tooltip has-tooltip-top cypress-page-error" },
519
+ React.createElement("i", { className: "material-icons has-text-danger is-size-3" }, "warning")))) : (React.createElement("span", null, index + 1))),
520
+ React.createElement("div", { className: "step-details ob-step-details" },
521
+ React.createElement("p", { className: "step-title ob-step-title cypress-desktop-step-title" }, page.label))));
522
+ }))))),
523
+ React.createElement("div", { className: clsx('ob-steps-navigation__background', {
524
+ 'is-active': isStepsHeaderActive,
525
+ }), onClick: toggleStepsNavigation }),
526
+ React.createElement("div", { className: "steps" },
527
+ React.createElement("div", { className: clsx('steps-content', {
528
+ 'is-single-step': !isShowingMultiplePages,
529
+ }) },
530
+ React.createElement(InjectPagesContext.Provider, { value: handlePagesLookupResult },
531
+ React.createElement(ExecutedLookupProvider, { executedLookup: executedLookup, executeLookupFailed: executeLookupFailed },
532
+ React.createElement(GoogleMapsApiKeyContext.Provider, { value: googleMapsApiKey },
533
+ React.createElement(AbnLookupAuthenticationGuidContext.Provider, { value: abnLookupAuthenticationGuid },
534
+ React.createElement(CaptchaSiteKeyContext.Provider, { value: captchaSiteKey },
535
+ React.createElement(AttachmentBlobsProvider, null,
536
+ React.createElement(FormIsReadOnlyContext.Provider, { value: isReadOnly }, visiblePages.map((pageElement) => (React.createElement(PageFormElements, { key: pageElement.id, isActive: pageElement.id === currentPage.id, formId: definition.id, formElementsConditionallyShown: formElementsConditionallyShown, formElementsValidation: formElementsValidation, displayValidationMessages: hasAttemptedSubmit ||
537
+ isDisplayingCurrentPageError, pageElement: pageElement, onChange: handleChange, model: submission, setFormSubmission: setFormSubmission }))))))))))),
538
+ isShowingMultiplePages && (React.createElement("div", { className: "steps-actions" },
539
+ React.createElement("div", { className: "steps-action" },
540
+ React.createElement("button", { type: "button", onClick: goToPreviousPage, disabled: isFirstVisiblePage, className: "button is-light cypress-pages-previous" },
541
+ React.createElement("span", { className: "icon" },
542
+ React.createElement("i", { className: "material-icons" }, "keyboard_arrow_left")),
543
+ React.createElement("span", null, "Back"))),
544
+ 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', {
504
545
  'is-active': currentPage.id === page.id,
505
546
  'is-completed': currentPageIndex > index,
506
- 'is-error': hasErrors,
507
- }), onClick: (e) => {
508
- e.stopPropagation();
509
- if (page.id !== currentPage.id) {
510
- setPageId(page.id);
511
- }
512
- } },
513
- React.createElement("div", { className: "step-marker step-marker-error ob-step-marker cypress-step-marker",
514
- // @ts-expect-error ???
515
- name: `cypress-page-stepper-${index + 1}`, value: index + 1 }, hasErrors ? (React.createElement(Tooltip, { title: "Page has errors" },
516
- React.createElement("span", { className: "icon tooltip has-tooltip-top cypress-page-error" },
517
- React.createElement("i", { className: "material-icons has-text-danger is-size-3" }, "warning")))) : (React.createElement("span", null, index + 1))),
518
- React.createElement("div", { className: "step-details ob-step-details" },
519
- React.createElement("p", { className: "step-title ob-step-title cypress-desktop-step-title" }, page.label))));
520
- }))))),
521
- React.createElement("div", { className: clsx('ob-steps-navigation__background', {
522
- 'is-active': isStepsHeaderActive,
523
- }), onClick: toggleStepsNavigation }),
524
- React.createElement("div", { className: "steps" },
525
- React.createElement("div", { className: clsx('steps-content', {
526
- 'is-single-step': !isShowingMultiplePages,
527
- }) },
528
- React.createElement(InjectPagesContext.Provider, { value: handlePagesLookupResult },
529
- React.createElement(ExecutedLookupProvider, { executedLookup: executedLookup, executeLookupFailed: executeLookupFailed },
530
- React.createElement(GoogleMapsApiKeyContext.Provider, { value: googleMapsApiKey },
531
- React.createElement(AbnLookupAuthenticationGuidContext.Provider, { value: abnLookupAuthenticationGuid },
532
- React.createElement(CaptchaSiteKeyContext.Provider, { value: captchaSiteKey },
533
- React.createElement(AttachmentBlobsProvider, null,
534
- React.createElement(FormIsReadOnlyContext.Provider, { value: isReadOnly }, visiblePages.map((pageElement) => (React.createElement(PageFormElements, { key: pageElement.id, isActive: pageElement.id === currentPage.id, formId: definition.id, formElementsConditionallyShown: formElementsConditionallyShown, formElementsValidation: formElementsValidation, displayValidationMessages: hasAttemptedSubmit ||
535
- isDisplayingCurrentPageError, pageElement: pageElement, onChange: handleChange, model: submission, setFormSubmission: setFormSubmission }))))))))))),
536
- isShowingMultiplePages && (React.createElement("div", { className: "steps-actions" },
537
- React.createElement("div", { className: "steps-action" },
538
- React.createElement("button", { type: "button", onClick: goToPreviousPage, disabled: isFirstVisiblePage, className: "button is-light cypress-pages-previous" },
539
- React.createElement("span", { className: "icon" },
540
- React.createElement("i", { className: "material-icons" }, "keyboard_arrow_left")),
541
- React.createElement("span", null, "Back"))),
542
- 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', {
543
- 'is-active': currentPage.id === page.id,
544
- 'is-completed': currentPageIndex > index,
545
- 'has-background-danger': currentPage.id !== page.id &&
546
- checkDisplayPageError(page),
547
- }) })))),
548
- React.createElement("div", { className: "steps-action" },
549
- React.createElement("button", { type: "button", onClick: goToNextPage, disabled: isLastVisiblePage, className: "button is-light cypress-pages-next" },
550
- React.createElement("span", null, "Next"),
551
- React.createElement("span", { className: "icon" },
552
- React.createElement("i", { className: "material-icons" }, "keyboard_arrow_right"))))))),
553
- !isReadOnly && (React.createElement("div", { className: "buttons ob-buttons ob-buttons-submit" },
554
- 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 },
555
- 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 }))),
556
- React.createElement("span", { className: "ob-buttons-submit__spacer" }),
557
- !isInfoPage && (React.createElement("button", { type: "button", className: "button ob-button is-light ob-button-submit-cancel cypress-cancel-form", onClick: handleCancel, disabled: isPreview || disabled },
558
- 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 }))),
559
- isLastVisiblePage && (React.createElement("button", { type: "submit", className: "button ob-button is-success ob-button-submit cypress-submit-form-button cypress-submit-form", disabled: isPreview || disabled },
560
- React.createElement(CustomisableButtonInner, { label: isInfoPage
561
- ? 'Done'
562
- : ((_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 }))))))),
563
- !isReadOnly && (React.createElement(React.Fragment, null,
564
- React.createElement(Prompt, { when: isDirty && !isNavigationAllowed, message: handleBlockedNavigation }),
565
- 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,
566
- onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button is-success cypress-cancel-confirm-save-draft", onClick: () => handleSaveDraft(false) },
567
- 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 }))),
568
- React.createElement("span", { style: { flex: 1 } }),
569
- React.createElement("button", { type: "button", className: "button ob-button is-light cypress-cancel-confirm-back", onClick: handleKeepGoing },
570
- 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 })),
571
- React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-cancel-confirm-discard", onClick: handleDiscardUnsavedChanges },
572
- 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 }))) },
573
- React.createElement("p", null, "You have unsaved changes, are you sure you want discard them?")),
574
- 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,
575
- React.createElement("span", { style: { flex: 1 } }),
576
- React.createElement("button", { type: "button", className: "button ob-button is-light cypress-attachments-confirm-wait", onClick: handleWaitForAttachments }, "Wait"),
577
- React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-attachments-confirm-continue", onClick: handleContinueWithAttachments }, "Continue")) },
578
- 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.")),
579
- 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,
580
- onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button ob-button__offline-submission-attempt-save-draft is-success", onClick: () => handleSaveDraft(false) },
581
- 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 }))),
582
- React.createElement("span", { style: { flex: 1 } }),
583
- React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-cancel is-light", onClick: () => setPromptOfflineSubmissionAttempt(false) }, "Cancel"),
584
- React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-try-again is-primary", onClick: (e) => {
585
- setPromptOfflineSubmissionAttempt(false);
586
- handleSubmit(e, false);
587
- } }, "Try Again")) },
588
- React.createElement("p", { className: "ob-modal__offline-submission-attempt-message" },
589
- "You cannot submit this form while offline, please try again when connectivity is restored.",
590
- onSaveDraft && (React.createElement("span", { className: "ob-modal__offline-submission-attempt-save-draft-message" },
591
- ' ',
592
- "Alternatively, click the",
593
- ' ',
594
- React.createElement("b", null, ((_q = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _q === void 0 ? void 0 : _q.label) || 'Save Draft'),
595
- ' ',
596
- "button below to come back to this later."))),
597
- React.createElement("i", { className: "material-icons has-text-warning icon-x-large ob-modal__offline-submission-attempt-icon" }, "wifi_off")))))))));
547
+ 'has-background-danger': currentPage.id !== page.id &&
548
+ checkDisplayPageError(page),
549
+ }) })))),
550
+ React.createElement("div", { className: "steps-action" },
551
+ React.createElement("button", { type: "button", onClick: goToNextPage, disabled: isLastVisiblePage, className: "button is-light cypress-pages-next" },
552
+ React.createElement("span", null, "Next"),
553
+ React.createElement("span", { className: "icon" },
554
+ React.createElement("i", { className: "material-icons" }, "keyboard_arrow_right"))))))),
555
+ !isReadOnly && (React.createElement("div", { className: "buttons ob-buttons ob-buttons-submit" },
556
+ 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 },
557
+ 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 }))),
558
+ React.createElement("span", { className: "ob-buttons-submit__spacer" }),
559
+ !isInfoPage && (React.createElement("button", { type: "button", className: "button ob-button is-light ob-button-submit-cancel cypress-cancel-form", onClick: handleCancel, disabled: isPreview || disabled },
560
+ 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 }))),
561
+ isLastVisiblePage && (React.createElement("button", { type: "submit", className: "button ob-button is-success ob-button-submit cypress-submit-form-button cypress-submit-form", disabled: isPreview || disabled },
562
+ React.createElement(CustomisableButtonInner, { label: isInfoPage
563
+ ? 'Done'
564
+ : ((_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 }))))))),
565
+ !isReadOnly && (React.createElement(React.Fragment, null,
566
+ React.createElement(Prompt, { when: isDirty && !isNavigationAllowed, message: handleBlockedNavigation }),
567
+ 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,
568
+ onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button is-success cypress-cancel-confirm-save-draft", onClick: () => handleSaveDraft(false) },
569
+ 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 }))),
570
+ React.createElement("span", { style: { flex: 1 } }),
571
+ React.createElement("button", { type: "button", className: "button ob-button is-light cypress-cancel-confirm-back", onClick: handleKeepGoing },
572
+ 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 })),
573
+ React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-cancel-confirm-discard", onClick: handleDiscardUnsavedChanges },
574
+ 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 }))) },
575
+ React.createElement("p", null, "You have unsaved changes, are you sure you want discard them?")),
576
+ 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,
577
+ React.createElement("span", { style: { flex: 1 } }),
578
+ React.createElement("button", { type: "button", className: "button ob-button is-light cypress-attachments-confirm-wait", onClick: handleWaitForAttachments }, "Wait"),
579
+ React.createElement("button", { type: "button", className: "button ob-button is-primary cypress-attachments-confirm-continue", onClick: handleContinueWithAttachments }, "Continue")) },
580
+ 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.")),
581
+ 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,
582
+ onSaveDraft && (React.createElement("button", { type: "button", className: "button ob-button ob-button__offline-submission-attempt-save-draft is-success", onClick: () => handleSaveDraft(false) },
583
+ 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 }))),
584
+ React.createElement("span", { style: { flex: 1 } }),
585
+ React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-cancel is-light", onClick: () => setPromptOfflineSubmissionAttempt(false) }, "Cancel"),
586
+ React.createElement("button", { className: "button ob-button ob-button__offline-submission-attempt-try-again is-primary", onClick: (e) => {
587
+ setPromptOfflineSubmissionAttempt(false);
588
+ handleSubmit(e, false);
589
+ } }, "Try Again")) },
590
+ React.createElement("p", { className: "ob-modal__offline-submission-attempt-message" },
591
+ "You cannot submit this form while offline, please try again when connectivity is restored.",
592
+ onSaveDraft && (React.createElement("span", { className: "ob-modal__offline-submission-attempt-save-draft-message" },
593
+ ' ',
594
+ "Alternatively, click the",
595
+ ' ',
596
+ React.createElement("b", null, ((_q = buttons === null || buttons === void 0 ? void 0 : buttons.saveDraft) === null || _q === void 0 ? void 0 : _q.label) || 'Save Draft'),
597
+ ' ',
598
+ "button below to come back to this later."))),
599
+ React.createElement("i", { className: "material-icons has-text-warning icon-x-large ob-modal__offline-submission-attempt-icon" }, "wifi_off"))))))))));
598
600
  }
599
601
  export default React.memo(OneBlinkFormBase);
600
602
  //# sourceMappingURL=OneBlinkFormBase.js.map