@wise/dynamic-flow-client 0.4.2 → 0.4.4
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/build/main.js +9606 -0
- package/build/main.min.js +31 -0
- package/build/types/index.d.ts +11 -15
- package/build/types/types/index.d.ts +15 -0
- package/package.json +7 -6
- package/build/common/constants/DateMode.js +0 -7
- package/build/common/constants/FormControlType.js +0 -20
- package/build/common/constants/MonthFormat.js +0 -7
- package/build/common/constants/SchemaType.js +0 -14
- package/build/common/constants/Size.js +0 -10
- package/build/common/constants/index.js +0 -21
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +0 -29
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +0 -19
- package/build/common/contexts/eventsContext/EventsContext.js +0 -22
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +0 -29
- package/build/common/contexts/index.js +0 -20
- package/build/common/contexts/logContext/LogContext.js +0 -27
- package/build/common/hooks/index.js +0 -23
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +0 -13
- package/build/common/hooks/useExternal/useExternal.js +0 -19
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +0 -62
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +0 -98
- package/build/common/hooks/usePolling/usePolling.js +0 -52
- package/build/common/hooks/usePrevious/usePrevious.js +0 -12
- package/build/common/hooks/useStepPolling/useStepPolling.js +0 -49
- package/build/common/makeFetcher/index.js +0 -17
- package/build/common/makeFetcher/makeFetcher.js +0 -23
- package/build/common/messages.js +0 -10
- package/build/common/utils/api-utils.js +0 -19
- package/build/common/utils/date-utils.js +0 -27
- package/build/common/utils/debounce.js +0 -38
- package/build/common/utils/file-utils.js +0 -38
- package/build/common/utils/id-utils.js +0 -8
- package/build/common/utils/index.js +0 -24
- package/build/common/utils/is-equal.js +0 -25
- package/build/common/utils/schema-utils.js +0 -55
- package/build/common/utils/step-utils.js +0 -47
- package/build/common/validators/index.js +0 -28
- package/build/common/validators/models/model-validators.js +0 -69
- package/build/common/validators/models/models.utils.js +0 -117
- package/build/common/validators/schemas/schema-validators.js +0 -99
- package/build/common/validators/types/type-validators.js +0 -21
- package/build/common/validators/validationFailures/validation-failures.js +0 -151
- package/build/common/validators/validationFailures/validation-failures.utils.js +0 -49
- package/build/common/validators/values/value-validators.js +0 -7
- package/build/dynamicFlow/DynamicFlow.js +0 -250
- package/build/dynamicFlow/DynamicFlowStep.js +0 -25
- package/build/dynamicFlow/DynamicFlowTypes.js +0 -8
- package/build/dynamicFlow/index.js +0 -8
- package/build/dynamicFlow/stories/DynamicFlow.story.js +0 -36
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +0 -54
- package/build/dynamicFlow/stories/fixtureFetcher.js +0 -60
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +0 -29
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +0 -15
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +0 -18
- package/build/dynamicFlow/utils/index.js +0 -26
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +0 -66
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +0 -27
- package/build/dynamicFlow/utils/useDynamicFlowState.js +0 -91
- package/build/dynamicFlow/utils/useLoader.js +0 -15
- package/build/fixtures/components/alert.js +0 -33
- package/build/fixtures/components/box.js +0 -22
- package/build/fixtures/components/button.js +0 -56
- package/build/fixtures/components/columns.js +0 -38
- package/build/fixtures/components/copyable.js +0 -24
- package/build/fixtures/components/decision.js +0 -56
- package/build/fixtures/components/heading.js +0 -16
- package/build/fixtures/components/image.js +0 -25
- package/build/fixtures/components/index.js +0 -32
- package/build/fixtures/components/info.js +0 -35
- package/build/fixtures/components/list.js +0 -36
- package/build/fixtures/components/loading-indicator.js +0 -18
- package/build/fixtures/components/paragraph.js +0 -30
- package/build/fixtures/components/review.js +0 -62
- package/build/fixtures/examples/camera-capture.js +0 -123
- package/build/fixtures/examples/index.js +0 -16
- package/build/fixtures/examples/recipient-update.js +0 -252
- package/build/fixtures/examples/recipient.js +0 -315
- package/build/fixtures/examples/single-file-upload.js +0 -100
- package/build/fixtures/examples/step-validation-errors.js +0 -77
- package/build/fixtures/features/action-response.js +0 -31
- package/build/fixtures/features/external.js +0 -33
- package/build/fixtures/features/index.js +0 -16
- package/build/fixtures/features/persist-async.js +0 -46
- package/build/fixtures/features/polling.js +0 -35
- package/build/fixtures/features/validation-async.js +0 -40
- package/build/fixtures/index.js +0 -38
- package/build/fixtures/jsonSchemaForm/allOf.js +0 -121
- package/build/fixtures/jsonSchemaForm/audRecipient.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/audRecipient.js +0 -1106
- package/build/fixtures/jsonSchemaForm/currency.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/currency.js +0 -50
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +0 -39
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +0 -38
- package/build/fixtures/jsonSchemaForm/oneOf.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/oneOf.js +0 -121
- package/build/fixtures/jsonSchemaForm/oneOfTabs.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +0 -55
- package/build/fixtures/jsonSchemaForm/promotedOneOf.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +0 -58
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +0 -104
- package/build/fixtures/jsonSchemaForm/simple.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/simple.js +0 -50
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +0 -73
- package/build/fixtures/jsonSchemaForm/validationAsync.d.ts +0 -3
- package/build/fixtures/jsonSchemaForm/validationAsync.js +0 -25
- package/build/fixtures/layouts/all.js +0 -178
- package/build/fixtures/layouts/final-step-layout.js +0 -41
- package/build/fixtures/layouts/index.js +0 -18
- package/build/fixtures/layouts/list.js +0 -35
- package/build/fixtures/layouts/pay-in.js +0 -99
- package/build/fixtures/layouts/review.js +0 -162
- package/build/fixtures/layouts/success.js +0 -68
- package/build/fixtures/responses/action-response-final.js +0 -26
- package/build/fixtures/responses/action.js +0 -4
- package/build/fixtures/responses/exit.js +0 -4
- package/build/fixtures/responses/index.js +0 -14
- package/build/fixtures/responses/recipient-update-final.js +0 -26
- package/build/fixtures/schemas/basic-form.js +0 -41
- package/build/fixtures/schemas/index.js +0 -14
- package/build/fixtures/schemas/number-and-integer.js +0 -43
- package/build/fixtures/schemas/one-of.js +0 -222
- package/build/fixtures/schemas/string-formats.js +0 -64
- package/build/fixtures/utils/image-util.js +0 -22
- package/build/formControl/FormControl.js +0 -213
- package/build/formControl/index.js +0 -8
- package/build/formControl/utils/index.js +0 -17
- package/build/formControl/utils/value-utils.js +0 -111
- package/build/i18n/index.js +0 -36
- package/build/index.d.ts +0 -11
- package/build/index.js +0 -38
- package/build/jsonSchemaForm/JsonSchemaForm.js +0 -22
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +0 -46
- package/build/jsonSchemaForm/allOfSchema/index.js +0 -8
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +0 -19
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +0 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +0 -8
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +0 -86
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +0 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +0 -8
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +0 -18
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +0 -38
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +0 -20
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +0 -8
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +0 -91
- package/build/jsonSchemaForm/basicTypeSchema/index.js +0 -8
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +0 -73
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +0 -55
- package/build/jsonSchemaForm/controlFeedback/index.js +0 -8
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +0 -118
- package/build/jsonSchemaForm/genericSchema/index.js +0 -8
- package/build/jsonSchemaForm/help/Help.js +0 -14
- package/build/jsonSchemaForm/help/Help.messages.js +0 -10
- package/build/jsonSchemaForm/help/index.js +0 -8
- package/build/jsonSchemaForm/index.js +0 -8
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +0 -62
- package/build/jsonSchemaForm/objectSchema/index.js +0 -8
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +0 -135
- package/build/jsonSchemaForm/oneOfSchema/index.js +0 -8
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +0 -13
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +0 -18
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +0 -69
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +0 -20
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +0 -10
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +0 -8
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +0 -119
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +0 -8
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +0 -66
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +0 -36
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +0 -58
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +0 -12
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +0 -18
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +0 -25
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +0 -23
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +0 -58
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +0 -15
- package/build/jsonSchemaForm/readOnlySchema/index.js +0 -8
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +0 -98
- package/build/jsonSchemaForm/schemaFormControl/index.js +0 -8
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +0 -77
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +0 -17
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +0 -110
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +0 -89
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +0 -8
- package/build/layout/DynamicLayout.js +0 -52
- package/build/layout/alert/DynamicAlert.js +0 -31
- package/build/layout/box/DynamicBox.js +0 -32
- package/build/layout/button/DynamicButton.js +0 -49
- package/build/layout/columns/DynamicColumns.js +0 -29
- package/build/layout/decision/DynamicDecision.js +0 -29
- package/build/layout/divider/DynamicDivider.js +0 -10
- package/build/layout/external/DynamicExternal.js +0 -25
- package/build/layout/external/DynamicExternal.messages.js +0 -10
- package/build/layout/form/DynamicForm.js +0 -16
- package/build/layout/heading/DynamicHeading.js +0 -22
- package/build/layout/icon/DynamicIcon.js +0 -49
- package/build/layout/image/DynamicImage.js +0 -62
- package/build/layout/index.js +0 -40
- package/build/layout/info/DynamicInfo.js +0 -9
- package/build/layout/list/DynamicList.js +0 -21
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +0 -12
- package/build/layout/paragraph/DynamicParagraph.js +0 -30
- package/build/layout/paragraph/DynamicParagraph.messages.js +0 -15
- package/build/layout/paragraph/useSnackBarIfAvailable.js +0 -13
- package/build/layout/review/DynamicReview.js +0 -23
- package/build/layout/utils.js +0 -33
- package/build/step/cameraStep/CameraStep.js +0 -84
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +0 -70
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +0 -20
- package/build/step/cameraStep/cameraCapture/components/index.js +0 -18
- package/build/step/cameraStep/cameraCapture/hooks/index.js +0 -29
- package/build/step/cameraStep/cameraCapture/index.js +0 -8
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +0 -68
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +0 -13
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +0 -15
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +0 -14
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +0 -20
- package/build/step/cameraStep/cameraCapture/screens/index.js +0 -10
- package/build/step/cameraStep/cameraCapture/tracking/index.js +0 -22
- package/build/step/cameraStep/cameraCapture/utils/index.js +0 -51
- package/build/step/cameraStep/index.js +0 -8
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +0 -68
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +0 -25
- package/build/step/externalConfirmationStep/index.js +0 -8
- package/build/step/index.js +0 -12
- package/build/step/layoutStep/LayoutStep.js +0 -35
- package/build/step/layoutStep/index.js +0 -8
- package/build/step/layoutStep/utils/index.js +0 -7
- package/build/step/layoutStep/utils/inline-reference-utils.js +0 -78
- package/build/step/layoutStep/utils/layout-utils.js +0 -203
- package/build/types/common/FormControl.js +0 -2
- package/build/types/index.js +0 -42
- package/build/types/specification/Action.js +0 -2
- package/build/types/specification/FileUploadSchema.js +0 -8
- package/build/types/specification/LayoutComponent.js +0 -2
- package/build/types/specification/Model.js +0 -30
- package/build/types/specification/PersistAsync.js +0 -2
- package/build/types/specification/Polling.js +0 -2
- package/build/types/specification/Promotion.js +0 -2
- package/build/types/specification/Schema.js +0 -67
- package/build/types/specification/Step.js +0 -6
- package/build/types/specification/ValidationAsync.js +0 -2
- package/build/types/specification/core.js +0 -2
- /package/build/{common → types/common}/constants/DateMode.d.ts +0 -0
- /package/build/{common → types/common}/constants/FormControlType.d.ts +0 -0
- /package/build/{common → types/common}/constants/MonthFormat.d.ts +0 -0
- /package/build/{common → types/common}/constants/SchemaType.d.ts +0 -0
- /package/build/{common → types/common}/constants/Size.d.ts +0 -0
- /package/build/{common → types/common}/constants/index.d.ts +0 -0
- /package/build/{common → types/common}/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +0 -0
- /package/build/{common → types/common}/contexts/dynamicFlowContexts/usePendingPromiseCounter.d.ts +0 -0
- /package/build/{common → types/common}/contexts/eventsContext/EventsContext.d.ts +0 -0
- /package/build/{common → types/common}/contexts/fetcherContexts/FetcherContexts.d.ts +0 -0
- /package/build/{common → types/common}/contexts/index.d.ts +0 -0
- /package/build/{common → types/common}/contexts/logContext/LogContext.d.ts +0 -0
- /package/build/{common → types/common}/hooks/index.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useExternal/useExternal.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePersistAsync/usePersistAsync.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePolling/usePolling.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePrevious/usePrevious.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useStepPolling/useStepPolling.d.ts +0 -0
- /package/build/{common → types/common}/makeFetcher/index.d.ts +0 -0
- /package/build/{common → types/common}/makeFetcher/makeFetcher.d.ts +0 -0
- /package/build/{common → types/common}/messages.d.ts +0 -0
- /package/build/{common → types/common}/utils/api-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/date-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/debounce.d.ts +0 -0
- /package/build/{common → types/common}/utils/file-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/id-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/index.d.ts +0 -0
- /package/build/{common → types/common}/utils/is-equal.d.ts +0 -0
- /package/build/{common → types/common}/utils/schema-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/step-utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/index.d.ts +0 -0
- /package/build/{common → types/common}/validators/models/model-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/models/models.utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/schemas/schema-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/types/type-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/validationFailures/validation-failures.d.ts +0 -0
- /package/build/{common → types/common}/validators/validationFailures/validation-failures.utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/values/value-validators.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlow.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlowStep.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlowTypes.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/index.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/fixtureFetcher.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/index.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/responseParsers/response-parsers.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useDynamicFlowState.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useLoader.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/alert.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/box.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/button.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/columns.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/copyable.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/decision.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/heading.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/image.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/info.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/list.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/loading-indicator.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/paragraph.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/review.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/camera-capture.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/recipient-update.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/recipient.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/single-file-upload.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/step-validation-errors.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/action-response.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/external.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/persist-async.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/polling.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/validation-async.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/allOf.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/all.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/final-step-layout.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/list.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/pay-in.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/review.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/success.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/action-response-final.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/action.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/exit.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/recipient-update-final.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/basic-form.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/number-and-integer.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/one-of.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/string-formats.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/utils/image-util.d.ts +0 -0
- /package/build/{formControl → types/formControl}/FormControl.d.ts +0 -0
- /package/build/{formControl → types/formControl}/index.d.ts +0 -0
- /package/build/{formControl → types/formControl}/utils/index.d.ts +0 -0
- /package/build/{formControl → types/formControl}/utils/value-utils.d.ts +0 -0
- /package/build/{i18n → types/i18n}/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/JsonSchemaForm.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/allOfSchema/AllOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/allOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/ArraySchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/basicTypeSchema/BasicTypeSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/basicTypeSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/ControlFeedback.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/ControlFeedback.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/genericSchema/GenericSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/genericSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/Help.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/Help.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/objectSchema/ObjectSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/objectSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/OneOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/const-schema-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/one-of-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promoted-one-of-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/ReadOnlySchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/SchemaFormControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/currency-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/mapping-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/validationAsyncSchema/index.d.ts +0 -0
- /package/build/{layout → types/layout}/DynamicLayout.d.ts +0 -0
- /package/build/{layout → types/layout}/alert/DynamicAlert.d.ts +0 -0
- /package/build/{layout → types/layout}/box/DynamicBox.d.ts +0 -0
- /package/build/{layout → types/layout}/button/DynamicButton.d.ts +0 -0
- /package/build/{layout → types/layout}/columns/DynamicColumns.d.ts +0 -0
- /package/build/{layout → types/layout}/decision/DynamicDecision.d.ts +0 -0
- /package/build/{layout → types/layout}/divider/DynamicDivider.d.ts +0 -0
- /package/build/{layout → types/layout}/external/DynamicExternal.d.ts +0 -0
- /package/build/{layout → types/layout}/external/DynamicExternal.messages.d.ts +0 -0
- /package/build/{layout → types/layout}/form/DynamicForm.d.ts +0 -0
- /package/build/{layout → types/layout}/heading/DynamicHeading.d.ts +0 -0
- /package/build/{layout → types/layout}/icon/DynamicIcon.d.ts +0 -0
- /package/build/{layout → types/layout}/image/DynamicImage.d.ts +0 -0
- /package/build/{layout → types/layout}/index.d.ts +0 -0
- /package/build/{layout → types/layout}/info/DynamicInfo.d.ts +0 -0
- /package/build/{layout → types/layout}/list/DynamicList.d.ts +0 -0
- /package/build/{layout → types/layout}/loadingIndicator/DynamicLoadingIndicator.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/DynamicParagraph.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/DynamicParagraph.messages.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/useSnackBarIfAvailable.d.ts +0 -0
- /package/build/{layout → types/layout}/review/DynamicReview.d.ts +0 -0
- /package/build/{layout → types/layout}/utils.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/CameraStep.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/CameraCapture.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/components/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/hooks/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/tracking/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/utils/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/index.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/index.d.ts +0 -0
- /package/build/{step → types/step}/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/LayoutStep.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/inline-reference-utils.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/layout-utils.d.ts +0 -0
- /package/build/types/{common → types/common}/FormControl.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Action.d.ts +0 -0
- /package/build/types/{specification → types/specification}/FileUploadSchema.d.ts +0 -0
- /package/build/types/{specification → types/specification}/LayoutComponent.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Model.d.ts +0 -0
- /package/build/types/{specification → types/specification}/PersistAsync.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Polling.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Promotion.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Schema.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Step.d.ts +0 -0
- /package/build/types/{specification → types/specification}/ValidationAsync.d.ts +0 -0
- /package/build/types/{specification → types/specification}/core.d.ts +0 -0
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSafeDateStringValue = exports.getSafeDateOrStringValue = exports.getSafeBooleanValue = exports.getSafeStringOrNumberValue = exports.getSafeStringValue = void 0;
|
|
4
|
-
/* eslint-disable no-console */
|
|
5
|
-
const utils_1 = require("../../common/utils");
|
|
6
|
-
const validators_1 = require("../../common/validators");
|
|
7
|
-
const getSafeStringValue = (value, options = {}) => {
|
|
8
|
-
const { coerceValue = false } = options;
|
|
9
|
-
if ((0, validators_1.isNull)(value)) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
if ((0, validators_1.isObject)(value)) {
|
|
13
|
-
logInvalidTypeFallbackWarning({ received: 'object', expected: 'string' });
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
if (!(0, validators_1.isString)(value)) {
|
|
17
|
-
if (coerceValue) {
|
|
18
|
-
// TODO: Remove this coercion once we're sure everyone has had a chance to address warnings
|
|
19
|
-
logInvalidTypeCoercedWarning({ received: typeof value, expected: 'string' });
|
|
20
|
-
return String(value);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
logInvalidTypeFallbackWarning({ received: typeof value, expected: 'string' });
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
};
|
|
29
|
-
exports.getSafeStringValue = getSafeStringValue;
|
|
30
|
-
const getSafeStringOrNumberValue = (value, options = {}) => {
|
|
31
|
-
const { coerceValue = false } = options;
|
|
32
|
-
if ((0, validators_1.isNull)(value)) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
if ((0, validators_1.isNumber)(value)) {
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
const logProps = { received: typeof value, expected: 'string or number' };
|
|
39
|
-
if ((0, validators_1.isObject)(value)) {
|
|
40
|
-
logInvalidTypeFallbackWarning(logProps);
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
if (!(0, validators_1.isString)(value)) {
|
|
44
|
-
if (coerceValue) {
|
|
45
|
-
// TODO: Remove this coercion once we're sure everyone has had a chance to address warnings
|
|
46
|
-
logInvalidTypeCoercedWarning(logProps);
|
|
47
|
-
return String(value);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
logInvalidTypeFallbackWarning(logProps);
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return value;
|
|
55
|
-
};
|
|
56
|
-
exports.getSafeStringOrNumberValue = getSafeStringOrNumberValue;
|
|
57
|
-
const getSafeBooleanValue = (value, options = {}) => {
|
|
58
|
-
const { coerceValue = false } = options;
|
|
59
|
-
if ((0, validators_1.isNull)(value)) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
if (!(0, validators_1.isBoolean)(value)) {
|
|
63
|
-
if (coerceValue) {
|
|
64
|
-
// TODO: Remove this coercion once we're sure everyone has had a chance to address warnings
|
|
65
|
-
logInvalidTypeCoercedWarning({ received: typeof value, expected: 'boolean' });
|
|
66
|
-
return Boolean(value);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
logInvalidTypeFallbackWarning({ received: typeof value, expected: 'boolean' });
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return value;
|
|
74
|
-
};
|
|
75
|
-
exports.getSafeBooleanValue = getSafeBooleanValue;
|
|
76
|
-
const getSafeDateOrStringValue = (value) => {
|
|
77
|
-
if ((0, validators_1.isNull)(value)) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
if (!(value instanceof Date) && !(0, validators_1.isString)(value)) {
|
|
81
|
-
logInvalidTypeFallbackWarning({ received: typeof value, expected: 'string or Date' });
|
|
82
|
-
return undefined;
|
|
83
|
-
}
|
|
84
|
-
return value;
|
|
85
|
-
};
|
|
86
|
-
exports.getSafeDateOrStringValue = getSafeDateOrStringValue;
|
|
87
|
-
const getSafeDateStringValue = (value) => {
|
|
88
|
-
if ((0, validators_1.isNull)(value)) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
if (!(0, validators_1.isString)(value)) {
|
|
92
|
-
logInvalidTypeFallbackWarning({
|
|
93
|
-
received: typeof value,
|
|
94
|
-
expected: 'string',
|
|
95
|
-
fallback: 'null',
|
|
96
|
-
});
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const date = (0, utils_1.dateStringToDate)(value);
|
|
100
|
-
if (date === null) {
|
|
101
|
-
console.warn('Incorrectly formatted date string. Falling back to null.');
|
|
102
|
-
}
|
|
103
|
-
return date;
|
|
104
|
-
};
|
|
105
|
-
exports.getSafeDateStringValue = getSafeDateStringValue;
|
|
106
|
-
const logInvalidTypeCoercedWarning = ({ received, expected, }) => {
|
|
107
|
-
console.warn(`Value with type ${received} passed to control that only accepts type ${expected}. Type will be coerced, but this behaviour will change in the future, so please fix your code.`);
|
|
108
|
-
};
|
|
109
|
-
const logInvalidTypeFallbackWarning = ({ received, expected, fallback = 'undefined', }) => {
|
|
110
|
-
console.warn(`Value with type ${received} passed to control that only accepts type ${expected}. Falling back to ${fallback}`);
|
|
111
|
-
};
|
package/build/i18n/index.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const de_json_1 = __importDefault(require("./de.json"));
|
|
7
|
-
const en_json_1 = __importDefault(require("./en.json"));
|
|
8
|
-
const es_json_1 = __importDefault(require("./es.json"));
|
|
9
|
-
const fr_json_1 = __importDefault(require("./fr.json"));
|
|
10
|
-
const hu_json_1 = __importDefault(require("./hu.json"));
|
|
11
|
-
const id_json_1 = __importDefault(require("./id.json"));
|
|
12
|
-
const it_json_1 = __importDefault(require("./it.json"));
|
|
13
|
-
const ja_json_1 = __importDefault(require("./ja.json"));
|
|
14
|
-
const pl_json_1 = __importDefault(require("./pl.json"));
|
|
15
|
-
const pt_json_1 = __importDefault(require("./pt.json"));
|
|
16
|
-
const ro_json_1 = __importDefault(require("./ro.json"));
|
|
17
|
-
const ru_json_1 = __importDefault(require("./ru.json"));
|
|
18
|
-
const tr_json_1 = __importDefault(require("./tr.json"));
|
|
19
|
-
const zh_json_1 = __importDefault(require("./zh.json"));
|
|
20
|
-
const translations = {
|
|
21
|
-
en: en_json_1.default,
|
|
22
|
-
de: de_json_1.default,
|
|
23
|
-
es: es_json_1.default,
|
|
24
|
-
fr: fr_json_1.default,
|
|
25
|
-
hu: hu_json_1.default,
|
|
26
|
-
id: id_json_1.default,
|
|
27
|
-
it: it_json_1.default,
|
|
28
|
-
ja: ja_json_1.default,
|
|
29
|
-
pl: pl_json_1.default,
|
|
30
|
-
pt: pt_json_1.default,
|
|
31
|
-
ro: ro_json_1.default,
|
|
32
|
-
ru: ru_json_1.default,
|
|
33
|
-
tr: tr_json_1.default,
|
|
34
|
-
zh: zh_json_1.default,
|
|
35
|
-
};
|
|
36
|
-
exports.default = translations;
|
package/build/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { convertStepToLayout, inlineReferences } from './step/layoutStep/utils';
|
|
2
|
-
export { default as DynamicFlow } from './dynamicFlow';
|
|
3
|
-
export { makeFetcher } from './common/makeFetcher';
|
|
4
|
-
export { default as JsonSchemaForm } from './jsonSchemaForm';
|
|
5
|
-
export { DynamicLayout as Layout } from './layout';
|
|
6
|
-
export { isValidSchema } from './common/validators';
|
|
7
|
-
export { fixtures } from './fixtures';
|
|
8
|
-
export { default as translations } from './i18n';
|
|
9
|
-
export * from './dynamicFlow/DynamicFlow';
|
|
10
|
-
export type { DynamicFlowProps } from './dynamicFlow/DynamicFlowTypes';
|
|
11
|
-
export type { Step } from './types';
|
package/build/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.translations = exports.fixtures = exports.isValidSchema = exports.Layout = exports.JsonSchemaForm = exports.makeFetcher = exports.DynamicFlow = exports.inlineReferences = exports.convertStepToLayout = void 0;
|
|
21
|
-
var utils_1 = require("./step/layoutStep/utils");
|
|
22
|
-
Object.defineProperty(exports, "convertStepToLayout", { enumerable: true, get: function () { return utils_1.convertStepToLayout; } });
|
|
23
|
-
Object.defineProperty(exports, "inlineReferences", { enumerable: true, get: function () { return utils_1.inlineReferences; } });
|
|
24
|
-
var dynamicFlow_1 = require("./dynamicFlow");
|
|
25
|
-
Object.defineProperty(exports, "DynamicFlow", { enumerable: true, get: function () { return __importDefault(dynamicFlow_1).default; } });
|
|
26
|
-
var makeFetcher_1 = require("./common/makeFetcher");
|
|
27
|
-
Object.defineProperty(exports, "makeFetcher", { enumerable: true, get: function () { return makeFetcher_1.makeFetcher; } });
|
|
28
|
-
var jsonSchemaForm_1 = require("./jsonSchemaForm");
|
|
29
|
-
Object.defineProperty(exports, "JsonSchemaForm", { enumerable: true, get: function () { return __importDefault(jsonSchemaForm_1).default; } });
|
|
30
|
-
var layout_1 = require("./layout");
|
|
31
|
-
Object.defineProperty(exports, "Layout", { enumerable: true, get: function () { return layout_1.DynamicLayout; } });
|
|
32
|
-
var validators_1 = require("./common/validators");
|
|
33
|
-
Object.defineProperty(exports, "isValidSchema", { enumerable: true, get: function () { return validators_1.isValidSchema; } });
|
|
34
|
-
var fixtures_1 = require("./fixtures");
|
|
35
|
-
Object.defineProperty(exports, "fixtures", { enumerable: true, get: function () { return fixtures_1.fixtures; } });
|
|
36
|
-
var i18n_1 = require("./i18n");
|
|
37
|
-
Object.defineProperty(exports, "translations", { enumerable: true, get: function () { return __importDefault(i18n_1).default; } });
|
|
38
|
-
__exportStar(require("./dynamicFlow/DynamicFlow"), exports);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const contexts_1 = require("../common/contexts");
|
|
8
|
-
const genericSchema_1 = __importDefault(require("./genericSchema"));
|
|
9
|
-
const JsonSchemaForm = (props) => {
|
|
10
|
-
const schemaProps = Object.assign({ model: null, errors: null, disabled: false, baseUrl: '' }, props);
|
|
11
|
-
if ((0, contexts_1.useHasFetcherProvider)() || schemaProps.baseUrl == null) {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(genericSchema_1.default, Object.assign({}, schemaProps));
|
|
13
|
-
}
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(Providers, Object.assign({ baseUrl: schemaProps.baseUrl, onEvent: schemaProps.onEvent, onLog: schemaProps.onLog }, { children: (0, jsx_runtime_1.jsx)(genericSchema_1.default, Object.assign({}, schemaProps)) })));
|
|
15
|
-
};
|
|
16
|
-
exports.default = JsonSchemaForm;
|
|
17
|
-
const Providers = ({ baseUrl, onEvent, onLog, children }) => {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, Object.assign({ flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog !== null && onLog !== void 0 ? onLog : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, Object.assign({ metadata: { flowId: 'JsonSchemaForm', stepId: 'JsonSchemaForm' }, onEvent: onEvent !== null && onEvent !== void 0 ? onEvent : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProviderFromBaseUrl, Object.assign({ baseUrl: baseUrl }, { children: children })) })) })));
|
|
19
|
-
};
|
|
20
|
-
const noop = () => {
|
|
21
|
-
// noop
|
|
22
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const validators_1 = require("../../common/validators");
|
|
10
|
-
const genericSchema_1 = __importDefault(require("../genericSchema"));
|
|
11
|
-
const splitModel = (model, schemas) => {
|
|
12
|
-
// If wew receive a model, break it down to parts valid for each schema
|
|
13
|
-
return schemas.map((schema) => (0, validators_1.getValidObjectModelParts)(model, schema) || {});
|
|
14
|
-
};
|
|
15
|
-
const combineModels = (models) => {
|
|
16
|
-
return models.reduce((current, combined) => {
|
|
17
|
-
return Object.assign(Object.assign({}, combined), current);
|
|
18
|
-
}, {});
|
|
19
|
-
};
|
|
20
|
-
const getSchemaColumnClasses = (width) => {
|
|
21
|
-
return {
|
|
22
|
-
'col-xs-12': true,
|
|
23
|
-
'col-sm-6': width === 'md',
|
|
24
|
-
'col-sm-4': width === 'sm',
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
const AllOfSchema = (props) => {
|
|
28
|
-
const onChangeModelIndex = (index, onChangeProps) => {
|
|
29
|
-
const modelSchema = props.schema.allOf[index];
|
|
30
|
-
// FIXME we should not mutate models here
|
|
31
|
-
// eslint-disable-next-line fp/no-mutation
|
|
32
|
-
models[index] = (0, validators_1.getValidObjectModelParts)(onChangeProps.model, modelSchema) || {};
|
|
33
|
-
setModels(models);
|
|
34
|
-
props.onChange(Object.assign(Object.assign({}, onChangeProps), { model: combineModels(models) }));
|
|
35
|
-
};
|
|
36
|
-
const [models, setModels] = (0, react_1.useState)(splitModel(props.model, props.schema.allOf));
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.title && (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "page-header" }, { children: props.schema.title })), props.schema.description && (0, jsx_runtime_1.jsx)("p", { children: props.schema.description }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "row" }, { children: props.schema.allOf.map((schema, index) => (
|
|
38
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
39
|
-
(0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)(getSchemaColumnClasses(schema.width)) }, { children: (0, jsx_runtime_1.jsx)(genericSchema_1.default, { schema: schema, model: models[index], errors: props.errors, submitted: props.submitted, disabled: props.disabled, onChange: (onChangeProps) => onChangeModelIndex(index, Object.assign(Object.assign({}, onChangeProps), {
|
|
40
|
-
// We can safely assume that the model here is going to be of the same type as the model prop
|
|
41
|
-
model: onChangeProps.model })), onPersistAsync: props.onPersistAsync }) }), index))) }))] }));
|
|
42
|
-
};
|
|
43
|
-
AllOfSchema.defaultProps = {
|
|
44
|
-
disabled: false,
|
|
45
|
-
};
|
|
46
|
-
exports.default = AllOfSchema;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var AllOfSchema_1 = require("./AllOfSchema");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(AllOfSchema_1).default; } });
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const types_1 = require("../../types");
|
|
8
|
-
const ArrayListSchema_1 = __importDefault(require("./arrayListSchema/ArrayListSchema"));
|
|
9
|
-
const ArraySchema = (props) => {
|
|
10
|
-
const { schema } = props;
|
|
11
|
-
if ((0, types_1.isListArraySchema)(schema)) {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(ArrayListSchema_1.default, Object.assign({}, props));
|
|
13
|
-
}
|
|
14
|
-
throw new Error('Not implemented'); // Tuple not implemented
|
|
15
|
-
};
|
|
16
|
-
ArraySchema.defaultProps = {
|
|
17
|
-
required: false,
|
|
18
|
-
};
|
|
19
|
-
exports.default = ArraySchema;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const Schema_1 = require("../../../types/specification/Schema");
|
|
8
|
-
const multipleFileUploadSchema_1 = __importDefault(require("./multipleFileUploadSchema"));
|
|
9
|
-
const ArrayListSchema = (props) => {
|
|
10
|
-
const { schema } = props;
|
|
11
|
-
if ((0, Schema_1.isMultipleFileUploadSchema)(schema)) {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(multipleFileUploadSchema_1.default, Object.assign({}, props, { schema: schema }));
|
|
13
|
-
}
|
|
14
|
-
throw new Error('Not implemented');
|
|
15
|
-
};
|
|
16
|
-
ArrayListSchema.defaultProps = {
|
|
17
|
-
errors: null,
|
|
18
|
-
required: false,
|
|
19
|
-
};
|
|
20
|
-
exports.default = ArrayListSchema;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var ArrayListSchema_1 = require("./ArrayListSchema");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ArrayListSchema_1).default; } });
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const components_1 = require("@transferwise/components");
|
|
8
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const contexts_1 = require("../../../../common/contexts");
|
|
11
|
-
const hooks_1 = require("../../../../common/hooks");
|
|
12
|
-
const utils_1 = require("../../../../common/utils");
|
|
13
|
-
const validators_1 = require("../../../../common/validators");
|
|
14
|
-
const types_1 = require("../../../../types");
|
|
15
|
-
const controlFeedback_1 = __importDefault(require("../../../controlFeedback"));
|
|
16
|
-
const utils_2 = require("./utils");
|
|
17
|
-
const useFormattedDefaultErrorMessages_1 = require("./utils/useFormattedDefaultErrorMessages");
|
|
18
|
-
const MultipleFileUploadSchema = (props) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
const { onChange, schema } = props;
|
|
21
|
-
const onEvent = (0, contexts_1.useEventDispatcher)();
|
|
22
|
-
const defaultErrorMessages = (0, useFormattedDefaultErrorMessages_1.useFormattedDefaultErrorMessages)(schema);
|
|
23
|
-
const uid = (0, react_1.useMemo)(() => schema.$id || (0, utils_1.generateRandomId)(), [schema.$id]);
|
|
24
|
-
const [inputChanged, setInputChanged] = (0, react_1.useState)(false);
|
|
25
|
-
const [files, setFiles] = (0, react_1.useState)(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
26
|
-
const performPersistAsync = (0, hooks_1.usePersistAsync)(schema.items.persistAsync);
|
|
27
|
-
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
28
|
-
const isBlob = (0, types_1.isBlobSchema)(fileSchemaDescriptor);
|
|
29
|
-
const uploadFile = async (userUploadedFile) => {
|
|
30
|
-
setInputChanged(true);
|
|
31
|
-
try {
|
|
32
|
-
const payload = await (0, utils_2.createPayload)(userUploadedFile, isBlob);
|
|
33
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'pending', schemaId: schema.$id });
|
|
34
|
-
const response = await performPersistAsync(payload);
|
|
35
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'success', schemaId: schema.$id });
|
|
36
|
-
return (0, utils_2.constructUploadResponse)(response);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'failure', schemaId: schema.$id });
|
|
40
|
-
return Promise.reject((0, utils_2.constructUploadError)(error));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
function onFilesChange(newFiles) {
|
|
44
|
-
if ((0, utils_1.areFilesSame)(newFiles, files)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setFiles(newFiles);
|
|
48
|
-
const validFiles = getSuccessfullyProcessedFiles(newFiles);
|
|
49
|
-
const data = validFiles.map((file) => file.id);
|
|
50
|
-
onChange({
|
|
51
|
-
model: data,
|
|
52
|
-
triggerSchema: schema,
|
|
53
|
-
triggerModel: data,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const validFiles = getSuccessfullyProcessedFiles(files);
|
|
57
|
-
const fileIds = validFiles.map((file) => file.id);
|
|
58
|
-
const fileListValidationFailures = (0, validators_1.getArrayValidationFailures)(fileIds, schema, props.required);
|
|
59
|
-
const showError = Boolean(props.errors) ||
|
|
60
|
-
((inputChanged || props.submitted) && Boolean(fileListValidationFailures.length));
|
|
61
|
-
const accepts = 'accepts' in fileSchemaDescriptor && fileSchemaDescriptor.accepts;
|
|
62
|
-
const maxSize = 'maxSize' in fileSchemaDescriptor && fileSchemaDescriptor.maxSize;
|
|
63
|
-
const uploadInputProps = Object.assign(Object.assign(Object.assign({ multiple: true, className: 'form-control', files, fileInputName: uid, id: uid }, (accepts ? { fileTypes: accepts } : undefined)), (maxSize ? { sizeLimit: (0, utils_1.toKilobytes)(maxSize) } : undefined)), { sizeLimitErrorMessage: ((_a = fileSchemaDescriptor.validationMessages) === null || _a === void 0 ? void 0 : _a.maxSize) ||
|
|
64
|
-
defaultErrorMessages.maxFileSizeErrorMessage, maxFiles: props.schema.maxItems, maxFilesErrorMessage: ((_b = props.schema.validationMessages) === null || _b === void 0 ? void 0 : _b.maxItems) || defaultErrorMessages.maxItemsErrorMessage, uploadButtonTitle: fileSchemaDescriptor.title, description: fileSchemaDescriptor.description, disabled: props.disabled, onUploadFile: (formData) => uploadFile(formData.get(uid)), onFilesChange, onDeleteFile: () => Promise.resolve() });
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('form-group', { 'has-error': showError }) }, { children: [(0, jsx_runtime_1.jsx)("label", Object.assign({ className: "d-block control-label", htmlFor: uid }, { children: props.schema.title })), (0, jsx_runtime_1.jsx)(components_1.UploadInput, Object.assign({}, uploadInputProps)), (0, jsx_runtime_1.jsx)(controlFeedback_1.default, { changed: inputChanged, submitted: props.submitted, errors: props.errors, schema: props.schema, validations: fileListValidationFailures, validationMessages: getValidationMessages(schema, Boolean(props.required), defaultErrorMessages), infoMessage: null, focused: false, blurred: true })] })));
|
|
66
|
-
};
|
|
67
|
-
MultipleFileUploadSchema.defaultProps = {
|
|
68
|
-
errors: null,
|
|
69
|
-
required: false,
|
|
70
|
-
};
|
|
71
|
-
exports.default = MultipleFileUploadSchema;
|
|
72
|
-
function getSuccessfullyProcessedFiles(allFiles) {
|
|
73
|
-
return allFiles.filter((file) => !file.error && file.status === 'succeeded');
|
|
74
|
-
}
|
|
75
|
-
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
76
|
-
return fileIds
|
|
77
|
-
.map((id) => (isValidId(id) ? { id, status: components_1.Status.SUCCEEDED } : null))
|
|
78
|
-
.filter((item) => item !== null);
|
|
79
|
-
}
|
|
80
|
-
function isValidId(id) {
|
|
81
|
-
return (0, validators_1.isNumber)(id) || (0, validators_1.isString)(id);
|
|
82
|
-
}
|
|
83
|
-
function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
84
|
-
const { minItems, maxItems } = schema;
|
|
85
|
-
return Object.assign(Object.assign(Object.assign({}, (required && { required: defaultErrorMessages.requiredMessage })), (minItems && { minItems: defaultErrorMessages.minItemsErrorMessage })), (maxItems && { maxItems: defaultErrorMessages.maxItemsErrorMessage }));
|
|
86
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_intl_1 = require("react-intl");
|
|
4
|
-
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
|
-
minItemsError: {
|
|
6
|
-
id: 'dynamicFlows.MultipleFileUploadSchema.minItemsError',
|
|
7
|
-
defaultMessage: 'Please upload at least {minItems} file(s).',
|
|
8
|
-
description: 'Customer has uploaded not enough files. To fix: upload more files.',
|
|
9
|
-
},
|
|
10
|
-
maxItemsError: {
|
|
11
|
-
id: 'dynamicFlows.MultipleFileUploadSchema.maxItemsError',
|
|
12
|
-
defaultMessage: 'Please upload {maxItems} or fewer files.',
|
|
13
|
-
description: 'Customer has uploaded too many files. To fix: upload fewer files.',
|
|
14
|
-
},
|
|
15
|
-
maxFileSizeError: {
|
|
16
|
-
id: 'dynamicFlows.MultipleFileUploadSchema.maxFileSizeError',
|
|
17
|
-
defaultMessage: 'Sorry, that file is too big. Please upload a smaller file.',
|
|
18
|
-
description: "Customer has uploaded a file that's too big. To fix: upload a smaller file.",
|
|
19
|
-
},
|
|
20
|
-
});
|
package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var MultipleFileUploadSchema_1 = require("./MultipleFileUploadSchema");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(MultipleFileUploadSchema_1).default; } });
|
package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./upload-utils"), exports);
|
|
18
|
-
__exportStar(require("./useFormattedDefaultErrorMessages"), exports);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constructUploadError = exports.constructUploadResponse = exports.createPayload = void 0;
|
|
4
|
-
const utils_1 = require("../../../../../common/utils");
|
|
5
|
-
const validators_1 = require("../../../../../common/validators");
|
|
6
|
-
async function createPayload(userUploadedFile, isBlobSchema) {
|
|
7
|
-
if (isBlobSchema) {
|
|
8
|
-
return userUploadedFile;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
if (userUploadedFile instanceof Blob) {
|
|
12
|
-
return (0, utils_1.toBase64)(userUploadedFile);
|
|
13
|
-
}
|
|
14
|
-
throw new Error('Error creating payload for MultipleFileUploadSchema. Uploaded file is not an instance of Blob.');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.createPayload = createPayload;
|
|
18
|
-
function constructUploadResponse(response) {
|
|
19
|
-
const id = response.data;
|
|
20
|
-
return Object.assign({ id }, response);
|
|
21
|
-
}
|
|
22
|
-
exports.constructUploadResponse = constructUploadResponse;
|
|
23
|
-
function constructUploadError(response) {
|
|
24
|
-
const isError = response instanceof Error;
|
|
25
|
-
const hasValidData = (0, validators_1.isObject)(response) && 'data' in response;
|
|
26
|
-
const isInvalidResponseData = !hasValidData && !isError;
|
|
27
|
-
if (isInvalidResponseData) {
|
|
28
|
-
return (0, validators_1.isString)(response) ? response : undefined;
|
|
29
|
-
}
|
|
30
|
-
if (isError) {
|
|
31
|
-
const error = response;
|
|
32
|
-
return { id: (0, utils_1.generateRandomId)(), message: error.message };
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return Object.assign({ message: (0, validators_1.isString)(response.message) ? response.message : '' }, response);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.constructUploadError = constructUploadError;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useFormattedDefaultErrorMessages = void 0;
|
|
7
|
-
const react_intl_1 = require("react-intl");
|
|
8
|
-
const messages_1 = __importDefault(require("../../../../../common/messages"));
|
|
9
|
-
const MultipleFileUploadSchema_messages_1 = __importDefault(require("../MultipleFileUploadSchema.messages"));
|
|
10
|
-
function useFormattedDefaultErrorMessages({ maxItems, minItems, }) {
|
|
11
|
-
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
12
|
-
const { maxFileSizeError, maxItemsError, minItemsError } = MultipleFileUploadSchema_messages_1.default;
|
|
13
|
-
return {
|
|
14
|
-
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
15
|
-
maxItemsErrorMessage: formatMessage(maxItemsError, { maxItems }),
|
|
16
|
-
minItemsErrorMessage: formatMessage(minItemsError, { minItems }),
|
|
17
|
-
requiredMessage: formatMessage(messages_1.default.required),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.useFormattedDefaultErrorMessages = useFormattedDefaultErrorMessages;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var ArraySchema_1 = require("./ArraySchema");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ArraySchema_1).default; } });
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const utils_1 = require("../../common/utils");
|
|
10
|
-
const validators_1 = require("../../common/validators");
|
|
11
|
-
const layout_1 = require("../../layout");
|
|
12
|
-
const controlFeedback_1 = __importDefault(require("../controlFeedback"));
|
|
13
|
-
const help_1 = __importDefault(require("../help"));
|
|
14
|
-
const schemaFormControl_1 = __importDefault(require("../schemaFormControl"));
|
|
15
|
-
const isNullish = (value) => (0, validators_1.isNull)(value) || (0, validators_1.isUndefined)(value);
|
|
16
|
-
const getDefaultValue = (schema) => {
|
|
17
|
-
return schema.type === 'boolean' && isNullish(schema.default) ? false : schema.default;
|
|
18
|
-
};
|
|
19
|
-
const BasicTypeSchema = (props) => {
|
|
20
|
-
var _a, _b, _c;
|
|
21
|
-
const onChange = (newModel) => {
|
|
22
|
-
setChanged(true);
|
|
23
|
-
setModelAndBroadcast(sanitiseModel(newModel), 'user');
|
|
24
|
-
};
|
|
25
|
-
const getValidationKeys = (newModel) => (0, validators_1.getValidationFailures)(newModel, props.schema, props.required); // TODO: LOW avoid type assertion
|
|
26
|
-
const setModelAndBroadcast = (newModel, type) => {
|
|
27
|
-
setModel(newModel);
|
|
28
|
-
const validationKeys = getValidationKeys(newModel);
|
|
29
|
-
setValidations(validationKeys);
|
|
30
|
-
const broadcastModel = newModel;
|
|
31
|
-
setLastModel(broadcastModel);
|
|
32
|
-
if (broadcastModel !== lastModel) {
|
|
33
|
-
props.onChange({
|
|
34
|
-
model: broadcastModel,
|
|
35
|
-
triggerSchema: props.schema,
|
|
36
|
-
triggerModel: broadcastModel,
|
|
37
|
-
lastTriggerModel: lastModel,
|
|
38
|
-
type,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const sanitiseModel = (newModel) => (0, validators_1.getValidBasicModelOrNull)(newModel, props.schema);
|
|
43
|
-
const onFocus = () => setFocused(true);
|
|
44
|
-
const onBlur = () => {
|
|
45
|
-
setFocused(false);
|
|
46
|
-
setBlurred(true);
|
|
47
|
-
if (props.onBlur) {
|
|
48
|
-
props.onBlur();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const [model, setModel] = (0, react_1.useState)((_a = props.model) !== null && _a !== void 0 ? _a : null);
|
|
52
|
-
const [lastModel, setLastModel] = (0, react_1.useState)((_b = props.model) !== null && _b !== void 0 ? _b : null);
|
|
53
|
-
const [changed, setChanged] = (0, react_1.useState)(false);
|
|
54
|
-
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
55
|
-
const [blurred, setBlurred] = (0, react_1.useState)(false);
|
|
56
|
-
const [validations, setValidations] = (0, react_1.useState)([]);
|
|
57
|
-
const id = (0, react_1.useMemo)(() => props.schema.$id || (0, utils_1.generateRandomId)(), [props.schema.$id]);
|
|
58
|
-
const onSchemaChange = () => {
|
|
59
|
-
const defaultValue = getDefaultValue(props.schema);
|
|
60
|
-
// if no model, change to the default, only run this when the schema changes
|
|
61
|
-
if (isNullish(model) && !isNullish(defaultValue)) {
|
|
62
|
-
setModelAndBroadcast(defaultValue, 'init');
|
|
63
|
-
}
|
|
64
|
-
if (props.schema.const) {
|
|
65
|
-
setModelAndBroadcast(props.schema.const, 'init');
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const refreshValidations = () => {
|
|
69
|
-
setValidations(getValidationKeys(model));
|
|
70
|
-
};
|
|
71
|
-
const isConst = props.schema.const;
|
|
72
|
-
const isHidden = props.schema.hidden || isConst;
|
|
73
|
-
(0, react_1.useEffect)(refreshValidations, [props.model, props.submitted]);
|
|
74
|
-
(0, react_1.useEffect)(onSchemaChange, [props.schema]);
|
|
75
|
-
(0, react_1.useEffect)(() => { var _a; return setModel((_a = props.model) !== null && _a !== void 0 ? _a : null); }, [props.model]);
|
|
76
|
-
const formGroupClasses = {
|
|
77
|
-
'form-group': true,
|
|
78
|
-
'has-error': ((props.submitted || !changed) && !!props.errors) ||
|
|
79
|
-
((props.submitted || (changed && blurred)) && !!validations.length),
|
|
80
|
-
'has-info': (focused && !!props.schema.description) || !!props.infoMessage,
|
|
81
|
-
};
|
|
82
|
-
const showLabel = props.schema.format !== 'file' && props.schema.type !== 'boolean';
|
|
83
|
-
const schemaHelp = props.schema.help;
|
|
84
|
-
return !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.alert && (0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: props.schema.alert }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(formGroupClasses) }, { children: [showLabel && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "d-inline-block" }, { children: [(0, jsx_runtime_1.jsx)("label", Object.assign({ className: "control-label d-inline", htmlFor: id }, { children: props.schema.title })), !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1.default, { help: schemaHelp })] }))), !showLabel && !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1.default, { help: schemaHelp }), (0, jsx_runtime_1.jsx)(schemaFormControl_1.default, { id: id, schema: props.schema, value: model, disabled: !!props.disabled, onChange: onChange, onFocus: onFocus, onBlur: onBlur }), (0, jsx_runtime_1.jsx)(controlFeedback_1.default, { changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: (_c = props.errors) !== null && _c !== void 0 ? _c : null, schema: props.schema, validations: validations, infoMessage: props.infoMessage })] }))] })) : null;
|
|
85
|
-
};
|
|
86
|
-
BasicTypeSchema.defaultProps = {
|
|
87
|
-
required: false,
|
|
88
|
-
disabled: false,
|
|
89
|
-
onBlur: null,
|
|
90
|
-
};
|
|
91
|
-
exports.default = BasicTypeSchema;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var BasicTypeSchema_1 = require("./BasicTypeSchema");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(BasicTypeSchema_1).default; } });
|