@wise/dynamic-flow-client 0.4.0-beta-0489d0.8 → 0.4.0
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/README.md +0 -11
- package/build/common/constants/DateMode.js +7 -0
- package/build/common/constants/FormControlType.js +20 -0
- package/build/common/constants/MonthFormat.js +7 -0
- package/build/common/constants/SchemaType.js +14 -0
- package/build/common/constants/Size.js +10 -0
- package/build/common/constants/index.js +21 -0
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +41 -0
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +17 -0
- package/build/common/contexts/eventsContext/EventsContext.js +39 -0
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +42 -0
- package/build/common/contexts/index.js +20 -0
- package/build/common/contexts/logContext/LogContext.js +45 -0
- package/build/common/hooks/index.js +23 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +13 -0
- package/build/common/hooks/useExternal/useExternal.js +19 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +73 -0
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +177 -0
- package/build/common/hooks/usePolling/usePolling.js +53 -0
- package/build/common/hooks/usePrevious/usePrevious.js +12 -0
- package/build/common/hooks/useStepPolling/useStepPolling.js +48 -0
- package/build/common/makeFetcher/index.js +17 -0
- package/build/common/makeFetcher/makeFetcher.js +37 -0
- package/build/common/messages.js +10 -0
- package/build/common/utils/api-utils.js +20 -0
- package/build/common/utils/date-utils.js +27 -0
- package/build/common/utils/debounce.js +42 -0
- package/build/common/utils/file-utils.js +51 -0
- package/build/common/utils/id-utils.js +9 -0
- package/build/common/utils/index.js +24 -0
- package/build/common/utils/is-equal.js +25 -0
- package/build/common/utils/schema-utils.js +55 -0
- package/build/common/utils/step-utils.js +47 -0
- package/build/common/validators/index.js +28 -0
- package/build/common/validators/models/model-validators.js +69 -0
- package/build/common/validators/models/models.utils.js +130 -0
- package/build/common/validators/schemas/schema-validators.js +101 -0
- package/build/common/validators/types/type-validators.js +25 -0
- package/build/common/validators/validationFailures/validation-failures.js +151 -0
- package/build/common/validators/validationFailures/validation-failures.utils.js +51 -0
- package/build/common/validators/values/value-validators.js +9 -0
- package/build/dynamicFlow/DynamicFlow.js +372 -0
- package/build/dynamicFlow/DynamicFlowStep.js +36 -0
- package/build/dynamicFlow/DynamicFlowTypes.js +8 -0
- package/build/dynamicFlow/index.js +16 -0
- package/build/dynamicFlow/stories/DynamicFlow.story.js +36 -0
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +67 -0
- package/build/dynamicFlow/stories/fixtureFetcher.js +118 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +47 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +15 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +19 -0
- package/build/dynamicFlow/utils/index.js +23 -0
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +131 -0
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +27 -0
- package/build/dynamicFlow/utils/useDynamicFlowState.js +114 -0
- package/build/dynamicFlow/utils/useLoader.js +26 -0
- package/build/fixtures/components/alert.js +33 -0
- package/build/fixtures/components/box.js +22 -0
- package/build/fixtures/components/button.js +67 -0
- package/build/fixtures/components/columns.js +38 -0
- package/build/fixtures/components/copyable.js +24 -0
- package/build/fixtures/components/decision.js +56 -0
- package/build/fixtures/components/heading.js +16 -0
- package/build/fixtures/components/image.js +25 -0
- package/build/fixtures/components/index.js +40 -0
- package/build/fixtures/components/info.js +19 -0
- package/build/fixtures/components/list.js +36 -0
- package/build/fixtures/components/loading-indicator.js +18 -0
- package/build/fixtures/components/paragraph.js +30 -0
- package/build/fixtures/components/review.js +62 -0
- package/build/fixtures/examples/camera-capture.js +123 -0
- package/build/fixtures/examples/index.js +24 -0
- package/build/fixtures/examples/recipient-update.js +252 -0
- package/build/fixtures/examples/recipient.js +315 -0
- package/build/fixtures/examples/single-file-upload.js +100 -0
- package/build/fixtures/examples/step-validation-errors.js +77 -0
- package/build/fixtures/features/action-response.js +31 -0
- package/build/fixtures/features/external.js +33 -0
- package/build/fixtures/features/index.js +24 -0
- package/build/fixtures/features/persist-async.js +46 -0
- package/build/fixtures/features/polling.js +35 -0
- package/build/fixtures/features/validation-async.js +40 -0
- package/build/fixtures/index.js +49 -0
- package/build/fixtures/jsonSchemaForm/allOf.js +121 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.js +1106 -0
- package/build/fixtures/jsonSchemaForm/currency.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/currency.js +50 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +39 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +38 -0
- package/build/fixtures/jsonSchemaForm/oneOf.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/oneOf.js +121 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +55 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +58 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +104 -0
- package/build/fixtures/jsonSchemaForm/simple.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/simple.js +50 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +73 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.js +25 -0
- package/build/fixtures/layouts/all.js +178 -0
- package/build/fixtures/layouts/final-step-layout.js +41 -0
- package/build/fixtures/layouts/index.js +26 -0
- package/build/fixtures/layouts/list.js +35 -0
- package/build/fixtures/layouts/pay-in.js +99 -0
- package/build/fixtures/layouts/review.js +162 -0
- package/build/fixtures/layouts/success.js +68 -0
- package/build/fixtures/responses/action-response-final.js +26 -0
- package/build/fixtures/responses/action.js +4 -0
- package/build/fixtures/responses/exit.js +4 -0
- package/build/fixtures/responses/index.js +22 -0
- package/build/fixtures/responses/recipient-update-final.js +26 -0
- package/build/fixtures/schemas/basic-form.js +41 -0
- package/build/fixtures/schemas/index.js +22 -0
- package/build/fixtures/schemas/number-and-integer.js +43 -0
- package/build/fixtures/schemas/one-of.js +225 -0
- package/build/fixtures/schemas/string-formats.js +64 -0
- package/build/fixtures/utils/image-util.js +22 -0
- package/build/formControl/FormControl.js +243 -0
- package/build/formControl/index.js +16 -0
- package/build/formControl/utils/index.js +17 -0
- package/build/formControl/utils/value-utils.js +116 -0
- package/build/i18n/index.js +36 -0
- package/build/index.d.ts +11 -0
- package/build/index.js +35 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +34 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +59 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +30 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +31 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +145 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +20 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +90 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +21 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +16 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +108 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +16 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +84 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +55 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +16 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +127 -0
- package/build/jsonSchemaForm/genericSchema/index.js +16 -0
- package/build/jsonSchemaForm/help/Help.js +14 -0
- package/build/jsonSchemaForm/help/Help.messages.js +10 -0
- package/build/jsonSchemaForm/help/index.js +16 -0
- package/build/jsonSchemaForm/index.js +16 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +83 -0
- package/build/jsonSchemaForm/objectSchema/index.js +16 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +13 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +18 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +70 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +31 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +10 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +173 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +36 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +16 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +77 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +12 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +29 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +36 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +34 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +60 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +15 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +16 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +111 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +16 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +77 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +17 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +127 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +151 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +16 -0
- package/build/layout/DynamicLayout.js +63 -0
- package/build/layout/alert/DynamicAlert.js +31 -0
- package/build/layout/box/DynamicBox.js +43 -0
- package/build/layout/button/DynamicButton.js +60 -0
- package/build/layout/columns/DynamicColumns.js +40 -0
- package/build/layout/decision/DynamicDecision.js +40 -0
- package/build/layout/divider/DynamicDivider.js +11 -0
- package/build/layout/external/DynamicExternal.js +37 -0
- package/build/layout/external/DynamicExternal.messages.js +10 -0
- package/build/layout/form/DynamicForm.js +27 -0
- package/build/layout/heading/DynamicHeading.js +33 -0
- package/build/layout/icon/DynamicIcon.js +50 -0
- package/build/layout/image/DynamicImage.js +112 -0
- package/build/layout/index.js +48 -0
- package/build/layout/info/DynamicInfo.js +21 -0
- package/build/layout/list/DynamicList.js +33 -0
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +13 -0
- package/build/layout/paragraph/DynamicParagraph.js +48 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +15 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +13 -0
- package/build/layout/review/DynamicReview.js +35 -0
- package/build/layout/utils.js +35 -0
- package/build/step/cameraStep/CameraStep.js +130 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +127 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +20 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +36 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +84 -0
- package/build/step/cameraStep/cameraCapture/index.js +16 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +80 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +24 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +15 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +26 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +20 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +18 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +104 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +114 -0
- package/build/step/cameraStep/index.js +16 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +69 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +25 -0
- package/build/step/externalConfirmationStep/index.js +16 -0
- package/build/step/index.js +20 -0
- package/build/step/layoutStep/LayoutStep.js +35 -0
- package/build/step/layoutStep/index.js +16 -0
- package/build/step/layoutStep/utils/index.js +18 -0
- package/build/step/layoutStep/utils/inline-reference-utils.js +95 -0
- package/build/step/layoutStep/utils/layout-utils.js +222 -0
- package/build/types/common/FormControl.js +2 -0
- package/build/types/index.d.ts +15 -10
- package/build/types/index.js +42 -0
- package/build/types/specification/Action.js +2 -0
- package/build/types/specification/FileUploadSchema.js +8 -0
- package/build/types/specification/LayoutComponent.js +2 -0
- package/build/types/specification/Model.js +38 -0
- package/build/types/specification/PersistAsync.js +2 -0
- package/build/types/specification/Polling.js +2 -0
- package/build/types/specification/Promotion.js +2 -0
- package/build/types/specification/Schema.js +67 -0
- package/build/types/specification/Step.js +8 -0
- package/build/types/specification/ValidationAsync.js +2 -0
- package/build/types/specification/core.js +2 -0
- package/package.json +24 -26
- package/build/main.cjs.js +0 -6980
- package/build/main.cjs.min.js +0 -10
- package/build/main.esm.js +0 -6993
- package/build/main.esm.min.js +0 -10
- package/build/main.js +0 -6970
- package/build/main.min.js +0 -10
- package/build/types/types/index.d.ts +0 -15
- /package/build/{types/common → common}/constants/DateMode.d.ts +0 -0
- /package/build/{types/common → common}/constants/FormControlType.d.ts +0 -0
- /package/build/{types/common → common}/constants/MonthFormat.d.ts +0 -0
- /package/build/{types/common → common}/constants/SchemaType.d.ts +0 -0
- /package/build/{types/common → common}/constants/Size.d.ts +0 -0
- /package/build/{types/common → common}/constants/index.d.ts +0 -0
- /package/build/{types/common → common}/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +0 -0
- /package/build/{types/common → common}/contexts/dynamicFlowContexts/usePendingPromiseCounter.d.ts +0 -0
- /package/build/{types/common → common}/contexts/eventsContext/EventsContext.d.ts +0 -0
- /package/build/{types/common → common}/contexts/fetcherContexts/FetcherContexts.d.ts +0 -0
- /package/build/{types/common → common}/contexts/index.d.ts +0 -0
- /package/build/{types/common → common}/contexts/logContext/LogContext.d.ts +0 -0
- /package/build/{types/common → common}/hooks/index.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useExternal/useExternal.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePersistAsync/usePersistAsync.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePolling/usePolling.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePrevious/usePrevious.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useStepPolling/useStepPolling.d.ts +0 -0
- /package/build/{types/common → common}/makeFetcher/index.d.ts +0 -0
- /package/build/{types/common → common}/makeFetcher/makeFetcher.d.ts +0 -0
- /package/build/{types/common → common}/messages.d.ts +0 -0
- /package/build/{types/common → common}/utils/api-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/date-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/debounce.d.ts +0 -0
- /package/build/{types/common → common}/utils/file-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/id-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/index.d.ts +0 -0
- /package/build/{types/common → common}/utils/is-equal.d.ts +0 -0
- /package/build/{types/common → common}/utils/schema-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/step-utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/index.d.ts +0 -0
- /package/build/{types/common → common}/validators/models/model-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/models/models.utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/schemas/schema-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/types/type-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/validationFailures/validation-failures.d.ts +0 -0
- /package/build/{types/common → common}/validators/validationFailures/validation-failures.utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/values/value-validators.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlow.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowStep.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowTypes.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/index.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/fixtureFetcher.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/index.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/responseParsers/response-parsers.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDynamicFlowState.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useLoader.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/alert.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/box.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/button.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/columns.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/copyable.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/decision.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/heading.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/image.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/info.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/list.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/loading-indicator.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/paragraph.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/review.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/camera-capture.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/recipient-update.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/recipient.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/single-file-upload.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/step-validation-errors.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/action-response.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/external.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/persist-async.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/polling.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/validation-async.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/allOf.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/all.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/final-step-layout.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/list.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/pay-in.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/review.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/success.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/action-response-final.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/action.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/exit.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/recipient-update-final.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/basic-form.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/number-and-integer.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/one-of.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/string-formats.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/utils/image-util.d.ts +0 -0
- /package/build/{types/formControl → formControl}/FormControl.d.ts +0 -0
- /package/build/{types/formControl → formControl}/index.d.ts +0 -0
- /package/build/{types/formControl → formControl}/utils/index.d.ts +0 -0
- /package/build/{types/formControl → formControl}/utils/value-utils.d.ts +0 -0
- /package/build/{types/i18n → i18n}/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/JsonSchemaForm.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/AllOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/ArraySchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/BasicTypeSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/GenericSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/ObjectSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/OneOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/const-schema-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/one-of-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promoted-one-of-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/SchemaFormControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/currency-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/mapping-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/index.d.ts +0 -0
- /package/build/{types/layout → layout}/DynamicLayout.d.ts +0 -0
- /package/build/{types/layout → layout}/alert/DynamicAlert.d.ts +0 -0
- /package/build/{types/layout → layout}/box/DynamicBox.d.ts +0 -0
- /package/build/{types/layout → layout}/button/DynamicButton.d.ts +0 -0
- /package/build/{types/layout → layout}/columns/DynamicColumns.d.ts +0 -0
- /package/build/{types/layout → layout}/decision/DynamicDecision.d.ts +0 -0
- /package/build/{types/layout → layout}/divider/DynamicDivider.d.ts +0 -0
- /package/build/{types/layout → layout}/external/DynamicExternal.d.ts +0 -0
- /package/build/{types/layout → layout}/external/DynamicExternal.messages.d.ts +0 -0
- /package/build/{types/layout → layout}/form/DynamicForm.d.ts +0 -0
- /package/build/{types/layout → layout}/heading/DynamicHeading.d.ts +0 -0
- /package/build/{types/layout → layout}/icon/DynamicIcon.d.ts +0 -0
- /package/build/{types/layout → layout}/image/DynamicImage.d.ts +0 -0
- /package/build/{types/layout → layout}/index.d.ts +0 -0
- /package/build/{types/layout → layout}/info/DynamicInfo.d.ts +0 -0
- /package/build/{types/layout → layout}/list/DynamicList.d.ts +0 -0
- /package/build/{types/layout → layout}/loadingIndicator/DynamicLoadingIndicator.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/DynamicParagraph.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/DynamicParagraph.messages.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/useSnackBarIfAvailable.d.ts +0 -0
- /package/build/{types/layout → layout}/review/DynamicReview.d.ts +0 -0
- /package/build/{types/layout → layout}/utils.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/CameraStep.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/components/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/hooks/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/tracking/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/utils/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/index.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/index.d.ts +0 -0
- /package/build/{types/step → step}/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/LayoutStep.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/inline-reference-utils.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/layout-utils.d.ts +0 -0
- /package/build/types/{types/common → common}/FormControl.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Action.d.ts +0 -0
- /package/build/types/{types/specification → specification}/FileUploadSchema.d.ts +0 -0
- /package/build/types/{types/specification → specification}/LayoutComponent.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Model.d.ts +0 -0
- /package/build/types/{types/specification → specification}/PersistAsync.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Polling.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Promotion.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Schema.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Step.d.ts +0 -0
- /package/build/types/{types/specification → specification}/ValidationAsync.d.ts +0 -0
- /package/build/types/{types/specification → specification}/core.d.ts +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
exports.__esModule = true;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var ErrorBoundaryAlert_1 = require("./ErrorBoundaryAlert");
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
22
|
+
var noop = function () { };
|
|
23
|
+
var ErrorBoundary = /** @class */ (function (_super) {
|
|
24
|
+
__extends(ErrorBoundary, _super);
|
|
25
|
+
function ErrorBoundary(props) {
|
|
26
|
+
var _this = _super.call(this, props) || this;
|
|
27
|
+
_this.handleErrorReset = function () {
|
|
28
|
+
_this.setState({ hasError: false, isFatalError: false });
|
|
29
|
+
};
|
|
30
|
+
_this.state = { hasError: false, isFatalError: false };
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
ErrorBoundary.getDerivedStateFromError = function () {
|
|
34
|
+
return { hasError: true, isFatalError: true };
|
|
35
|
+
};
|
|
36
|
+
ErrorBoundary.prototype.componentDidCatch = function (error) {
|
|
37
|
+
var _a = this.props.onError, onError = _a === void 0 ? noop : _a;
|
|
38
|
+
onError(error);
|
|
39
|
+
};
|
|
40
|
+
ErrorBoundary.prototype.render = function () {
|
|
41
|
+
var children = this.props.children;
|
|
42
|
+
var _a = this.state, hasError = _a.hasError, isFatalError = _a.isFatalError;
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasError && (0, jsx_runtime_1.jsx)(ErrorBoundaryAlert_1.ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }), !isFatalError && children] }));
|
|
44
|
+
};
|
|
45
|
+
return ErrorBoundary;
|
|
46
|
+
}(react_1.Component));
|
|
47
|
+
exports["default"] = ErrorBoundary;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var react_intl_1 = require("react-intl");
|
|
4
|
+
exports["default"] = (0, react_intl_1.defineMessages)({
|
|
5
|
+
errorAlert: {
|
|
6
|
+
id: 'dynamicFlows.ErrorBoundary.errorAlert',
|
|
7
|
+
defaultMessage: 'Oops. Something went wrong...',
|
|
8
|
+
description: 'Generic error message for when something has gone wrong'
|
|
9
|
+
},
|
|
10
|
+
retry: {
|
|
11
|
+
id: 'dynamicFlows.ErrorBoundary.retry',
|
|
12
|
+
defaultMessage: 'Retry',
|
|
13
|
+
description: 'Retry'
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.ErrorBoundaryAlert = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var components_1 = require("@transferwise/components");
|
|
9
|
+
var react_intl_1 = require("react-intl");
|
|
10
|
+
var ErrorBoundary_messages_1 = __importDefault(require("./ErrorBoundary.messages"));
|
|
11
|
+
var ErrorBoundaryAlert = function (_a) {
|
|
12
|
+
var onDismiss = _a.onDismiss;
|
|
13
|
+
var formatMessage = (0, react_intl_1.useIntl)().formatMessage;
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Alert, { action: {
|
|
15
|
+
text: formatMessage(ErrorBoundary_messages_1["default"].retry),
|
|
16
|
+
href: window.location.href
|
|
17
|
+
}, message: formatMessage(ErrorBoundary_messages_1["default"].errorAlert), type: components_1.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: onDismiss }));
|
|
18
|
+
};
|
|
19
|
+
exports.ErrorBoundaryAlert = ErrorBoundaryAlert;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
exports.ErrorBoundary = void 0;
|
|
18
|
+
__exportStar(require("./useDebouncedRefresh/useDebouncedRefresh"), exports);
|
|
19
|
+
__exportStar(require("./useDynamicFlowState"), exports);
|
|
20
|
+
__exportStar(require("./useLoader"), exports);
|
|
21
|
+
var ErrorBoundary_1 = require("./errorBoundary/ErrorBoundary");
|
|
22
|
+
__createBinding(exports, ErrorBoundary_1, "default", "ErrorBoundary");
|
|
23
|
+
__exportStar(require("./responseParsers/response-parsers"), exports);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.parseExitResponse = exports.parseErrorResponse = exports.parseFetchResponse = void 0;
|
|
40
|
+
var validators_1 = require("../../../common/validators");
|
|
41
|
+
var parseFetchResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var jsonBody, action, etag;
|
|
43
|
+
var _a;
|
|
44
|
+
var _b;
|
|
45
|
+
return __generator(this, function (_c) {
|
|
46
|
+
switch (_c.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
assertResponseIsValid(response);
|
|
49
|
+
if (!((_b = response.headers) === null || _b === void 0 ? void 0 : _b.has('X-Df-Exit'))) return [3 /*break*/, 2];
|
|
50
|
+
_a = { type: 'exit' };
|
|
51
|
+
return [4 /*yield*/, (0, exports.parseExitResponse)(response)];
|
|
52
|
+
case 1: return [2 /*return*/, (_a.result = _c.sent(), _a)];
|
|
53
|
+
case 2: return [4 /*yield*/, parseResponseJson(response)];
|
|
54
|
+
case 3:
|
|
55
|
+
jsonBody = _c.sent();
|
|
56
|
+
if (!(0, validators_1.isObject)(jsonBody)) {
|
|
57
|
+
throw new Error('Incorrect response body in response. Expected an object.');
|
|
58
|
+
}
|
|
59
|
+
if (jsonBody.action) {
|
|
60
|
+
if (!(0, validators_1.isObject)(jsonBody.action)) {
|
|
61
|
+
throw new Error('Incorrect response body in action response. Expected an object satisfying the type { action: Action }.');
|
|
62
|
+
}
|
|
63
|
+
action = jsonBody.action;
|
|
64
|
+
if (action.exit === true && (0, validators_1.isObject)(action.result)) {
|
|
65
|
+
return [2 /*return*/, { type: 'exit', result: action.result }];
|
|
66
|
+
}
|
|
67
|
+
return [2 /*return*/, { type: 'action', action: jsonBody.action }];
|
|
68
|
+
}
|
|
69
|
+
etag = response.headers.get('etag') || undefined;
|
|
70
|
+
return [2 /*return*/, { type: 'step', step: jsonBody, etag: etag }];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}); };
|
|
74
|
+
exports.parseFetchResponse = parseFetchResponse;
|
|
75
|
+
var parseErrorResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
|
+
var jsonBody;
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
switch (_a.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
assertResponseIsValid(response);
|
|
81
|
+
return [4 /*yield*/, parseResponseJson(response)];
|
|
82
|
+
case 1:
|
|
83
|
+
jsonBody = _a.sent();
|
|
84
|
+
if (!(0, validators_1.isObject)(jsonBody)) {
|
|
85
|
+
throw new Error('Incorrect response body in error response. Expected an object.');
|
|
86
|
+
}
|
|
87
|
+
return [2 /*return*/, jsonBody];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}); };
|
|
91
|
+
exports.parseErrorResponse = parseErrorResponse;
|
|
92
|
+
var parseExitResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var result;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
assertResponseIsValid(response);
|
|
98
|
+
return [4 /*yield*/, parseResponseJson(response)];
|
|
99
|
+
case 1:
|
|
100
|
+
result = _a.sent();
|
|
101
|
+
if ((0, validators_1.isObject)(result) || result === null) {
|
|
102
|
+
return [2 /*return*/, result];
|
|
103
|
+
}
|
|
104
|
+
return [2 /*return*/, null];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}); };
|
|
108
|
+
exports.parseExitResponse = parseExitResponse;
|
|
109
|
+
var parseResponseJson = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var _a;
|
|
111
|
+
return __generator(this, function (_b) {
|
|
112
|
+
switch (_b.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
_b.trys.push([0, 2, , 3]);
|
|
115
|
+
return [4 /*yield*/, response.json()];
|
|
116
|
+
case 1: return [2 /*return*/, (_b.sent())];
|
|
117
|
+
case 2:
|
|
118
|
+
_a = _b.sent();
|
|
119
|
+
return [2 /*return*/, null];
|
|
120
|
+
case 3: return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); };
|
|
124
|
+
var assertResponseIsValid = function (response) {
|
|
125
|
+
if (!(response instanceof Response)) {
|
|
126
|
+
throw new Error('Incorrect type of response from fetch. Expected object of type Response.');
|
|
127
|
+
}
|
|
128
|
+
if (response.bodyUsed) {
|
|
129
|
+
throw new Error('The body of the provided Response object has already been used. Every request must respond with a new Response object.');
|
|
130
|
+
}
|
|
131
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.useDebouncedRefresh = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var utils_1 = require("../../../common/utils");
|
|
6
|
+
var DEBOUNCE_DELAY = 1000; // milliseconds
|
|
7
|
+
function useDebouncedRefresh(fetchRefresh) {
|
|
8
|
+
var map = (0, react_1.useRef)(new Map());
|
|
9
|
+
var retrieveOrCreate = function (key) {
|
|
10
|
+
if (map.current.has(key)) {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
|
+
return map.current.get(key);
|
|
13
|
+
}
|
|
14
|
+
var debouncedFetchRefresh = (0, utils_1.debounce)(function (action, data, etag) { return fetchRefresh(action, data, etag); }, DEBOUNCE_DELAY);
|
|
15
|
+
map.current.set(key, debouncedFetchRefresh);
|
|
16
|
+
return debouncedFetchRefresh;
|
|
17
|
+
};
|
|
18
|
+
return function (action, data, etag, schema) {
|
|
19
|
+
var key = action.url || '';
|
|
20
|
+
var debouncedFetchRefresh = retrieveOrCreate(key);
|
|
21
|
+
void debouncedFetchRefresh(action, data, etag);
|
|
22
|
+
if (!schema || !(0, utils_1.shouldDebounceSchema)(schema)) {
|
|
23
|
+
void debouncedFetchRefresh.flush();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.useDebouncedRefresh = useDebouncedRefresh;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.useDynamicFlowState = void 0;
|
|
24
|
+
var react_1 = require("react");
|
|
25
|
+
var validators_1 = require("../../common/validators");
|
|
26
|
+
var DynamicFlowTypes_1 = require("../DynamicFlowTypes");
|
|
27
|
+
var useDynamicFlowState = function (initialStep) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
var _c = (0, react_1.useState)((_a = initialStep === null || initialStep === void 0 ? void 0 : initialStep.errors) === null || _a === void 0 ? void 0 : _a.validation), formErrors = _c[0], setFormErrors = _c[1];
|
|
30
|
+
var _d = (0, react_1.useState)((_b = initialStep === null || initialStep === void 0 ? void 0 : initialStep.errors) === null || _b === void 0 ? void 0 : _b.error), globalError = _d[0], setGlobalError = _d[1];
|
|
31
|
+
var _e = (0, react_1.useState)({
|
|
32
|
+
step: initialStep || undefined,
|
|
33
|
+
models: (initialStep === null || initialStep === void 0 ? void 0 : initialStep.model)
|
|
34
|
+
? buildInitialModels(initialStep.model, getAllSchemas(initialStep))
|
|
35
|
+
: {},
|
|
36
|
+
etag: undefined
|
|
37
|
+
}), stepAndModels = _e[0], setStepAndModels = _e[1];
|
|
38
|
+
var step = stepAndModels.step, models = stepAndModels.models, etag = stepAndModels.etag;
|
|
39
|
+
var setStepAndEtag = function (step, etag) {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
setStepAndModels(function (previous) { return ({
|
|
42
|
+
step: step,
|
|
43
|
+
models: step.model ? buildInitialModels(step.model, getAllSchemas(step)) : previous.models,
|
|
44
|
+
etag: etag
|
|
45
|
+
}); });
|
|
46
|
+
setFormErrors((_b = (_a = step === null || step === void 0 ? void 0 : step.errors) === null || _a === void 0 ? void 0 : _a.validation) !== null && _b !== void 0 ? _b : null);
|
|
47
|
+
setGlobalError((_d = (_c = step === null || step === void 0 ? void 0 : step.errors) === null || _c === void 0 ? void 0 : _c.error) !== null && _d !== void 0 ? _d : null);
|
|
48
|
+
};
|
|
49
|
+
var setSchemaModel = function (schemaId, objectModel, onModelsUpdated) {
|
|
50
|
+
setStepAndModels(function (previous) {
|
|
51
|
+
var _a;
|
|
52
|
+
var updatedModels = __assign(__assign({}, previous.models), (_a = {}, _a[schemaId] = objectModel, _a));
|
|
53
|
+
var updatedState = {
|
|
54
|
+
step: previous.step,
|
|
55
|
+
models: updatedModels,
|
|
56
|
+
etag: previous.etag
|
|
57
|
+
};
|
|
58
|
+
onModelsUpdated(updatedModels);
|
|
59
|
+
return updatedState;
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var modelIsValid = (0, react_1.useMemo)(function () { return areModelsValid(models, getAllSchemas(step)); }, [models, step]);
|
|
63
|
+
return {
|
|
64
|
+
formErrors: formErrors,
|
|
65
|
+
globalError: globalError,
|
|
66
|
+
step: step,
|
|
67
|
+
models: models,
|
|
68
|
+
etag: etag,
|
|
69
|
+
modelIsValid: modelIsValid,
|
|
70
|
+
setFormErrors: setFormErrors,
|
|
71
|
+
setGlobalError: setGlobalError,
|
|
72
|
+
setStepAndEtag: setStepAndEtag,
|
|
73
|
+
setSchemaModel: setSchemaModel
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
exports.useDynamicFlowState = useDynamicFlowState;
|
|
77
|
+
var buildInitialModels = function (model, schemas) {
|
|
78
|
+
if (schemas === void 0) { schemas = []; }
|
|
79
|
+
return schemas.reduce(function (acc, schema) {
|
|
80
|
+
var _a;
|
|
81
|
+
if (!schema.$id) {
|
|
82
|
+
// TODO: MC-3224
|
|
83
|
+
// eslint-disable-next-line no-console
|
|
84
|
+
console.warn('Schema without $id property found.');
|
|
85
|
+
}
|
|
86
|
+
return __assign(__assign({}, acc), (_a = {}, _a[schema.$id || ''] = (0, validators_1.getValidObjectModelParts)(model, schema) || {}, _a));
|
|
87
|
+
}, {});
|
|
88
|
+
};
|
|
89
|
+
var getAllSchemas = function (step) { return __spreadArray(__spreadArray([], getAllSchemasInLayout((step === null || step === void 0 ? void 0 : step.layout) || []), true), ((step === null || step === void 0 ? void 0 : step.schemas) || []), true); };
|
|
90
|
+
var getAllSchemasInLayout = function (components) {
|
|
91
|
+
return components.flatMap(function (component) {
|
|
92
|
+
switch (component.type) {
|
|
93
|
+
case 'columns':
|
|
94
|
+
return __spreadArray([], getAllSchemasInLayout(__spreadArray(__spreadArray([], component.left, true), component.right, true)), true);
|
|
95
|
+
case 'box':
|
|
96
|
+
return getAllSchemasInLayout(component.components);
|
|
97
|
+
case 'form':
|
|
98
|
+
return (0, DynamicFlowTypes_1.isSchema)(component.schema) ? [component.schema] : [];
|
|
99
|
+
default:
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var areModelsValid = function (formModels, schemas) {
|
|
105
|
+
if (schemas === void 0) { schemas = []; }
|
|
106
|
+
return !(schemas === null || schemas === void 0 ? void 0 : schemas.some(function (schema) {
|
|
107
|
+
if (!schema.$id) {
|
|
108
|
+
// TODO: MC-3224
|
|
109
|
+
// eslint-disable-next-line no-console
|
|
110
|
+
console.warn('Schema without $id property found.');
|
|
111
|
+
}
|
|
112
|
+
return !(0, validators_1.isValidSchema)(formModels[schema.$id || ''] || {}, schema);
|
|
113
|
+
}));
|
|
114
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
exports.__esModule = true;
|
|
14
|
+
exports.useLoader = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var components_1 = require("@transferwise/components");
|
|
17
|
+
var react_1 = require("react");
|
|
18
|
+
function useLoader(loaderConfig, initialState) {
|
|
19
|
+
var config = __assign({ size: components_1.Size.EXTRA_LARGE, initial: true, submission: false }, loaderConfig);
|
|
20
|
+
var _a = (0, react_1.useState)(initialState), loadingState = _a[0], setLoadingState = _a[1];
|
|
21
|
+
var shouldDisplayLoader = (config.initial && loadingState === 'initial') ||
|
|
22
|
+
(config.submission && loadingState === 'submission');
|
|
23
|
+
var loader = shouldDisplayLoader ? ((0, jsx_runtime_1.jsx)(components_1.Loader, { size: config.size, classNames: { 'tw-loader': 'tw-loader m-x-auto' }, "data-testid": "loader" })) : null;
|
|
24
|
+
return { loadingState: loadingState, setLoadingState: setLoadingState, loader: loader };
|
|
25
|
+
}
|
|
26
|
+
exports.useLoader = useLoader;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var step = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
key: 'Components/Alert',
|
|
6
|
+
title: 'Alert Component',
|
|
7
|
+
description: 'Alerts can have different contexts.',
|
|
8
|
+
actions: [],
|
|
9
|
+
schemas: [],
|
|
10
|
+
layout: [
|
|
11
|
+
{
|
|
12
|
+
type: 'alert',
|
|
13
|
+
markdown: 'This is an alert with "neutral" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.',
|
|
14
|
+
context: 'neutral'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'alert',
|
|
18
|
+
markdown: 'This is an alert with "warning" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.',
|
|
19
|
+
context: 'warning'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'alert',
|
|
23
|
+
markdown: 'This is an alert with "positive" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.',
|
|
24
|
+
context: 'positive'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: 'alert',
|
|
28
|
+
markdown: 'This is an alert with "negative" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.',
|
|
29
|
+
context: 'negative'
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
exports["default"] = step;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var step = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
key: 'Components/Box',
|
|
6
|
+
title: 'Box Component',
|
|
7
|
+
description: 'Box is a container for other layour components. It can have a border!',
|
|
8
|
+
actions: [],
|
|
9
|
+
schemas: [],
|
|
10
|
+
layout: ['xs', 'sm', 'md', 'lg', 'xl'].map(function (size) { return ({
|
|
11
|
+
type: 'box',
|
|
12
|
+
width: size,
|
|
13
|
+
border: true,
|
|
14
|
+
components: [
|
|
15
|
+
{
|
|
16
|
+
type: 'paragraph',
|
|
17
|
+
text: "This paragraph is inside a box with border: \"true\" and width: \"".concat(size, "\".")
|
|
18
|
+
},
|
|
19
|
+
]
|
|
20
|
+
}); })
|
|
21
|
+
};
|
|
22
|
+
exports["default"] = step;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
exports.__esModule = true;
|
|
12
|
+
var buttons = ['primary', 'secondary', 'negative', 'link'].map(function (type, i) {
|
|
13
|
+
return ({
|
|
14
|
+
type: 'button',
|
|
15
|
+
action: {
|
|
16
|
+
url: '/action-url',
|
|
17
|
+
method: 'POST',
|
|
18
|
+
title: "Button ".concat(i + 1, ", type: \"").concat(type, "\""),
|
|
19
|
+
type: type,
|
|
20
|
+
data: { 'button-number': i + 1 }
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
var step = {
|
|
25
|
+
type: 'form',
|
|
26
|
+
key: 'Components/Button',
|
|
27
|
+
title: 'Button Component',
|
|
28
|
+
description: 'Buttons typically trigger actions.',
|
|
29
|
+
actions: [],
|
|
30
|
+
schemas: [
|
|
31
|
+
{
|
|
32
|
+
$id: '#schema',
|
|
33
|
+
type: 'object',
|
|
34
|
+
displayOrder: [],
|
|
35
|
+
properties: {
|
|
36
|
+
'form-field': {
|
|
37
|
+
type: 'string',
|
|
38
|
+
"default": 'Some text',
|
|
39
|
+
title: 'Enter any text. It will be submitted under "form-field".'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
layout: [
|
|
45
|
+
{
|
|
46
|
+
type: 'box',
|
|
47
|
+
width: 'md',
|
|
48
|
+
components: __spreadArray(__spreadArray([
|
|
49
|
+
{
|
|
50
|
+
type: 'paragraph',
|
|
51
|
+
text: 'Action buttons merge the form data with their own action.data before submitting it to the specified URL.'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'form',
|
|
55
|
+
schema: { $ref: '#schema' }
|
|
56
|
+
}
|
|
57
|
+
], buttons, true), [
|
|
58
|
+
{
|
|
59
|
+
type: 'paragraph',
|
|
60
|
+
text: 'Press any buttons and see the fetcher calls below.',
|
|
61
|
+
align: 'center'
|
|
62
|
+
},
|
|
63
|
+
], false)
|
|
64
|
+
},
|
|
65
|
+
]
|
|
66
|
+
};
|
|
67
|
+
exports["default"] = step;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var step = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
key: 'Components/Columns',
|
|
6
|
+
title: 'Columns Component',
|
|
7
|
+
description: "Arrange components in two columns (when there's enough space)",
|
|
8
|
+
actions: [],
|
|
9
|
+
schemas: [],
|
|
10
|
+
layout: [
|
|
11
|
+
{
|
|
12
|
+
type: 'columns',
|
|
13
|
+
left: [
|
|
14
|
+
{
|
|
15
|
+
type: 'button',
|
|
16
|
+
action: {
|
|
17
|
+
title: 'Save',
|
|
18
|
+
type: 'primary',
|
|
19
|
+
exit: true,
|
|
20
|
+
result: { side: 'left' }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
right: [
|
|
25
|
+
{
|
|
26
|
+
type: 'button',
|
|
27
|
+
action: {
|
|
28
|
+
title: 'Delete',
|
|
29
|
+
type: 'negative',
|
|
30
|
+
exit: true,
|
|
31
|
+
result: { side: 'right' }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
exports["default"] = step;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var step = {
|
|
4
|
+
key: 'Components/Copyable',
|
|
5
|
+
type: 'form',
|
|
6
|
+
title: 'Copyable Text',
|
|
7
|
+
description: 'Copyable Text Component.',
|
|
8
|
+
actions: [],
|
|
9
|
+
layout: [
|
|
10
|
+
{
|
|
11
|
+
type: 'paragraph',
|
|
12
|
+
align: 'center',
|
|
13
|
+
text: 'Please copy the code below and use it in that other thing.'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'paragraph',
|
|
17
|
+
text: '7Xtiq6fnX9aEVF7yZAmb2qyqS857ro8S',
|
|
18
|
+
align: 'center',
|
|
19
|
+
control: 'copyable'
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
schemas: []
|
|
23
|
+
};
|
|
24
|
+
exports["default"] = step;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var step = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
key: 'Components/Decision',
|
|
6
|
+
title: 'Decision Component',
|
|
7
|
+
description: 'A step with a decision Component.',
|
|
8
|
+
actions: [],
|
|
9
|
+
schemas: [],
|
|
10
|
+
layout: [
|
|
11
|
+
{
|
|
12
|
+
type: 'heading',
|
|
13
|
+
size: 'sm',
|
|
14
|
+
text: 'Please continue using one of the following options:'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'decision',
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
title: 'Create a new recipient',
|
|
21
|
+
description: 'You will need their bank details to hand',
|
|
22
|
+
icon: {
|
|
23
|
+
name: 'plus'
|
|
24
|
+
},
|
|
25
|
+
action: {
|
|
26
|
+
title: '',
|
|
27
|
+
url: 'recipient'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'Choose an existing recipient',
|
|
32
|
+
disabled: false,
|
|
33
|
+
icon: {
|
|
34
|
+
name: 'bank'
|
|
35
|
+
},
|
|
36
|
+
action: {
|
|
37
|
+
title: '',
|
|
38
|
+
url: 'review'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: 'Show me the external step',
|
|
43
|
+
disabled: false,
|
|
44
|
+
icon: {
|
|
45
|
+
name: 'bulb'
|
|
46
|
+
},
|
|
47
|
+
action: {
|
|
48
|
+
title: '',
|
|
49
|
+
url: 'external'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
exports["default"] = step;
|