@wise/dynamic-flow-client 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants/DateMode.js +3 -2
- package/build/common/constants/DateMode.js.map +1 -0
- package/build/common/constants/FormControlType.js +3 -2
- package/build/common/constants/FormControlType.js.map +1 -0
- package/build/common/constants/MonthFormat.js +3 -2
- package/build/common/constants/MonthFormat.js.map +1 -0
- package/build/common/constants/SchemaType.js +3 -2
- package/build/common/constants/SchemaType.js.map +1 -0
- package/build/common/constants/Size.js +3 -2
- package/build/common/constants/Size.js.map +1 -0
- package/build/common/constants/index.js +2 -1
- package/build/common/constants/index.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +16 -27
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +12 -9
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js.map +1 -0
- package/build/common/contexts/eventsContext/EventsContext.js +12 -28
- package/build/common/contexts/eventsContext/EventsContext.js.map +1 -0
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +15 -27
- package/build/common/contexts/fetcherContexts/FetcherContexts.js.map +1 -0
- package/build/common/contexts/index.js +2 -1
- package/build/common/contexts/index.js.map +1 -0
- package/build/common/contexts/logContext/LogContext.js +13 -30
- package/build/common/contexts/logContext/LogContext.js.map +1 -0
- package/build/common/hooks/index.js +2 -1
- package/build/common/hooks/index.js.map +1 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +4 -3
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js.map +1 -0
- package/build/common/hooks/useExternal/useExternal.js +9 -8
- package/build/common/hooks/useExternal/useExternal.js.map +1 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +21 -31
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js.map +1 -0
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +61 -139
- package/build/common/hooks/usePersistAsync/usePersistAsync.js.map +1 -0
- package/build/common/hooks/usePolling/usePolling.js +21 -21
- package/build/common/hooks/usePolling/usePolling.js.map +1 -0
- package/build/common/hooks/usePrevious/usePrevious.js +6 -5
- package/build/common/hooks/usePrevious/usePrevious.js.map +1 -0
- package/build/common/hooks/useStepPolling/useStepPolling.js +16 -14
- package/build/common/hooks/useStepPolling/useStepPolling.js.map +1 -0
- package/build/common/makeFetcher/index.js +2 -1
- package/build/common/makeFetcher/index.js.map +1 -0
- package/build/common/makeFetcher/makeFetcher.js +11 -24
- package/build/common/makeFetcher/makeFetcher.js.map +1 -0
- package/build/common/messages.js +6 -5
- package/build/common/messages.js.map +1 -0
- package/build/common/utils/api-utils.js +4 -4
- package/build/common/utils/api-utils.js.map +1 -0
- package/build/common/utils/date-utils.js +12 -11
- package/build/common/utils/date-utils.js.map +1 -0
- package/build/common/utils/debounce.js +12 -15
- package/build/common/utils/debounce.js.map +1 -0
- package/build/common/utils/file-utils.js +13 -25
- package/build/common/utils/file-utils.js.map +1 -0
- package/build/common/utils/id-utils.js +5 -5
- package/build/common/utils/id-utils.js.map +1 -0
- package/build/common/utils/index.js +2 -1
- package/build/common/utils/index.js.map +1 -0
- package/build/common/utils/is-equal.js +9 -8
- package/build/common/utils/is-equal.js.map +1 -0
- package/build/common/utils/schema-utils.js +7 -6
- package/build/common/utils/schema-utils.js.map +1 -0
- package/build/common/utils/step-utils.js +15 -14
- package/build/common/utils/step-utils.js.map +1 -0
- package/build/common/validators/index.js +8 -7
- package/build/common/validators/index.js.map +1 -0
- package/build/common/validators/models/model-validators.js +9 -8
- package/build/common/validators/models/model-validators.js.map +1 -0
- package/build/common/validators/models/models.utils.js +30 -42
- package/build/common/validators/models/models.utils.js.map +1 -0
- package/build/common/validators/schemas/schema-validators.js +12 -13
- package/build/common/validators/schemas/schema-validators.js.map +1 -0
- package/build/common/validators/types/type-validators.js +10 -13
- package/build/common/validators/types/type-validators.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.js +15 -14
- package/build/common/validators/validationFailures/validation-failures.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.utils.js +6 -7
- package/build/common/validators/validationFailures/validation-failures.utils.js.map +1 -0
- package/build/common/validators/values/value-validators.js +5 -6
- package/build/common/validators/values/value-validators.js.map +1 -0
- package/build/dynamicFlow/DynamicFlow.js +186 -307
- package/build/dynamicFlow/DynamicFlow.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowStep.js +13 -23
- package/build/dynamicFlow/DynamicFlowStep.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowTypes.js +2 -1
- package/build/dynamicFlow/DynamicFlowTypes.js.map +1 -0
- package/build/dynamicFlow/index.js +7 -14
- package/build/dynamicFlow/index.js.map +1 -0
- package/build/dynamicFlow/stories/DynamicFlow.story.js +21 -20
- package/build/dynamicFlow/stories/DynamicFlow.story.js.map +1 -0
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +21 -33
- package/build/dynamicFlow/stories/EditableDynamicFlow.js.map +1 -0
- package/build/dynamicFlow/stories/fixtureFetcher.js +47 -104
- package/build/dynamicFlow/stories/fixtureFetcher.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +23 -40
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +7 -6
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +11 -11
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js.map +1 -0
- package/build/dynamicFlow/utils/index.js +6 -2
- package/build/dynamicFlow/utils/index.js.map +1 -0
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +54 -118
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js.map +1 -0
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +10 -9
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js.map +1 -0
- package/build/dynamicFlow/utils/useDynamicFlowState.js +52 -74
- package/build/dynamicFlow/utils/useDynamicFlowState.js.map +1 -0
- package/build/dynamicFlow/utils/useLoader.js +10 -20
- package/build/dynamicFlow/utils/useLoader.js.map +1 -0
- package/build/fixtures/components/alert.js +9 -8
- package/build/fixtures/components/alert.js.map +1 -0
- package/build/fixtures/components/box.js +8 -7
- package/build/fixtures/components/box.js.map +1 -0
- package/build/fixtures/components/button.js +26 -36
- package/build/fixtures/components/button.js.map +1 -0
- package/build/fixtures/components/columns.js +11 -10
- package/build/fixtures/components/columns.js.map +1 -0
- package/build/fixtures/components/copyable.js +7 -6
- package/build/fixtures/components/copyable.js.map +1 -0
- package/build/fixtures/components/decision.js +16 -15
- package/build/fixtures/components/decision.js.map +1 -0
- package/build/fixtures/components/heading.js +8 -7
- package/build/fixtures/components/heading.js.map +1 -0
- package/build/fixtures/components/image.js +11 -10
- package/build/fixtures/components/image.js.map +1 -0
- package/build/fixtures/components/index.js +18 -25
- package/build/fixtures/components/index.js.map +1 -0
- package/build/fixtures/components/info.js +23 -6
- package/build/fixtures/components/info.js.map +1 -0
- package/build/fixtures/components/list.js +9 -8
- package/build/fixtures/components/list.js.map +1 -0
- package/build/fixtures/components/loading-indicator.js +6 -5
- package/build/fixtures/components/loading-indicator.js.map +1 -0
- package/build/fixtures/components/paragraph.js +10 -9
- package/build/fixtures/components/paragraph.js.map +1 -0
- package/build/fixtures/components/review.js +12 -11
- package/build/fixtures/components/review.js.map +1 -0
- package/build/fixtures/examples/camera-capture.js +30 -29
- package/build/fixtures/examples/camera-capture.js.map +1 -0
- package/build/fixtures/examples/index.js +10 -17
- package/build/fixtures/examples/index.js.map +1 -0
- package/build/fixtures/examples/recipient-update.js +70 -69
- package/build/fixtures/examples/recipient-update.js.map +1 -0
- package/build/fixtures/examples/recipient.js +64 -63
- package/build/fixtures/examples/recipient.js.map +1 -0
- package/build/fixtures/examples/single-file-upload.js +22 -21
- package/build/fixtures/examples/single-file-upload.js.map +1 -0
- package/build/fixtures/examples/step-validation-errors.js +22 -21
- package/build/fixtures/examples/step-validation-errors.js.map +1 -0
- package/build/fixtures/features/action-response.js +9 -8
- package/build/fixtures/features/action-response.js.map +1 -0
- package/build/fixtures/features/external.js +9 -8
- package/build/fixtures/features/external.js.map +1 -0
- package/build/fixtures/features/index.js +10 -17
- package/build/fixtures/features/index.js.map +1 -0
- package/build/fixtures/features/persist-async.js +12 -11
- package/build/fixtures/features/persist-async.js.map +1 -0
- package/build/fixtures/features/polling.js +10 -9
- package/build/fixtures/features/polling.js.map +1 -0
- package/build/fixtures/features/validation-async.js +11 -10
- package/build/fixtures/features/validation-async.js.map +1 -0
- package/build/fixtures/index.js +12 -22
- package/build/fixtures/index.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/allOf.js +31 -30
- package/build/fixtures/jsonSchemaForm/allOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.js +272 -271
- package/build/fixtures/jsonSchemaForm/audRecipient.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/currency.js +13 -12
- package/build/fixtures/jsonSchemaForm/currency.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOf.js +28 -27
- package/build/fixtures/jsonSchemaForm/oneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +17 -16
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +18 -17
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +31 -30
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/simple.js +17 -16
- package/build/fixtures/jsonSchemaForm/simple.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +20 -19
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.js +9 -8
- package/build/fixtures/jsonSchemaForm/validationAsync.js.map +1 -0
- package/build/fixtures/layouts/all.js +38 -37
- package/build/fixtures/layouts/all.js.map +1 -0
- package/build/fixtures/layouts/final-step-layout.js +10 -9
- package/build/fixtures/layouts/final-step-layout.js.map +1 -0
- package/build/fixtures/layouts/index.js +11 -18
- package/build/fixtures/layouts/index.js.map +1 -0
- package/build/fixtures/layouts/list.js +11 -10
- package/build/fixtures/layouts/list.js.map +1 -0
- package/build/fixtures/layouts/pay-in.js +24 -23
- package/build/fixtures/layouts/pay-in.js.map +1 -0
- package/build/fixtures/layouts/review.js +39 -38
- package/build/fixtures/layouts/review.js.map +1 -0
- package/build/fixtures/layouts/success.js +16 -15
- package/build/fixtures/layouts/success.js.map +1 -0
- package/build/fixtures/responses/action-response-final.js +9 -8
- package/build/fixtures/responses/action-response-final.js.map +1 -0
- package/build/fixtures/responses/action.js +4 -3
- package/build/fixtures/responses/action.js.map +1 -0
- package/build/fixtures/responses/exit.js +4 -3
- package/build/fixtures/responses/exit.js.map +1 -0
- package/build/fixtures/responses/index.js +9 -16
- package/build/fixtures/responses/index.js.map +1 -0
- package/build/fixtures/responses/recipient-update-final.js +9 -8
- package/build/fixtures/responses/recipient-update-final.js.map +1 -0
- package/build/fixtures/schemas/basic-form.js +12 -11
- package/build/fixtures/schemas/basic-form.js.map +1 -0
- package/build/fixtures/schemas/index.js +9 -16
- package/build/fixtures/schemas/index.js.map +1 -0
- package/build/fixtures/schemas/number-and-integer.js +12 -11
- package/build/fixtures/schemas/number-and-integer.js.map +1 -0
- package/build/fixtures/schemas/one-of.js +44 -46
- package/build/fixtures/schemas/one-of.js.map +1 -0
- package/build/fixtures/schemas/string-formats.js +16 -15
- package/build/fixtures/schemas/string-formats.js.map +1 -0
- package/build/fixtures/utils/image-util.js +9 -8
- package/build/fixtures/utils/image-util.js.map +1 -0
- package/build/formControl/FormControl.js +119 -148
- package/build/formControl/FormControl.js.map +1 -0
- package/build/formControl/index.js +7 -14
- package/build/formControl/index.js.map +1 -0
- package/build/formControl/utils/index.js +2 -1
- package/build/formControl/utils/index.js.map +1 -0
- package/build/formControl/utils/value-utils.js +19 -23
- package/build/formControl/utils/value-utils.js.map +1 -0
- package/build/i18n/index.js +32 -31
- package/build/i18n/index.js.map +1 -0
- package/build/index.js +14 -10
- package/build/index.js.map +1 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +13 -24
- package/build/jsonSchemaForm/JsonSchemaForm.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +25 -37
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/allOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +57 -115
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +8 -7
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +20 -71
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +11 -11
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +46 -62
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/basicTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +40 -50
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +19 -18
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +7 -14
- package/build/jsonSchemaForm/controlFeedback/index.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +53 -61
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +7 -14
- package/build/jsonSchemaForm/genericSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.js +10 -9
- package/build/jsonSchemaForm/help/Help.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.messages.js +6 -5
- package/build/jsonSchemaForm/help/Help.messages.js.map +1 -0
- package/build/jsonSchemaForm/help/index.js +7 -14
- package/build/jsonSchemaForm/help/index.js.map +1 -0
- package/build/jsonSchemaForm/index.js +7 -14
- package/build/jsonSchemaForm/index.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +29 -49
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/index.js +7 -14
- package/build/jsonSchemaForm/objectSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +55 -74
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/oneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +4 -3
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +20 -20
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +12 -22
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +6 -5
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +74 -127
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +46 -110
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +18 -17
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +29 -47
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +5 -4
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +14 -24
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +12 -22
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +13 -23
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +25 -26
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +7 -6
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +7 -14
- package/build/jsonSchemaForm/readOnlySchema/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +27 -39
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +7 -14
- package/build/jsonSchemaForm/schemaFormControl/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +6 -5
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +2 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +31 -47
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +58 -119
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/validationAsyncSchema/index.js.map +1 -0
- package/build/layout/DynamicLayout.js +11 -21
- package/build/layout/DynamicLayout.js.map +1 -0
- package/build/layout/alert/DynamicAlert.js +10 -9
- package/build/layout/alert/DynamicAlert.js.map +1 -0
- package/build/layout/box/DynamicBox.js +13 -23
- package/build/layout/box/DynamicBox.js.map +1 -0
- package/build/layout/button/DynamicButton.js +17 -27
- package/build/layout/button/DynamicButton.js.map +1 -0
- package/build/layout/columns/DynamicColumns.js +14 -24
- package/build/layout/columns/DynamicColumns.js.map +1 -0
- package/build/layout/decision/DynamicDecision.js +17 -27
- package/build/layout/decision/DynamicDecision.js.map +1 -0
- package/build/layout/divider/DynamicDivider.js +8 -8
- package/build/layout/divider/DynamicDivider.js.map +1 -0
- package/build/layout/external/DynamicExternal.js +17 -28
- package/build/layout/external/DynamicExternal.js.map +1 -0
- package/build/layout/external/DynamicExternal.messages.js +6 -5
- package/build/layout/external/DynamicExternal.messages.js.map +1 -0
- package/build/layout/form/DynamicForm.js +11 -21
- package/build/layout/form/DynamicForm.js.map +1 -0
- package/build/layout/heading/DynamicHeading.js +13 -23
- package/build/layout/heading/DynamicHeading.js.map +1 -0
- package/build/layout/icon/DynamicIcon.js +10 -10
- package/build/layout/icon/DynamicIcon.js.map +1 -0
- package/build/layout/image/DynamicImage.js +44 -93
- package/build/layout/image/DynamicImage.js.map +1 -0
- package/build/layout/index.js +22 -29
- package/build/layout/index.js.map +1 -0
- package/build/layout/info/DynamicInfo.js +8 -19
- package/build/layout/info/DynamicInfo.js.map +1 -0
- package/build/layout/list/DynamicList.js +15 -26
- package/build/layout/list/DynamicList.js.map +1 -0
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +9 -9
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.js +20 -37
- package/build/layout/paragraph/DynamicParagraph.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +7 -6
- package/build/layout/paragraph/DynamicParagraph.messages.js.map +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +5 -4
- package/build/layout/paragraph/useSnackBarIfAvailable.js.map +1 -0
- package/build/layout/review/DynamicReview.js +15 -26
- package/build/layout/review/DynamicReview.js.map +1 -0
- package/build/layout/utils.js +5 -6
- package/build/layout/utils.js.map +1 -0
- package/build/step/cameraStep/CameraStep.js +43 -88
- package/build/step/cameraStep/CameraStep.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +49 -105
- package/build/step/cameraStep/cameraCapture/CameraCapture.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +11 -28
- package/build/step/cameraStep/cameraCapture/components/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +18 -72
- package/build/step/cameraStep/cameraCapture/hooks/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +34 -45
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +9 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +7 -6
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +10 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/screens/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +18 -99
- package/build/step/cameraStep/cameraCapture/tracking/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +34 -96
- package/build/step/cameraStep/cameraCapture/utils/index.js.map +1 -0
- package/build/step/cameraStep/index.js +7 -14
- package/build/step/cameraStep/index.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +21 -21
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +9 -8
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js.map +1 -0
- package/build/step/externalConfirmationStep/index.js +7 -14
- package/build/step/externalConfirmationStep/index.js.map +1 -0
- package/build/step/index.js +8 -15
- package/build/step/index.js.map +1 -0
- package/build/step/layoutStep/LayoutStep.js +20 -19
- package/build/step/layoutStep/LayoutStep.js.map +1 -0
- package/build/step/layoutStep/index.js +7 -14
- package/build/step/layoutStep/index.js.map +1 -0
- package/build/step/layoutStep/utils/index.js +4 -14
- package/build/step/layoutStep/utils/index.js.map +1 -0
- package/build/step/layoutStep/utils/inline-reference-utils.js +30 -46
- package/build/step/layoutStep/utils/inline-reference-utils.js.map +1 -0
- package/build/step/layoutStep/utils/layout-utils.js +35 -53
- package/build/step/layoutStep/utils/layout-utils.js.map +1 -0
- package/build/types/common/FormControl.js +2 -1
- package/build/types/common/FormControl.js.map +1 -0
- package/build/types/index.js +14 -13
- package/build/types/index.js.map +1 -0
- package/build/types/specification/Action.js +2 -1
- package/build/types/specification/Action.js.map +1 -0
- package/build/types/specification/FileUploadSchema.js +2 -1
- package/build/types/specification/FileUploadSchema.js.map +1 -0
- package/build/types/specification/LayoutComponent.js +2 -1
- package/build/types/specification/LayoutComponent.js.map +1 -0
- package/build/types/specification/Model.js +10 -17
- package/build/types/specification/Model.js.map +1 -0
- package/build/types/specification/PersistAsync.js +2 -1
- package/build/types/specification/PersistAsync.js.map +1 -0
- package/build/types/specification/Polling.js +2 -1
- package/build/types/specification/Polling.js.map +1 -0
- package/build/types/specification/Promotion.js +2 -1
- package/build/types/specification/Promotion.js.map +1 -0
- package/build/types/specification/Schema.js +9 -8
- package/build/types/specification/Schema.js.map +1 -0
- package/build/types/specification/Step.js +4 -5
- package/build/types/specification/Step.js.map +1 -0
- package/build/types/specification/ValidationAsync.js +2 -1
- package/build/types/specification/ValidationAsync.js.map +1 -0
- package/build/types/specification/core.js +2 -1
- package/build/types/specification/core.js.map +1 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -13,23 +13,27 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
exports.translations = exports.fixtures = exports.isValidSchema = exports.Layout = exports.JsonSchemaForm = exports.makeFetcher = exports.DynamicFlow = exports.inlineReferences = exports.convertStepToLayout = void 0;
|
|
18
21
|
var utils_1 = require("./step/layoutStep/utils");
|
|
19
|
-
|
|
20
|
-
|
|
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; } });
|
|
21
24
|
var dynamicFlow_1 = require("./dynamicFlow");
|
|
22
|
-
|
|
25
|
+
Object.defineProperty(exports, "DynamicFlow", { enumerable: true, get: function () { return __importDefault(dynamicFlow_1).default; } });
|
|
23
26
|
var makeFetcher_1 = require("./common/makeFetcher");
|
|
24
|
-
|
|
27
|
+
Object.defineProperty(exports, "makeFetcher", { enumerable: true, get: function () { return makeFetcher_1.makeFetcher; } });
|
|
25
28
|
var jsonSchemaForm_1 = require("./jsonSchemaForm");
|
|
26
|
-
|
|
29
|
+
Object.defineProperty(exports, "JsonSchemaForm", { enumerable: true, get: function () { return __importDefault(jsonSchemaForm_1).default; } });
|
|
27
30
|
var layout_1 = require("./layout");
|
|
28
|
-
|
|
31
|
+
Object.defineProperty(exports, "Layout", { enumerable: true, get: function () { return layout_1.DynamicLayout; } });
|
|
29
32
|
var validators_1 = require("./common/validators");
|
|
30
|
-
|
|
33
|
+
Object.defineProperty(exports, "isValidSchema", { enumerable: true, get: function () { return validators_1.isValidSchema; } });
|
|
31
34
|
var fixtures_1 = require("./fixtures");
|
|
32
|
-
|
|
35
|
+
Object.defineProperty(exports, "fixtures", { enumerable: true, get: function () { return fixtures_1.fixtures; } });
|
|
33
36
|
var i18n_1 = require("./i18n");
|
|
34
|
-
|
|
37
|
+
Object.defineProperty(exports, "translations", { enumerable: true, get: function () { return __importDefault(i18n_1).default; } });
|
|
35
38
|
__exportStar(require("./dynamicFlow/DynamicFlow"), exports);
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,iDAAgF;AAAvE,4GAAA,mBAAmB,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAC9C,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,oDAAmD;AAA1C,0GAAA,WAAW,OAAA;AACpB,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAClC,mCAAmD;AAA1C,gGAAA,aAAa,OAAU;AAChC,kDAAoD;AAA3C,2GAAA,aAAa,OAAA;AAEtB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAEjB,+BAAiD;AAAxC,qHAAA,OAAO,OAAgB;AAEhC,4DAA0C"}
|
|
@@ -1,34 +1,23 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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);
|
|
22
11
|
if ((0, contexts_1.useHasFetcherProvider)() || schemaProps.baseUrl == null) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(genericSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(genericSchema_1.default, Object.assign({}, schemaProps));
|
|
24
13
|
}
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)(Providers,
|
|
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)) })));
|
|
26
15
|
};
|
|
27
|
-
exports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, __assign({ flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog !== null && onLog !== void 0 ? onLog : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, __assign({ metadata: { flowId: 'JsonSchemaForm', stepId: 'JsonSchemaForm' }, onEvent: onEvent !== null && onEvent !== void 0 ? onEvent : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProviderFromBaseUrl, __assign({ baseUrl: baseUrl }, { children: children })) })) })));
|
|
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 })) })) })));
|
|
31
19
|
};
|
|
32
|
-
|
|
20
|
+
const noop = () => {
|
|
33
21
|
// noop
|
|
34
22
|
};
|
|
23
|
+
//# sourceMappingURL=JsonSchemaForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonSchemaForm.js","sourceRoot":"","sources":["../../src/jsonSchemaForm/JsonSchemaForm.tsx"],"names":[],"mappings":";;;;;;AAAA,iDAO4B;AAI5B,oEAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,KAA0B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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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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) => {
|
|
23
12
|
// If wew receive a model, break it down to parts valid for each schema
|
|
24
|
-
return schemas.map(
|
|
13
|
+
return schemas.map((schema) => (0, validators_1.getValidObjectModelParts)(model, schema) || {});
|
|
25
14
|
};
|
|
26
|
-
|
|
27
|
-
return models.reduce(
|
|
28
|
-
return
|
|
15
|
+
const combineModels = (models) => {
|
|
16
|
+
return models.reduce((current, combined) => {
|
|
17
|
+
return Object.assign(Object.assign({}, combined), current);
|
|
29
18
|
}, {});
|
|
30
19
|
};
|
|
31
|
-
|
|
20
|
+
const getSchemaColumnClasses = (width) => {
|
|
32
21
|
return {
|
|
33
22
|
'col-xs-12': true,
|
|
34
23
|
'col-sm-6': width === 'md',
|
|
35
|
-
'col-sm-4': width === 'sm'
|
|
24
|
+
'col-sm-4': width === 'sm',
|
|
36
25
|
};
|
|
37
26
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
const AllOfSchema = (props) => {
|
|
28
|
+
const onChangeModelIndex = (index, onChangeProps) => {
|
|
29
|
+
const modelSchema = props.schema.allOf[index];
|
|
41
30
|
// FIXME we should not mutate models here
|
|
42
31
|
// eslint-disable-next-line fp/no-mutation
|
|
43
32
|
models[index] = (0, validators_1.getValidObjectModelParts)(onChangeProps.model, modelSchema) || {};
|
|
44
33
|
setModels(models);
|
|
45
|
-
props.onChange(
|
|
34
|
+
props.onChange(Object.assign(Object.assign({}, onChangeProps), { model: combineModels(models) }));
|
|
46
35
|
};
|
|
47
|
-
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.title && (0, jsx_runtime_1.jsx)("h3",
|
|
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) => (
|
|
49
38
|
// eslint-disable-next-line react/no-array-index-key
|
|
50
|
-
(0, jsx_runtime_1.jsx)("div",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
model: onChangeProps.model }));
|
|
54
|
-
}, onPersistAsync: props.onPersistAsync }) }), index)); }) }))] }));
|
|
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))) }))] }));
|
|
55
42
|
};
|
|
56
43
|
AllOfSchema.defaultProps = {
|
|
57
|
-
disabled: false
|
|
44
|
+
disabled: false,
|
|
58
45
|
};
|
|
59
|
-
exports
|
|
46
|
+
exports.default = AllOfSchema;
|
|
47
|
+
//# sourceMappingURL=AllOfSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllOfSchema.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/allOfSchema/AllOfSchema.tsx"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,iCAAiC;AAEjC,wDAAmE;AAGnE,qEAA6C;AAG7C,MAAM,UAAU,GAAG,CAAC,KAAkB,EAAE,OAAiB,EAAE,EAAE;IAC3D,uEAAuE;IACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,qCAAwB,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAE,EAAE;IAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,OAAoB,EAAE,QAAqB,EAAE,EAAE;QACnE,uCAAY,QAAQ,GAAK,OAAO,EAAG;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC3D,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,KAAK,KAAK,IAAI;QAC1B,UAAU,EAAE,KAAK,KAAK,IAAI;KAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC9C,MAAM,kBAAkB,GAAG,CACzB,KAAa,EACb,aAAoE,EACpE,EAAE;QACF,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK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a,CAAC,KAAgC,IACrD,EAEJ,cAAc,EAAE,KAAK,CAAC,cAAc,GACpC,KAfM,KAAK,CAgBT,CACP,CAAC,IACE,IACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAOF,WAAW,CAAC,YAAY,GAAG;IACzB,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
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;
|
|
15
7
|
var AllOfSchema_1 = require("./AllOfSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(AllOfSchema_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/allOfSchema/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAA/B,uHAAA,OAAO,OAAA"}
|
|
@@ -1,30 +1,20 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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;
|
|
22
11
|
if ((0, types_1.isListArraySchema)(schema)) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(ArrayListSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(ArrayListSchema_1.default, Object.assign({}, props));
|
|
24
13
|
}
|
|
25
14
|
throw new Error('Not implemented'); // Tuple not implemented
|
|
26
15
|
};
|
|
27
16
|
ArraySchema.defaultProps = {
|
|
28
|
-
required: false
|
|
17
|
+
required: false,
|
|
29
18
|
};
|
|
30
|
-
exports
|
|
19
|
+
exports.default = ArraySchema;
|
|
20
|
+
//# sourceMappingURL=ArraySchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArraySchema.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx"],"names":[],"mappings":";;;;;;AAAA,uCAA4F;AAG5F,wFAAgE;AAEhE,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,IAAI,IAAA,yBAAiB,EAAC,MAAM,CAAC,EAAE;QAC7B,OAAO,uBAAC,yBAAe,oBAAK,KAAK,EAAI,CAAC;KACvC;IAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,wBAAwB;AAC9D,CAAC,CAAC;AAQF,WAAW,CAAC,YAAY,GAAG;IACzB,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -1,31 +1,21 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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;
|
|
22
11
|
if ((0, Schema_1.isMultipleFileUploadSchema)(schema)) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(multipleFileUploadSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(multipleFileUploadSchema_1.default, Object.assign({}, props, { schema: schema }));
|
|
24
13
|
}
|
|
25
14
|
throw new Error('Not implemented');
|
|
26
15
|
};
|
|
27
16
|
ArrayListSchema.defaultProps = {
|
|
28
17
|
errors: null,
|
|
29
|
-
required: false
|
|
18
|
+
required: false,
|
|
30
19
|
};
|
|
31
|
-
exports
|
|
20
|
+
exports.default = ArrayListSchema;
|
|
21
|
+
//# sourceMappingURL=ArrayListSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayListSchema.js","sourceRoot":"","sources":["../../../../src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx"],"names":[],"mappings":";;;;;;AACA,gEAAiF;AAGjF,0FAAkE;AAElE,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,EAAE;IACvC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,IAAA,mCAA0B,EAAC,MAAM,CAAC,EAAE;QACtC,OAAO,uBAAC,kCAAwB,oBAAK,KAAK,IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;KAChE;IAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC;AAQF,eAAe,CAAC,YAAY,GAAG;IAC7B,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
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;
|
|
15
7
|
var ArrayListSchema_1 = require("./ArrayListSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ArrayListSchema_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAAnC,2HAAA,OAAO,OAAA"}
|
|
@@ -1,145 +1,87 @@
|
|
|
1
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
4
|
};
|
|
52
|
-
exports
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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) => {
|
|
66
19
|
var _a, _b;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case 3:
|
|
91
|
-
response = _a.sent();
|
|
92
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'success', schemaId: schema.$id });
|
|
93
|
-
return [2 /*return*/, (0, utils_2.constructUploadResponse)(response)];
|
|
94
|
-
case 4:
|
|
95
|
-
error_1 = _a.sent();
|
|
96
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'failure', schemaId: schema.$id });
|
|
97
|
-
return [2 /*return*/, Promise.reject((0, utils_2.constructUploadError)(error_1))];
|
|
98
|
-
case 5: return [2 /*return*/];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}); };
|
|
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
|
+
};
|
|
102
43
|
function onFilesChange(newFiles) {
|
|
103
44
|
if ((0, utils_1.areFilesSame)(newFiles, files)) {
|
|
104
45
|
return;
|
|
105
46
|
}
|
|
106
47
|
setFiles(newFiles);
|
|
107
|
-
|
|
108
|
-
|
|
48
|
+
const validFiles = getSuccessfullyProcessedFiles(newFiles);
|
|
49
|
+
const data = validFiles.map((file) => file.id);
|
|
109
50
|
onChange({
|
|
110
51
|
model: data,
|
|
111
52
|
triggerSchema: schema,
|
|
112
|
-
triggerModel: data
|
|
53
|
+
triggerModel: data,
|
|
113
54
|
});
|
|
114
55
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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) ||
|
|
119
60
|
((inputChanged || props.submitted) && Boolean(fileListValidationFailures.length));
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
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:
|
|
124
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
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 })] })));
|
|
125
66
|
};
|
|
126
67
|
MultipleFileUploadSchema.defaultProps = {
|
|
127
68
|
errors: null,
|
|
128
|
-
required: false
|
|
69
|
+
required: false,
|
|
129
70
|
};
|
|
130
|
-
exports
|
|
71
|
+
exports.default = MultipleFileUploadSchema;
|
|
131
72
|
function getSuccessfullyProcessedFiles(allFiles) {
|
|
132
|
-
return allFiles.filter(
|
|
73
|
+
return allFiles.filter((file) => !file.error && file.status === 'succeeded');
|
|
133
74
|
}
|
|
134
75
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
135
76
|
return fileIds
|
|
136
|
-
.map(
|
|
137
|
-
.filter(
|
|
77
|
+
.map((id) => (isValidId(id) ? { id, status: components_1.Status.SUCCEEDED } : null))
|
|
78
|
+
.filter((item) => item !== null);
|
|
138
79
|
}
|
|
139
80
|
function isValidId(id) {
|
|
140
81
|
return (0, validators_1.isNumber)(id) || (0, validators_1.isString)(id);
|
|
141
82
|
}
|
|
142
83
|
function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
143
|
-
|
|
144
|
-
return
|
|
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 }));
|
|
145
86
|
}
|
|
87
|
+
//# sourceMappingURL=MultipleFileUploadSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleFileUploadSchema.js","sourceRoot":"","sources":["../../../../../src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAA6F;AAE7F,4DAAoC;AACpC,iCAA0C;AAE1C,0DAAiE;AACjE,oDAA2D;AAC3D,oDAAuF;AACvF,8DAA+F;AAE/F,6CAG2B;AAC3B,+EAAuD;AAGvD,mCAAuF;AACvF,+FAA4F;AAE5F,MAAM,wBAAwB,GAAG,CAAC,KAAY,EAAE,EAAE;;IAChD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEnC,MAAM,OAAO,GAAG,IAAA,6BAAkB,GAAE,CAAC;IAErC,MAAM,oBAAoB,GAAG,IAAA,mEAAgC,EAAC,MAAM,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,IAAA,wBAAgB,GAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAExD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,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
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
minItemsError: {
|
|
6
6
|
id: 'dynamicFlows.MultipleFileUploadSchema.minItemsError',
|
|
7
7
|
defaultMessage: 'Please upload at least {minItems} file(s).',
|
|
8
|
-
description: 'Customer has uploaded not enough files. To fix: upload more files.'
|
|
8
|
+
description: 'Customer has uploaded not enough files. To fix: upload more files.',
|
|
9
9
|
},
|
|
10
10
|
maxItemsError: {
|
|
11
11
|
id: 'dynamicFlows.MultipleFileUploadSchema.maxItemsError',
|
|
12
12
|
defaultMessage: 'Please upload {maxItems} or fewer files.',
|
|
13
|
-
description: 'Customer has uploaded too many files. To fix: upload fewer files.'
|
|
13
|
+
description: 'Customer has uploaded too many files. To fix: upload fewer files.',
|
|
14
14
|
},
|
|
15
15
|
maxFileSizeError: {
|
|
16
16
|
id: 'dynamicFlows.MultipleFileUploadSchema.maxFileSizeError',
|
|
17
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
|
-
}
|
|
18
|
+
description: "Customer has uploaded a file that's too big. To fix: upload a smaller file.",
|
|
19
|
+
},
|
|
20
20
|
});
|
|
21
|
+
//# sourceMappingURL=MultipleFileUploadSchema.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleFileUploadSchema.messages.js","sourceRoot":"","sources":["../../../../../src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,aAAa,EAAE;QACb,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,4CAA4C;QAC5D,WAAW,EAAE,oEAAoE;KAClF;IACD,aAAa,EAAE;QACb,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,0CAA0C;QAC1D,WAAW,EAAE,mEAAmE;KACjF;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,wDAAwD;QAC5D,cAAc,EAAE,4DAA4D;QAC5E,WAAW,EAAE,6EAA6E;KAC3F;CACF,CAAC,CAAC"}
|