@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
|
@@ -1,60 +1,40 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
|
-
exports
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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 contexts_1 = require("../../common/contexts");
|
|
10
|
+
const hooks_1 = require("../../common/hooks");
|
|
11
|
+
const utils_1 = require("../../common/utils");
|
|
12
|
+
const validators_1 = require("../../common/validators");
|
|
13
|
+
const layout_1 = require("../../layout");
|
|
14
|
+
const controlFeedback_1 = __importDefault(require("../controlFeedback"));
|
|
15
|
+
const genericSchema_1 = __importDefault(require("../genericSchema"));
|
|
16
|
+
const help_1 = __importDefault(require("../help"));
|
|
17
|
+
const schemaFormControl_1 = __importDefault(require("../schemaFormControl"));
|
|
18
|
+
const utils_2 = require("./utils");
|
|
19
|
+
const OneOfSchema = (props) => {
|
|
20
|
+
const onEvent = (0, contexts_1.useEventDispatcher)();
|
|
21
|
+
const [changed, setChanged] = (0, react_1.useState)(false);
|
|
22
|
+
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
23
|
+
const [blurred, setBlurred] = (0, react_1.useState)(false);
|
|
24
|
+
const id = (0, react_1.useMemo)(() => props.schema.$id || (0, utils_1.generateRandomId)(), [props.schema.$id]);
|
|
25
|
+
const [schemaIndex, setSchemaIndex] = (0, react_1.useState)((0, utils_2.getActiveSchemaIndex)(props.schema, props.model));
|
|
26
|
+
const [models, setModels] = (0, react_1.useState)(getModelPartsForSchemas(props.model, props.schema.oneOf));
|
|
27
|
+
const debouncedTrackEvent = (0, hooks_1.useDebouncedFunction)(onEvent, 200);
|
|
28
|
+
const onSearchChange = (searchValue) => {
|
|
49
29
|
debouncedTrackEvent('Dynamic Flow - OneOf Searched', {
|
|
50
30
|
oneOfId: props.schema.analyticsId,
|
|
51
|
-
searchValueLength: searchValue.length
|
|
31
|
+
searchValueLength: searchValue.length,
|
|
52
32
|
});
|
|
53
33
|
};
|
|
54
34
|
// When the schema we receive from parent changes
|
|
55
|
-
(0, react_1.useEffect)(
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
const modelIndex = (0, utils_2.getValidIndexFromValue)(props.schema, props.model);
|
|
37
|
+
const defaultIndex = (0, utils_2.getValidIndexFromValue)(props.schema, props.schema.default);
|
|
58
38
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
59
39
|
onChooseNewSchema(defaultIndex, 'init');
|
|
60
40
|
}
|
|
@@ -64,30 +44,30 @@ var OneOfSchema = function (props) {
|
|
|
64
44
|
console.error('Incorrect format', props.schema);
|
|
65
45
|
return null;
|
|
66
46
|
}
|
|
67
|
-
|
|
68
|
-
setModels(
|
|
47
|
+
const onChildModelChange = (index, onChangeParameters) => {
|
|
48
|
+
setModels([...models.slice(0, index), onChangeParameters.model, ...models.slice(index + 1)]);
|
|
69
49
|
setChanged(true);
|
|
70
50
|
props.onChange(onChangeParameters);
|
|
71
51
|
};
|
|
72
|
-
|
|
52
|
+
const onFocus = () => {
|
|
73
53
|
setFocused(true);
|
|
74
54
|
};
|
|
75
|
-
|
|
55
|
+
const onBlur = () => {
|
|
76
56
|
setFocused(false);
|
|
77
57
|
setBlurred(true);
|
|
78
58
|
};
|
|
79
59
|
// TODO: LOW avoid type assertion
|
|
80
|
-
|
|
60
|
+
const onChooseNewSchema = (index, type) => {
|
|
81
61
|
setSchemaIndex(index);
|
|
82
|
-
|
|
62
|
+
const newSchema = props.schema.oneOf[index];
|
|
83
63
|
if ((0, utils_2.isConstSchema)(newSchema)) {
|
|
84
64
|
// If new schema is a const we want to share the parent schema, not the const
|
|
85
|
-
|
|
65
|
+
const model = newSchema.const;
|
|
86
66
|
props.onChange({
|
|
87
|
-
model
|
|
67
|
+
model,
|
|
88
68
|
triggerSchema: props.schema,
|
|
89
69
|
triggerModel: model,
|
|
90
|
-
type
|
|
70
|
+
type,
|
|
91
71
|
});
|
|
92
72
|
}
|
|
93
73
|
else {
|
|
@@ -95,34 +75,34 @@ var OneOfSchema = function (props) {
|
|
|
95
75
|
model: models[index],
|
|
96
76
|
triggerSchema: newSchema,
|
|
97
77
|
triggerModel: models[index],
|
|
98
|
-
type
|
|
78
|
+
type,
|
|
99
79
|
});
|
|
100
80
|
}
|
|
101
81
|
if (type !== 'init' && props.schema.analyticsId) {
|
|
102
82
|
onEvent('Dynamic Flow - OneOf Selected', {
|
|
103
83
|
oneOfId: props.schema.analyticsId,
|
|
104
|
-
schemaId: newSchema === null || newSchema === void 0 ? void 0 : newSchema.analyticsId
|
|
84
|
+
schemaId: newSchema === null || newSchema === void 0 ? void 0 : newSchema.analyticsId,
|
|
105
85
|
});
|
|
106
86
|
}
|
|
107
87
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
const schemaForSelect = mapSchemasForSelect(props.schema);
|
|
89
|
+
const validations = getValidations(props, schemaIndex);
|
|
90
|
+
const formGroupClasses = {
|
|
111
91
|
'form-group': true,
|
|
112
92
|
'has-error': (!changed && props.errors && !(0, validators_1.isEmpty)(props.errors)) ||
|
|
113
|
-
((props.submitted || (changed && blurred)) && validations.length)
|
|
93
|
+
((props.submitted || (changed && blurred)) && validations.length),
|
|
114
94
|
};
|
|
115
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(props.schema.oneOf.length > 1 || (0, utils_2.isConstSchema)(props.schema.oneOf[0])) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div",
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(props.schema.oneOf.length > 1 || (0, utils_2.isConstSchema)(props.schema.oneOf[0])) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(formGroupClasses) }, { children: [getTitleAndHelp(props.schema, id), (0, jsx_runtime_1.jsx)(schemaFormControl_1.default, { id: id, schema: schemaForSelect, value: schemaIndex, disabled: props.disabled, onChange: onChooseNewSchema, onFocus: onFocus, onBlur: onBlur, onSearchChange: onSearchChange }), (0, jsx_runtime_1.jsx)(controlFeedback_1.default, { changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: errorsToString(props.errors), schema: props.schema, validations: validations, infoMessage: null })] })), props.schema.alert && (0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: props.schema.alert })] })), (0, utils_2.isNoNConstSchema)(props.schema.oneOf[schemaIndex]) && ((0, jsx_runtime_1.jsx)(genericSchema_1.default, { schema: props.schema.oneOf[schemaIndex], model: models[schemaIndex], errors: props.errors, submitted: props.submitted, hideTitle: true, disabled: props.disabled, onChange: (parameters) => onChildModelChange(schemaIndex, parameters), onPersistAsync: props.onPersistAsync }))] }));
|
|
116
96
|
};
|
|
117
97
|
function getTitleAndHelp(schema, id) {
|
|
118
|
-
|
|
119
|
-
|
|
98
|
+
const helpElement = schema.help ? (0, jsx_runtime_1.jsx)(help_1.default, { help: schema.help }) : null;
|
|
99
|
+
const titleElement = (0, utils_2.isConstSchema)(schema.oneOf[0]) ? ((0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "control-label d-inline", htmlFor: id }, { children: [schema.title, " ", helpElement] }))) : ((0, jsx_runtime_1.jsxs)("h4", Object.assign({ className: "m-b-2" }, { children: [schema.title, " ", helpElement] })));
|
|
120
100
|
return schema.title ? titleElement : helpElement;
|
|
121
101
|
}
|
|
122
102
|
function getValidations(props, schemaIndex) {
|
|
123
|
-
|
|
103
|
+
const selectedSchema = props.schema.oneOf[schemaIndex !== null && schemaIndex !== void 0 ? schemaIndex : -1];
|
|
124
104
|
if ((0, utils_2.isConstSchema)(selectedSchema)) {
|
|
125
|
-
return (0, validators_1.getValidationFailures)(selectedSchema
|
|
105
|
+
return (0, validators_1.getValidationFailures)(selectedSchema.const, props.schema, !!props.required);
|
|
126
106
|
}
|
|
127
107
|
if (schemaIndex === null || schemaIndex < 0) {
|
|
128
108
|
return (0, validators_1.getValidationFailures)(null, props.schema, !!props.required);
|
|
@@ -137,19 +117,20 @@ function errorsToString(errors) {
|
|
|
137
117
|
return null;
|
|
138
118
|
}
|
|
139
119
|
function getModelPartsForSchemas(model, schemas) {
|
|
140
|
-
return schemas.map(
|
|
120
|
+
return schemas.map((schema) => (0, validators_1.getValidModelParts)(model, schema));
|
|
141
121
|
}
|
|
142
122
|
// We want our model to be the index, so alter the oneOf schemas to be a const
|
|
143
123
|
function mapSchemasForSelect(schema) {
|
|
144
|
-
return
|
|
124
|
+
return Object.assign(Object.assign({}, schema), { oneOf: schema.oneOf.map(mapOneOfToConst) });
|
|
145
125
|
}
|
|
146
126
|
function mapOneOfToConst(schema, index) {
|
|
147
|
-
|
|
127
|
+
const { title, description, disabled = false, icon, image, keywords } = schema;
|
|
148
128
|
// TODO LOW avoid type assertion below -- consider adding { type: 'integer' }
|
|
149
|
-
return { title
|
|
129
|
+
return { title, description, disabled, icon, image, const: index, keywords };
|
|
150
130
|
}
|
|
151
131
|
OneOfSchema.defaultProps = {
|
|
152
132
|
required: false,
|
|
153
|
-
disabled: false
|
|
133
|
+
disabled: false,
|
|
154
134
|
};
|
|
155
|
-
exports
|
|
135
|
+
exports.default = OneOfSchema;
|
|
136
|
+
//# sourceMappingURL=OneOfSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OneOfSchema.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx"],"names":[],"mappings":";;;;;;AAAA,4DA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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 OneOfSchema_1 = require("./OneOfSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(OneOfSchema_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/oneOfSchema/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAA/B,uHAAA,OAAO,OAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isNoNConstSchema = exports.isConstSchema = void 0;
|
|
4
|
-
|
|
4
|
+
const validators_1 = require("../../../common/validators");
|
|
5
5
|
// TODO HD Move this out of here
|
|
6
6
|
function isConstSchema(schema) {
|
|
7
|
-
return !(0, validators_1.isUndefined)(schema === null || schema === void 0 ? void 0 : schema
|
|
7
|
+
return !(0, validators_1.isUndefined)(schema === null || schema === void 0 ? void 0 : schema.const);
|
|
8
8
|
}
|
|
9
9
|
exports.isConstSchema = isConstSchema;
|
|
10
10
|
function isNoNConstSchema(schema) {
|
|
11
11
|
return !!schema && !isConstSchema(schema);
|
|
12
12
|
}
|
|
13
13
|
exports.isNoNConstSchema = isNoNConstSchema;
|
|
14
|
+
//# sourceMappingURL=const-schema-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const-schema-utils.js","sourceRoot":"","sources":["../../../../src/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,gCAAgC;AAChC,SAAgB,aAAa,CAAC,MAA0B;IACtD,OAAO,CAAC,IAAA,wBAAW,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB,CAAC,MAA0B;IACzD,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAFD,4CAEC"}
|
|
@@ -13,6 +13,7 @@ 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
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./const-schema-utils"), exports);
|
|
18
18
|
__exportStar(require("./one-of-utils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jsonSchemaForm/oneOfSchema/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iDAA+B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBestMatchingSchemaIndexForValue = exports.getValidIndexFromValue = exports.getActiveSchemaIndex = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const validators_1 = require("../../../common/validators");
|
|
5
|
+
const types_1 = require("../../../types");
|
|
6
|
+
const Schema_1 = require("../../../types/specification/Schema");
|
|
7
|
+
const const_schema_utils_1 = require("./const-schema-utils");
|
|
8
|
+
const getActiveSchemaIndex = (schema, model) => {
|
|
9
|
+
const indexFromModel = (0, exports.getValidIndexFromValue)(schema, model);
|
|
10
10
|
// If our model satisfies one of the schemas, use that schema.
|
|
11
11
|
if (indexFromModel >= 0) {
|
|
12
12
|
return indexFromModel;
|
|
@@ -16,7 +16,7 @@ var getActiveSchemaIndex = function (schema, model) {
|
|
|
16
16
|
return 0;
|
|
17
17
|
}
|
|
18
18
|
if ((0, const_schema_utils_1.isConstSchema)(schema.oneOf[0])) {
|
|
19
|
-
|
|
19
|
+
const indexFromDefault = (0, exports.getValidIndexFromValue)(schema, schema.default);
|
|
20
20
|
// If the default value satisfies one of the schemas, use that schema.
|
|
21
21
|
if (indexFromDefault >= 0) {
|
|
22
22
|
return indexFromDefault;
|
|
@@ -27,28 +27,27 @@ var getActiveSchemaIndex = function (schema, model) {
|
|
|
27
27
|
return getBestMatchingSchemaIndexForValue(schema, model);
|
|
28
28
|
}
|
|
29
29
|
if ((0, Schema_1.isOneOfObjectSchema)(schema) &&
|
|
30
|
-
!(0, validators_1.isUndefined)(schema
|
|
31
|
-
(0, types_1.isObjectModel)(schema
|
|
32
|
-
Object.keys(schema
|
|
30
|
+
!(0, validators_1.isUndefined)(schema.default) &&
|
|
31
|
+
(0, types_1.isObjectModel)(schema.default) &&
|
|
32
|
+
Object.keys(schema.default).length >= 1) {
|
|
33
33
|
// Even if the default value does not satisfy any of the schemas, it may be closer to one of them.
|
|
34
|
-
return getBestMatchingSchemaIndexForValue(schema, schema
|
|
34
|
+
return getBestMatchingSchemaIndexForValue(schema, schema.default);
|
|
35
35
|
}
|
|
36
36
|
// Otherwise do not default
|
|
37
37
|
return null;
|
|
38
38
|
};
|
|
39
39
|
exports.getActiveSchemaIndex = getActiveSchemaIndex;
|
|
40
|
-
|
|
41
|
-
return schema.oneOf.findIndex(
|
|
40
|
+
const getValidIndexFromValue = (schema, value) => {
|
|
41
|
+
return schema.oneOf.findIndex((childSchema) => !(0, validators_1.isUndefined)(value) && (0, validators_1.isValidSchema)(value, childSchema));
|
|
42
42
|
};
|
|
43
43
|
exports.getValidIndexFromValue = getValidIndexFromValue;
|
|
44
44
|
function getBestMatchingSchemaIndexForValue(schema, value) {
|
|
45
45
|
if (value === null || value === undefined) {
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
return getSchemaProperties(childSchema).reduce(
|
|
50
|
-
|
|
51
|
-
if ((0, const_schema_utils_1.isConstSchema)(propertySchema) && propertySchema["const"] === value[key]) {
|
|
48
|
+
const schemaPoints = schema.oneOf.map((childSchema) => {
|
|
49
|
+
return getSchemaProperties(childSchema).reduce((total, [key, propertySchema]) => {
|
|
50
|
+
if ((0, const_schema_utils_1.isConstSchema)(propertySchema) && propertySchema.const === value[key]) {
|
|
52
51
|
return total + 2;
|
|
53
52
|
}
|
|
54
53
|
else if ((0, const_schema_utils_1.isNoNConstSchema)(propertySchema) && typeof value[key] !== 'undefined') {
|
|
@@ -57,10 +56,10 @@ function getBestMatchingSchemaIndexForValue(schema, value) {
|
|
|
57
56
|
return total;
|
|
58
57
|
}, 0);
|
|
59
58
|
});
|
|
60
|
-
if (schemaPoints.every(
|
|
59
|
+
if (schemaPoints.every((p) => p === schemaPoints[0])) {
|
|
61
60
|
return null;
|
|
62
61
|
}
|
|
63
|
-
return schemaPoints.indexOf(Math.max
|
|
62
|
+
return schemaPoints.indexOf(Math.max(...schemaPoints));
|
|
64
63
|
}
|
|
65
64
|
exports.getBestMatchingSchemaIndexForValue = getBestMatchingSchemaIndexForValue;
|
|
66
65
|
function getSchemaProperties(childSchema) {
|
|
@@ -68,3 +67,4 @@ function getSchemaProperties(childSchema) {
|
|
|
68
67
|
? Object.entries(childSchema.properties)
|
|
69
68
|
: [];
|
|
70
69
|
}
|
|
70
|
+
//# sourceMappingURL=one-of-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"one-of-utils.js","sourceRoot":"","sources":["../../../../src/jsonSchemaForm/oneOfSchema/utils/one-of-utils.ts"],"names":[],"mappings":";;;AAAA,2DAAwE;AACxE,0CAAgF;AAEhF,gEAA0E;AAE1E,6DAAuE;AAEhE,MAAM,oBAAoB,GAAG,CAAC,MAAmB,EAAE,KAAY,EAAE,EAAE;IACxE,MAAM,cAAc,GAAG,IAAA,8BAAsB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7D,8DAA8D;IAC9D,IAAI,cAAc,IAAI,CAAC,EAAE;QACvB,OAAO,cAAc,CAAC;KACvB;IAED,wFAAwF;IACxF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,qCAAgB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;QAClE,OAAO,CAAC,CAAC;KACV;IAED,IAAI,IAAA,kCAAa,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;QAClC,MAAM,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxE,sEAAsE;QACtE,IAAI,gBAAgB,IAAI,CAAC,EAAE;YACzB,OAAO,gBAAgB,CAAC;SACzB;KACF;IAED,IAAI,IAAA,4BAAmB,EAAC,MAAM,CAAC,IAAI,IAAA,qBAAa,EAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE;QACzF,0FAA0F;QAC1F,OAAO,kCAAkC,CAAC,MAAM,EAA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qCAAgB,EAAC,cAAc,CAAC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE;gBAChF,OAAO,KAAK,GAAG,CAAC,CAAC;aAClB;YACD,OAAO,KAAK,CAAC;QACf,CAAC,EAAE,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IAEH,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;QACpD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;AACzD,CAAC;AApBD,gFAoBC;AAED,SAAS,mBAAmB,CAAC,WAAyB;IACpD,OAAO,WAAW,CAAC,UAAU,KAAK,IAAI,IAAI,OAAO,WAAW,CAAC,UAAU,KAAK,QAAQ;QAClF,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;QACxC,CAAC,CAAC,EAAE,CAAC;AACT,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
|
-
|
|
22
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const persistAsyncBasicSchema_1 = __importDefault(require("./persistAsyncBasicSchema"));
|
|
8
|
+
const persistAsyncBlobSchema_1 = __importDefault(require("./persistAsyncBlobSchema"));
|
|
9
|
+
const PersistAsyncSchema = (props) => {
|
|
10
|
+
const { schema } = props;
|
|
11
|
+
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
23
12
|
if (persistAsyncSchemaType === 'blob') {
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(persistAsyncBlobSchema_1
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(persistAsyncBlobSchema_1.default, Object.assign({}, props)));
|
|
25
14
|
}
|
|
26
|
-
return (0, jsx_runtime_1.jsx)(persistAsyncBasicSchema_1
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(persistAsyncBasicSchema_1.default, Object.assign({}, props));
|
|
27
16
|
};
|
|
28
17
|
PersistAsyncSchema.defaultProps = {
|
|
29
|
-
required: false
|
|
18
|
+
required: false,
|
|
30
19
|
};
|
|
31
|
-
exports
|
|
20
|
+
exports.default = PersistAsyncSchema;
|
|
21
|
+
//# sourceMappingURL=PersistAsyncSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistAsyncSchema.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx"],"names":[],"mappings":";;;;;;AAQA,wFAAgE;AAChE,sFAA8D;AAE9D,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAE,EAAE;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,sBAAsB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;IAE/D,IAAI,sBAAsB,KAAK,MAAM,EAAE;QACrC,OAAO,CACL,uBAAC,gCAAsB,oBAChB,KAEH,EACF,CACH,CAAC;KACH;IAED,OAAO,uBAAC,iCAAuB,oBAAK,KAAK,EAAI,CAAC;AAChD,CAAC,CAAC;AASF,kBAAkB,CAAC,YAAY,GAAG;IAChC,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
genericError: {
|
|
6
6
|
id: 'dynamicFlows.PersistAsyncSchema.genericError',
|
|
7
7
|
defaultMessage: 'Something went wrong, please try again later!',
|
|
8
|
-
description: 'Generic error message for persist async schema'
|
|
9
|
-
}
|
|
8
|
+
description: 'Generic error message for persist async schema',
|
|
9
|
+
},
|
|
10
10
|
});
|
|
11
|
+
//# sourceMappingURL=PersistAsyncSchema.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistAsyncSchema.messages.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,YAAY,EAAE;QACZ,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,+CAA+C;QAC/D,WAAW,EAAE,gDAAgD;KAC9D;CACF,CAAC,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 PersistAsyncSchema_1 = require("./PersistAsyncSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(PersistAsyncSchema_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jsonSchemaForm/persistAsyncSchema/index.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA+C;AAAtC,8HAAA,OAAO,OAAA"}
|