@wise/dynamic-flow-client 0.1.1 → 0.1.3
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/api/utils.d.ts +4 -0
- package/build/common/api/utils.js +13 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.d.ts +11 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.js +36 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.d.ts +4 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.js +13 -0
- package/build/common/contexts/fetcherContext/fetcherContext.d.ts +18 -0
- package/build/common/contexts/fetcherContext/fetcherContext.js +35 -0
- package/build/common/contexts/fetcherContext/index.d.ts +2 -0
- package/build/common/contexts/fetcherContext/index.js +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.d.ts +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.js +33 -0
- package/build/common/general/index.d.ts +2 -0
- package/build/common/general/index.js +22 -0
- package/build/common/hooks/useDebouncedFunction.d.ts +2 -0
- package/build/common/hooks/useDebouncedFunction.js +9 -0
- package/build/common/hooks/useDebouncedFunction.test.d.ts +1 -0
- package/build/common/hooks/useDebouncedFunction.test.js +59 -0
- package/build/common/hooks/usePersistAsync.d.ts +7 -0
- package/build/common/hooks/usePersistAsync.js +170 -0
- package/build/common/hooks/usePolling.d.ts +11 -0
- package/build/common/hooks/usePolling.js +48 -0
- package/build/common/hooks/usePrevious.d.ts +2 -0
- package/build/common/hooks/usePrevious.js +9 -0
- package/build/common/index.d.ts +4 -0
- package/build/common/index.js +4 -0
- package/build/common/logging/index.d.ts +22 -0
- package/build/common/logging/index.js +39 -0
- package/build/common/logging/spec.d.ts +1 -0
- package/build/common/logging/spec.js +45 -0
- package/build/common/messages.d.ts +8 -0
- package/build/common/messages.js +8 -0
- package/build/common/propsValues/dateMode.d.ts +4 -0
- package/build/common/propsValues/dateMode.js +4 -0
- package/build/common/propsValues/formControlType.d.ts +17 -0
- package/build/common/propsValues/formControlType.js +17 -0
- package/build/common/propsValues/monthFormat.d.ts +4 -0
- package/build/common/propsValues/monthFormat.js +4 -0
- package/build/common/propsValues/size.d.ts +7 -0
- package/build/common/propsValues/size.js +7 -0
- package/build/common/requirements.d.ts +10 -0
- package/build/common/requirements.js +50 -0
- package/build/common/schemaTypes/schemaTypes.d.ts +23 -0
- package/build/common/schemaTypes/schemaTypes.js +53 -0
- package/build/common/schemaTypes/shouldDebounceSchema.d.ts +2 -0
- package/build/common/schemaTypes/shouldDebounceSchema.js +6 -0
- package/build/common/stepTypes/stepTypes.d.ts +7 -0
- package/build/common/stepTypes/stepTypes.js +42 -0
- package/build/common/tracking/index.d.ts +15 -0
- package/build/common/tracking/index.js +33 -0
- package/build/common/tracking/spec.d.ts +1 -0
- package/build/common/tracking/spec.js +49 -0
- package/build/common/utils/file-utils.d.ts +4 -0
- package/build/common/utils/file-utils.js +45 -0
- package/build/common/utils/generate-random-id.d.ts +1 -0
- package/build/common/utils/generate-random-id.js +5 -0
- package/build/common/utils/generate-random-id.test.d.ts +1 -0
- package/build/common/utils/generate-random-id.test.js +12 -0
- package/build/common/validation/rule-validators/index.d.ts +10 -0
- package/build/common/validation/rule-validators/index.js +40 -0
- package/build/common/validation/rule-validators/spec.d.ts +1 -0
- package/build/common/validation/rule-validators/spec.js +145 -0
- package/build/common/validation/schema-validators/index.d.ts +9 -0
- package/build/common/validation/schema-validators/index.js +98 -0
- package/build/common/validation/schema-validators/spec.d.ts +1 -0
- package/build/common/validation/schema-validators/spec.js +137 -0
- package/build/common/validation/valid-model/index.d.ts +5 -0
- package/build/common/validation/valid-model/index.js +64 -0
- package/build/common/validation/valid-model/spec.d.ts +1 -0
- package/build/common/validation/valid-model/spec.js +605 -0
- package/build/common/validation/valid-model/utils.d.ts +11 -0
- package/build/common/validation/valid-model/utils.js +118 -0
- package/build/common/validation/validation-failures/index.d.ts +23 -0
- package/build/common/validation/validation-failures/index.js +140 -0
- package/build/common/validation/validation-failures/spec.d.ts +1 -0
- package/build/common/validation/validation-failures/spec.js +185 -0
- package/build/dynamic-flow-types/Action.d.ts +19 -0
- package/build/dynamic-flow-types/Action.js +1 -0
- package/build/dynamic-flow-types/FileUploadSchema.d.ts +23 -0
- package/build/dynamic-flow-types/FileUploadSchema.js +3 -0
- package/build/dynamic-flow-types/LayoutComponent.d.ts +129 -0
- package/build/dynamic-flow-types/LayoutComponent.js +1 -0
- package/build/dynamic-flow-types/Model.d.ts +12 -0
- package/build/dynamic-flow-types/Model.js +28 -0
- package/build/dynamic-flow-types/PersistAsync.d.ts +8 -0
- package/build/dynamic-flow-types/PersistAsync.js +1 -0
- package/build/dynamic-flow-types/Polling.d.ts +12 -0
- package/build/dynamic-flow-types/Polling.js +1 -0
- package/build/dynamic-flow-types/Promotion.d.ts +20 -0
- package/build/dynamic-flow-types/Promotion.js +1 -0
- package/build/dynamic-flow-types/Schema.d.ts +184 -0
- package/build/dynamic-flow-types/Schema.js +49 -0
- package/build/dynamic-flow-types/Step.d.ts +127 -0
- package/build/dynamic-flow-types/Step.js +4 -0
- package/build/dynamic-flow-types/ValidationAsync.d.ts +6 -0
- package/build/dynamic-flow-types/ValidationAsync.js +1 -0
- package/build/dynamic-flow-types/core.d.ts +29 -0
- package/build/dynamic-flow-types/core.js +1 -0
- package/build/dynamic-flow-types/index.d.ts +14 -0
- package/build/dynamic-flow-types/index.js +12 -0
- package/build/field/Field.d.ts +69 -0
- package/build/field/Field.js +311 -0
- package/build/field/index.d.ts +2 -0
- package/build/field/index.js +2 -0
- package/build/flow/DynamicFlow.d.ts +4 -0
- package/build/flow/DynamicFlow.js +368 -0
- package/build/flow/DynamicFlowStep.d.ts +9 -0
- package/build/flow/DynamicFlowStep.js +32 -0
- package/build/flow/errorBoundary/ErrorBoundary.d.ts +20 -0
- package/build/flow/errorBoundary/ErrorBoundary.js +45 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.d.ts +13 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.js +13 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +6 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.js +12 -0
- package/build/flow/errorBoundary/index.d.ts +1 -0
- package/build/flow/errorBoundary/index.js +1 -0
- package/build/flow/fixtures/components/alert.d.ts +3 -0
- package/build/flow/fixtures/components/alert.js +31 -0
- package/build/flow/fixtures/components/box.d.ts +3 -0
- package/build/flow/fixtures/components/box.js +20 -0
- package/build/flow/fixtures/components/button.d.ts +3 -0
- package/build/flow/fixtures/components/button.js +65 -0
- package/build/flow/fixtures/components/columns.d.ts +3 -0
- package/build/flow/fixtures/components/columns.js +36 -0
- package/build/flow/fixtures/components/copyable.d.ts +3 -0
- package/build/flow/fixtures/components/copyable.js +22 -0
- package/build/flow/fixtures/components/decision.d.ts +3 -0
- package/build/flow/fixtures/components/decision.js +54 -0
- package/build/flow/fixtures/components/heading.d.ts +3 -0
- package/build/flow/fixtures/components/heading.js +14 -0
- package/build/flow/fixtures/components/image.d.ts +3 -0
- package/build/flow/fixtures/components/image.js +22 -0
- package/build/flow/fixtures/components/info.d.ts +3 -0
- package/build/flow/fixtures/components/info.js +17 -0
- package/build/flow/fixtures/components/list.d.ts +3 -0
- package/build/flow/fixtures/components/list.js +34 -0
- package/build/flow/fixtures/components/loading-indicator.d.ts +3 -0
- package/build/flow/fixtures/components/loading-indicator.js +16 -0
- package/build/flow/fixtures/components/paragraph.d.ts +3 -0
- package/build/flow/fixtures/components/paragraph.js +28 -0
- package/build/flow/fixtures/components/review.d.ts +3 -0
- package/build/flow/fixtures/components/review.js +60 -0
- package/build/flow/fixtures/examples/camera-capture.d.ts +3 -0
- package/build/flow/fixtures/examples/camera-capture.js +121 -0
- package/build/flow/fixtures/examples/recipient-update.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient-update.js +250 -0
- package/build/flow/fixtures/examples/recipient.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient.js +313 -0
- package/build/flow/fixtures/examples/single-file-upload.d.ts +3 -0
- package/build/flow/fixtures/examples/single-file-upload.js +96 -0
- package/build/flow/fixtures/examples/step-validation-errors.d.ts +3 -0
- package/build/flow/fixtures/examples/step-validation-errors.js +75 -0
- package/build/flow/fixtures/features/action-response.d.ts +3 -0
- package/build/flow/fixtures/features/action-response.js +29 -0
- package/build/flow/fixtures/features/external.d.ts +3 -0
- package/build/flow/fixtures/features/external.js +31 -0
- package/build/flow/fixtures/features/persist-async.d.ts +3 -0
- package/build/flow/fixtures/features/persist-async.js +44 -0
- package/build/flow/fixtures/features/polling.d.ts +3 -0
- package/build/flow/fixtures/features/polling.js +33 -0
- package/build/flow/fixtures/index.d.ts +42 -0
- package/build/flow/fixtures/index.js +66 -0
- package/build/flow/fixtures/responses/action-response-final.d.ts +3 -0
- package/build/flow/fixtures/responses/action-response-final.js +24 -0
- package/build/flow/fixtures/responses/action.d.ts +5 -0
- package/build/flow/fixtures/responses/action.js +2 -0
- package/build/flow/fixtures/responses/exit.d.ts +6 -0
- package/build/flow/fixtures/responses/exit.js +2 -0
- package/build/flow/fixtures/responses/recipient-update-final.d.ts +3 -0
- package/build/flow/fixtures/responses/recipient-update-final.js +24 -0
- package/build/flow/fixtures/schemas/basic-form.d.ts +3 -0
- package/build/flow/fixtures/schemas/basic-form.js +39 -0
- package/build/flow/fixtures/schemas/number-and-integer.d.ts +3 -0
- package/build/flow/fixtures/schemas/number-and-integer.js +41 -0
- package/build/flow/fixtures/schemas/one-of.d.ts +3 -0
- package/build/flow/fixtures/schemas/one-of.js +223 -0
- package/build/flow/fixtures/schemas/string-formats.d.ts +3 -0
- package/build/flow/fixtures/schemas/string-formats.js +58 -0
- package/build/flow/index.d.ts +1 -0
- package/build/flow/index.js +1 -0
- package/build/flow/response-parsers/index.d.ts +17 -0
- package/build/flow/response-parsers/index.js +112 -0
- package/build/flow/response-parsers/spec.d.ts +1 -0
- package/build/flow/response-parsers/spec.js +263 -0
- package/build/flow/stories/EditableDynamicFlow.d.ts +5 -0
- package/build/flow/stories/EditableDynamicFlow.js +61 -0
- package/build/flow/types.d.ts +77 -0
- package/build/flow/types.js +3 -0
- package/build/flow/useDebouncedRefresh/index.d.ts +1 -0
- package/build/flow/useDebouncedRefresh/index.js +1 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.d.ts +5 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.js +24 -0
- package/build/flow/useDynamicFlowState.d.ts +18 -0
- package/build/flow/useDynamicFlowState.js +111 -0
- package/build/flow/useLoader.d.ts +9 -0
- package/build/flow/useLoader.js +22 -0
- package/build/formControl/FormControl.d.ts +86 -0
- package/build/formControl/FormControl.js +241 -0
- package/build/formControl/index.d.ts +1 -0
- package/build/formControl/index.js +1 -0
- package/build/formControl/types.d.ts +57 -0
- package/build/formControl/types.js +1 -0
- package/build/formControl/value-utils.d.ts +9 -0
- package/build/formControl/value-utils.js +108 -0
- package/build/i18n/cs.json +8 -0
- package/build/i18n/de.json +34 -0
- package/build/i18n/en.json +38 -0
- package/build/i18n/es.json +34 -0
- package/build/i18n/fr.json +34 -0
- package/build/i18n/hu.json +34 -0
- package/build/i18n/id.json +34 -0
- package/build/i18n/index.d.ts +2 -0
- package/build/i18n/index.js +31 -0
- package/build/i18n/it.json +34 -0
- package/build/i18n/ja.json +34 -0
- package/build/i18n/pl.json +11 -0
- package/build/i18n/pt.json +34 -0
- package/build/i18n/ro.json +34 -0
- package/build/i18n/ru.json +34 -0
- package/build/i18n/th.json +34 -0
- package/build/i18n/tr.json +11 -0
- package/build/i18n/uk.json +8 -0
- package/build/i18n/zh-CN.json +34 -0
- package/build/i18n/zh.json +34 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +11 -0
- package/build/jsonSchemaForm/JsonSchemaForm.d.ts +66 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +31 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +14 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +54 -0
- package/build/jsonSchemaForm/allOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +15 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +26 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +24 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.d.ts +9 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.js +14 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.d.ts +6 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.js +85 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +22 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +105 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +31 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +79 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts +53 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +53 -0
- package/build/jsonSchemaForm/controlFeedback/index.d.ts +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +19 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +122 -0
- package/build/jsonSchemaForm/genericSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +1 -0
- package/build/jsonSchemaForm/help/Help.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.js +9 -0
- package/build/jsonSchemaForm/help/Help.messages.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.messages.js +8 -0
- package/build/jsonSchemaForm/help/index.d.ts +1 -0
- package/build/jsonSchemaForm/help/index.js +1 -0
- package/build/jsonSchemaForm/index.d.ts +1 -0
- package/build/jsonSchemaForm/index.js +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +16 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +78 -0
- package/build/jsonSchemaForm/objectSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +15 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +153 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.js +40 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +27 -0
- package/build/jsonSchemaForm/oneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.js +7 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +21 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.js +168 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +20 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.js +127 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +17 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.js +32 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.js +8 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +7 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.js +27 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.d.ts +23 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.js +31 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.js +32 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +8 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +55 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +16 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/jsonSchemaForm/readOnlySchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +25 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +106 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.d.ts +3 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.js +73 -0
- package/build/jsonSchemaForm/schemaFormControl/index.d.ts +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +40 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.js +89 -0
- package/build/jsonSchemaForm/schemas/allOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/allOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.js +1104 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js +37 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js +36 -0
- package/build/jsonSchemaForm/schemas/currency.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/currency.json.js +48 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.js +53 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.js +56 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js +102 -0
- package/build/jsonSchemaForm/schemas/simple.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/simple.json.js +48 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.js +71 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.js +23 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +17 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +149 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +1 -0
- package/build/layout/DynamicLayout.d.ts +17 -0
- package/build/layout/DynamicLayout.js +75 -0
- package/build/layout/alert/index.d.ts +6 -0
- package/build/layout/alert/index.js +29 -0
- package/build/layout/box/index.d.ts +8 -0
- package/build/layout/box/index.js +41 -0
- package/build/layout/button/index.d.ts +8 -0
- package/build/layout/button/index.js +58 -0
- package/build/layout/columns/index.d.ts +8 -0
- package/build/layout/columns/index.js +38 -0
- package/build/layout/decision/index.d.ts +9 -0
- package/build/layout/decision/index.js +38 -0
- package/build/layout/divider/index.d.ts +7 -0
- package/build/layout/divider/index.js +9 -0
- package/build/layout/external/DynamicExternal.d.ts +8 -0
- package/build/layout/external/DynamicExternal.js +30 -0
- package/build/layout/external/DynamicExternal.messages.d.ts +8 -0
- package/build/layout/external/DynamicExternal.messages.js +8 -0
- package/build/layout/external/index.d.ts +1 -0
- package/build/layout/external/index.js +1 -0
- package/build/layout/external/useExternalStepPolling.d.ts +11 -0
- package/build/layout/external/useExternalStepPolling.js +68 -0
- package/build/layout/form/index.d.ts +8 -0
- package/build/layout/form/index.js +22 -0
- package/build/layout/heading/index.d.ts +6 -0
- package/build/layout/heading/index.js +31 -0
- package/build/layout/icon/index.d.ts +7 -0
- package/build/layout/icon/index.js +22 -0
- package/build/layout/image/index.d.ts +6 -0
- package/build/layout/image/index.js +126 -0
- package/build/layout/index.d.ts +1 -0
- package/build/layout/index.js +1 -0
- package/build/layout/info/index.d.ts +7 -0
- package/build/layout/info/index.js +19 -0
- package/build/layout/layouts/all.json.d.ts +3 -0
- package/build/layout/layouts/all.json.js +176 -0
- package/build/layout/layouts/final-step-layout.json.d.ts +3 -0
- package/build/layout/layouts/final-step-layout.json.js +39 -0
- package/build/layout/layouts/finalStep.json.d.ts +3 -0
- package/build/layout/layouts/finalStep.json.js +24 -0
- package/build/layout/layouts/list.json.d.ts +3 -0
- package/build/layout/layouts/list.json.js +33 -0
- package/build/layout/layouts/pay-in.json.d.ts +3 -0
- package/build/layout/layouts/pay-in.json.js +97 -0
- package/build/layout/layouts/review.json.d.ts +3 -0
- package/build/layout/layouts/review.json.js +160 -0
- package/build/layout/layouts/success.json.d.ts +3 -0
- package/build/layout/layouts/success.json.js +66 -0
- package/build/layout/list/index.d.ts +8 -0
- package/build/layout/list/index.js +30 -0
- package/build/layout/loading-indicator/index.d.ts +7 -0
- package/build/layout/loading-indicator/index.js +10 -0
- package/build/layout/loading-indicator/spec.d.ts +1 -0
- package/build/layout/loading-indicator/spec.js +11 -0
- package/build/layout/paragraph/DynamicParagraph.d.ts +7 -0
- package/build/layout/paragraph/DynamicParagraph.js +42 -0
- package/build/layout/paragraph/DynamicParagraph.messages.d.ts +13 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +13 -0
- package/build/layout/paragraph/index.d.ts +1 -0
- package/build/layout/paragraph/index.js +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.d.ts +10 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/layout/review/index.d.ts +9 -0
- package/build/layout/review/index.js +33 -0
- package/build/layout/utils.d.ts +7 -0
- package/build/layout/utils.js +31 -0
- package/build/main.css +143 -0
- package/build/schema.d.ts +1 -0
- package/build/schema.js +1 -0
- package/build/step/cameraStep/CameraStep.d.ts +8 -0
- package/build/step/cameraStep/CameraStep.js +125 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +16 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +122 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/components/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +28 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +4 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +80 -0
- package/build/step/cameraStep/cameraCapture/index.d.ts +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +11 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +78 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +3 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +19 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +13 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +13 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +6 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +21 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/screens/index.d.ts +2 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +2 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +7 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +101 -0
- package/build/step/cameraStep/cameraCapture/utils/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +103 -0
- package/build/step/cameraStep/index.d.ts +1 -0
- package/build/step/cameraStep/index.js +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +7 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +23 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +23 -0
- package/build/step/externalConfirmationStep/index.d.ts +1 -0
- package/build/step/externalConfirmationStep/index.js +1 -0
- package/build/step/features/external/useExternal.d.ts +4 -0
- package/build/step/features/external/useExternal.js +15 -0
- package/build/step/features/index.d.ts +2 -0
- package/build/step/features/index.js +2 -0
- package/build/step/features/polling/useStepPolling.d.ts +2 -0
- package/build/step/features/polling/useStepPolling.js +44 -0
- package/build/step/index.d.ts +3 -0
- package/build/step/index.js +3 -0
- package/build/step/layoutStep/LayoutStep.d.ts +11 -0
- package/build/step/layoutStep/LayoutStep.js +34 -0
- package/build/step/layoutStep/index.d.ts +1 -0
- package/build/step/layoutStep/index.js +1 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.d.ts +8 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.js +217 -0
- package/build/step/layoutStep/layoutService/index.d.ts +2 -0
- package/build/step/layoutStep/layoutService/index.js +2 -0
- package/build/step/layoutStep/layoutService/inlineReferences.d.ts +7 -0
- package/build/step/layoutStep/layoutService/inlineReferences.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Schema } from '../../dynamic-flow-types';
|
|
3
|
+
declare const ControlFeedback: {
|
|
4
|
+
(props: ControlFeedbackProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
errors: string;
|
|
7
|
+
validations: never[];
|
|
8
|
+
validationMessages: {};
|
|
9
|
+
validationAsyncSuccessMessage: null;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type ValidationMessages = {
|
|
13
|
+
minimum?: string;
|
|
14
|
+
maximum?: string;
|
|
15
|
+
minLength?: string;
|
|
16
|
+
maxLength?: string;
|
|
17
|
+
pattern?: string;
|
|
18
|
+
required?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ControlFeedbackProps = {
|
|
21
|
+
changed: boolean;
|
|
22
|
+
blurred: boolean;
|
|
23
|
+
focused: boolean;
|
|
24
|
+
submitted: boolean;
|
|
25
|
+
errors?: string | null;
|
|
26
|
+
validations?: string[];
|
|
27
|
+
validationMessages?: ValidationMessages;
|
|
28
|
+
schema: Schema;
|
|
29
|
+
infoMessage: string | null;
|
|
30
|
+
};
|
|
31
|
+
export default ControlFeedback;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { InlineAlert } from '@transferwise/components';
|
|
14
|
+
import { formatDate } from '@transferwise/formatting';
|
|
15
|
+
import { useIntl } from 'react-intl';
|
|
16
|
+
import controlFeedbackMessages from './ControlFeedback.messages';
|
|
17
|
+
var ControlFeedback = function (props) {
|
|
18
|
+
var _a;
|
|
19
|
+
var defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
20
|
+
var validationMessages = __assign(__assign(__assign({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
|
|
21
|
+
var isErrorVisible = (props.submitted || !props.changed) && !!props.errors;
|
|
22
|
+
var isValidationVisible = !isErrorVisible &&
|
|
23
|
+
(props.submitted || (props.changed && props.blurred)) &&
|
|
24
|
+
!!((_a = props.validations) === null || _a === void 0 ? void 0 : _a.length);
|
|
25
|
+
var isDescriptionVisible = props.focused && props.schema.description && !isValidationVisible;
|
|
26
|
+
var hasInfoMessage = !!props.infoMessage;
|
|
27
|
+
return (_jsxs("div", { children: [isErrorVisible ? _jsx(InlineAlert, __assign({ type: "error" }, { children: props.errors })) : null, isValidationVisible ? (_jsx(InlineAlert, __assign({ type: "error" }, { children: props.validations.map(function (validation) { return (_jsx("div", { children: validationMessages[validation] }, validation)); }) }))) : null, (isDescriptionVisible || hasInfoMessage) && (_jsxs(InlineAlert, __assign({ type: "info" }, { children: [isDescriptionVisible && _jsx("div", { children: props.schema.description }), hasInfoMessage && _jsx("div", { children: props.infoMessage })] })))] }));
|
|
28
|
+
};
|
|
29
|
+
ControlFeedback.defaultProps = {
|
|
30
|
+
errors: '',
|
|
31
|
+
validations: [],
|
|
32
|
+
validationMessages: {},
|
|
33
|
+
validationAsyncSuccessMessage: null
|
|
34
|
+
};
|
|
35
|
+
// TODO: avoid typre assertions in this function
|
|
36
|
+
function useDefaultValidationMessages(schema) {
|
|
37
|
+
var _a = useIntl(), formatMessage = _a.formatMessage, locale = _a.locale;
|
|
38
|
+
var formattedMessages = {
|
|
39
|
+
type: formatMessage(controlFeedbackMessages.type),
|
|
40
|
+
minimum: formatMessage(controlFeedbackMessages.minimum, {
|
|
41
|
+
minimum: schema.minimum
|
|
42
|
+
}),
|
|
43
|
+
maximum: formatMessage(controlFeedbackMessages.maximum, {
|
|
44
|
+
maximum: schema.maximum
|
|
45
|
+
}),
|
|
46
|
+
minLength: formatMessage(controlFeedbackMessages.minLength, {
|
|
47
|
+
minLength: schema.minLength
|
|
48
|
+
}),
|
|
49
|
+
maxLength: formatMessage(controlFeedbackMessages.maxLength, {
|
|
50
|
+
maxLength: schema.maxLength
|
|
51
|
+
}),
|
|
52
|
+
pattern: formatMessage(controlFeedbackMessages.pattern),
|
|
53
|
+
required: formatMessage(controlFeedbackMessages.required)
|
|
54
|
+
};
|
|
55
|
+
if (schema.format === 'date') {
|
|
56
|
+
var dateOverrides = {
|
|
57
|
+
pattern: formatMessage(controlFeedbackMessages.patternDate),
|
|
58
|
+
minimum: schema.minimum
|
|
59
|
+
? formatMessage(controlFeedbackMessages.minimumDate, {
|
|
60
|
+
minimum: formatDate(new Date(schema.minimum), locale, {
|
|
61
|
+
timeZone: 'UTC',
|
|
62
|
+
dateStyle: 'long'
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
: undefined,
|
|
66
|
+
maximum: schema.maximum
|
|
67
|
+
? formatMessage(controlFeedbackMessages.maximumDate, {
|
|
68
|
+
maximum: formatDate(new Date(schema.maximum), locale, {
|
|
69
|
+
timeZone: 'UTC',
|
|
70
|
+
dateStyle: 'long'
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
: undefined
|
|
74
|
+
};
|
|
75
|
+
return __assign(__assign({}, formattedMessages), dateOverrides);
|
|
76
|
+
}
|
|
77
|
+
return formattedMessages;
|
|
78
|
+
}
|
|
79
|
+
export default ControlFeedback;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
minimum: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
maximum: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
minLength: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
maxLength: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
minimumDate: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
maximumDate: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
pattern: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
patternDate: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
required: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
type: {
|
|
4
|
+
id: 'dynamicFlows.ControlFeedback.type',
|
|
5
|
+
defaultMessage: 'Incorrect type',
|
|
6
|
+
description: ''
|
|
7
|
+
},
|
|
8
|
+
minimum: {
|
|
9
|
+
id: 'dynamicFlows.ControlFeedback.minimum',
|
|
10
|
+
defaultMessage: "Please enter a number that's {minimum} or more.",
|
|
11
|
+
description: ''
|
|
12
|
+
},
|
|
13
|
+
maximum: {
|
|
14
|
+
id: 'dynamicFlows.ControlFeedback.maximum',
|
|
15
|
+
defaultMessage: "Please enter a number that's {maximum} or less.",
|
|
16
|
+
description: ''
|
|
17
|
+
},
|
|
18
|
+
minLength: {
|
|
19
|
+
id: 'dynamicFlows.ControlFeedback.minLength',
|
|
20
|
+
defaultMessage: 'Please enter at least {minLength} characters.',
|
|
21
|
+
description: ''
|
|
22
|
+
},
|
|
23
|
+
maxLength: {
|
|
24
|
+
id: 'dynamicFlows.ControlFeedback.maxLength',
|
|
25
|
+
defaultMessage: 'Please enter {maxLength} or fewer characters.',
|
|
26
|
+
description: ''
|
|
27
|
+
},
|
|
28
|
+
minimumDate: {
|
|
29
|
+
id: 'dynamicFlows.ControlFeedback.minimumDate',
|
|
30
|
+
defaultMessage: "Please enter a date that's on or after {minimum}.",
|
|
31
|
+
description: ''
|
|
32
|
+
},
|
|
33
|
+
maximumDate: {
|
|
34
|
+
id: 'dynamicFlows.ControlFeedback.maximumDate',
|
|
35
|
+
defaultMessage: "Please enter a date that's on or before {maximum}.",
|
|
36
|
+
description: ''
|
|
37
|
+
},
|
|
38
|
+
pattern: {
|
|
39
|
+
id: 'dynamicFlows.ControlFeedback.pattern',
|
|
40
|
+
defaultMessage: 'Please enter this in the correct format.',
|
|
41
|
+
description: ''
|
|
42
|
+
},
|
|
43
|
+
patternDate: {
|
|
44
|
+
id: 'dynamicFlows.ControlFeedback.patternDate',
|
|
45
|
+
defaultMessage: 'Please enter a date in the corrrect format.',
|
|
46
|
+
description: ''
|
|
47
|
+
},
|
|
48
|
+
required: {
|
|
49
|
+
id: 'dynamicFlows.ControlFeedback.required',
|
|
50
|
+
defaultMessage: 'Please fill out this field.',
|
|
51
|
+
description: ''
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ControlFeedback';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ControlFeedback';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormErrors, Model, Schema } from '../../dynamic-flow-types';
|
|
3
|
+
import { OnPersistAsync } from '../../schema';
|
|
4
|
+
import { OnChange } from '../JsonSchemaForm';
|
|
5
|
+
declare const GenericSchemaForm: (props: GenericSchemaFormProps) => JSX.Element;
|
|
6
|
+
export type GenericSchemaProps = {
|
|
7
|
+
schema: Schema;
|
|
8
|
+
model: Model;
|
|
9
|
+
errors: FormErrors;
|
|
10
|
+
submitted: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onChange: OnChange;
|
|
13
|
+
onPersistAsync: OnPersistAsync;
|
|
14
|
+
};
|
|
15
|
+
type GenericSchemaFormProps = GenericSchemaProps & {
|
|
16
|
+
hideTitle?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export default GenericSchemaForm;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { useLogger } from '../../common/logging';
|
|
14
|
+
import { getSchemaType } from '../../common/schemaTypes/schemaTypes';
|
|
15
|
+
import { isNullableBasicModel, isPersistAsyncSchema, isValidationAsyncSchema, isBasicSchema, isObjectSchema, isNullableObjectModel, isArraySchema, isNullableArrayModel, isOneOfSchema, isNullableStringModel, isBasicError, isObjectModel, } from '../../dynamic-flow-types';
|
|
16
|
+
import { isAllOfSchema, isOneOfObjectSchema } from '../../dynamic-flow-types/Schema';
|
|
17
|
+
import AllOfSchema from '../allOfSchema';
|
|
18
|
+
import ArraySchema from '../arrayTypeSchema';
|
|
19
|
+
import BasicTypeSchema from '../basicTypeSchema';
|
|
20
|
+
import ObjectSchema from '../objectSchema';
|
|
21
|
+
import OneOfSchema from '../oneOfSchema';
|
|
22
|
+
import PersistAsyncSchema from '../persistAsyncSchema';
|
|
23
|
+
import PromotedOneOfSchema from '../promotedOneOfSchema';
|
|
24
|
+
import ReadOnlySchema from '../readOnlySchema';
|
|
25
|
+
import ValidationAsyncSchema from '../validationAsyncSchema';
|
|
26
|
+
var GenericSchemaForm = function (props) {
|
|
27
|
+
var schema = props.schema, _a = props.model, model = _a === void 0 ? null : _a, _b = props.errors, errors = _b === void 0 ? null : _b, _c = props.hideTitle, hideTitle = _c === void 0 ? false : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d;
|
|
28
|
+
var schemaProps = __assign(__assign({}, props), { model: model, errors: errors, hideTitle: hideTitle, disabled: disabled });
|
|
29
|
+
var type = getSchemaType(schema);
|
|
30
|
+
var log = useLogger();
|
|
31
|
+
var logInvalidSchemaWarning = function () {
|
|
32
|
+
return log.error('Invalid schema or model', "Schema of type ".concat(type || 'undefined', " requested, but schema did not pass validation."));
|
|
33
|
+
};
|
|
34
|
+
switch (type) {
|
|
35
|
+
case 'readOnly':
|
|
36
|
+
return _jsx(ReadOnlySchema, __assign({}, schemaProps));
|
|
37
|
+
case 'persistAsync':
|
|
38
|
+
if (isPersistAsyncSchema(schema) && isNullableStringModel(model) && isBasicError(errors)) {
|
|
39
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
40
|
+
return _jsx(PersistAsyncSchema, __assign({}, filteredProps));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// TODO: MC-3224 Remove this once people have had a chance to fix errors
|
|
44
|
+
logInvalidSchemaWarning();
|
|
45
|
+
return _jsx(PersistAsyncSchema, __assign({}, props));
|
|
46
|
+
}
|
|
47
|
+
case 'validationAsync':
|
|
48
|
+
if (isValidationAsyncSchema(schema) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
49
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
50
|
+
return _jsx(ValidationAsyncSchema, __assign({}, filteredProps));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// TODO: MC-3224
|
|
54
|
+
logInvalidSchemaWarning();
|
|
55
|
+
return _jsx(ValidationAsyncSchema, __assign({}, props));
|
|
56
|
+
}
|
|
57
|
+
case 'basic': {
|
|
58
|
+
if (isBasicSchema(schema) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
59
|
+
var filteredProps = __assign(__assign({ infoMessage: null }, schemaProps), { schema: schema, model: model, errors: errors });
|
|
60
|
+
return _jsx(BasicTypeSchema, __assign({}, filteredProps));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
var filteredProps = __assign(__assign({ infoMessage: null }, schemaProps), { schema: schema, model: model, errors: errors });
|
|
64
|
+
// TODO: MC-3224
|
|
65
|
+
logInvalidSchemaWarning();
|
|
66
|
+
return _jsx(BasicTypeSchema, __assign({}, filteredProps));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
case 'object':
|
|
70
|
+
if (isObjectSchema(schema) && isNullableObjectModel(model)) {
|
|
71
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
72
|
+
return _jsx(ObjectSchema, __assign({}, filteredProps), JSON.stringify(schema));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// TODO: MC-3224
|
|
76
|
+
logInvalidSchemaWarning();
|
|
77
|
+
return _jsx(ObjectSchema, __assign({}, props));
|
|
78
|
+
}
|
|
79
|
+
case 'array':
|
|
80
|
+
if (isArraySchema(schema) && isNullableArrayModel(model) && isBasicError(errors)) {
|
|
81
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
82
|
+
return _jsx(ArraySchema, __assign({}, filteredProps));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// TODO: MC-3224
|
|
86
|
+
logInvalidSchemaWarning();
|
|
87
|
+
return _jsx(ArraySchema, __assign({}, props));
|
|
88
|
+
}
|
|
89
|
+
case 'promotedOneOf':
|
|
90
|
+
if (isOneOfObjectSchema(schema) && isNullableObjectModel(model)) {
|
|
91
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
92
|
+
return _jsx(PromotedOneOfSchema, __assign({}, filteredProps));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// TODO: MC-3224
|
|
96
|
+
logInvalidSchemaWarning();
|
|
97
|
+
return _jsx(PromotedOneOfSchema, __assign({}, props));
|
|
98
|
+
}
|
|
99
|
+
case 'oneOf':
|
|
100
|
+
if (isOneOfSchema(schema)) {
|
|
101
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
102
|
+
return _jsx(OneOfSchema, __assign({}, filteredProps));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// TODO: MC-3224
|
|
106
|
+
logInvalidSchemaWarning();
|
|
107
|
+
return _jsx(OneOfSchema, __assign({}, props));
|
|
108
|
+
}
|
|
109
|
+
case 'allOf':
|
|
110
|
+
if (isAllOfSchema(schema) && isObjectModel(model)) {
|
|
111
|
+
var filteredProps = __assign(__assign({}, schemaProps), { schema: schema, model: model, errors: errors });
|
|
112
|
+
return _jsx(AllOfSchema, __assign({}, filteredProps));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
// TODO: MC-3224
|
|
116
|
+
logInvalidSchemaWarning();
|
|
117
|
+
return _jsx(AllOfSchema, __assign({}, props));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return _jsx(_Fragment, {});
|
|
121
|
+
};
|
|
122
|
+
export default GenericSchemaForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './GenericSchema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './GenericSchema';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Markdown, Info } from '@transferwise/components';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import messages from './Help.messages';
|
|
5
|
+
var Help = function (props) {
|
|
6
|
+
var intl = useIntl();
|
|
7
|
+
return (_jsx(Info, { className: "m-l-1", content: _jsx(Markdown, { children: props.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": intl.formatMessage(messages.helpAria) }));
|
|
8
|
+
};
|
|
9
|
+
export default Help;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Help';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Help';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './JsonSchemaForm';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './JsonSchemaForm';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ObjectModel, ObjectSchema as ObjectSchemaType } from '../../dynamic-flow-types';
|
|
3
|
+
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
4
|
+
declare const ObjectSchema: {
|
|
5
|
+
(props: ObjectSchemaProps): JSX.Element;
|
|
6
|
+
defaultProps: {
|
|
7
|
+
hideTitle: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type ObjectSchemaProps = GenericSchemaProps & {
|
|
12
|
+
schema: ObjectSchemaType;
|
|
13
|
+
model: ObjectModel | null;
|
|
14
|
+
hideTitle?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export default ObjectSchema;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import classNames from 'classnames';
|
|
23
|
+
import isEqual from 'lodash.isequal';
|
|
24
|
+
import { useState, useEffect } from 'react';
|
|
25
|
+
import { getValidObjectModelParts } from '../../common/validation/valid-model';
|
|
26
|
+
import DynamicAlert from '../../layout/alert';
|
|
27
|
+
import GenericSchema from '../genericSchema';
|
|
28
|
+
var getSchemaColumnClasses = function (width) {
|
|
29
|
+
return {
|
|
30
|
+
'col-xs-12': true,
|
|
31
|
+
'col-sm-6': width === 'md',
|
|
32
|
+
'col-sm-4': width === 'sm'
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
var ObjectSchema = function (props) {
|
|
36
|
+
var _a = useState(function () { return (__assign({}, getValidObjectModelParts(props.model, props.schema))); }), model = _a[0], setModel = _a[1];
|
|
37
|
+
var onChangeProperty = function (propertyName, onChangeProps) {
|
|
38
|
+
if (onChangeProps.model !== null) {
|
|
39
|
+
// FIXME we should not mutate the model here
|
|
40
|
+
// eslint-disable-next-line fp/no-mutation
|
|
41
|
+
model[propertyName] = onChangeProps.model;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
delete model[propertyName];
|
|
45
|
+
}
|
|
46
|
+
setModel(model);
|
|
47
|
+
props.onChange(__assign(__assign({}, onChangeProps), { model: model }));
|
|
48
|
+
};
|
|
49
|
+
var isRequired = function (propertyName) {
|
|
50
|
+
return props.schema.required && props.schema.required.includes(propertyName);
|
|
51
|
+
};
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
// When the schema changes, only retain valid parts of the model
|
|
54
|
+
var newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
55
|
+
setModel(newModel);
|
|
56
|
+
if (!isEqual(newModel, model)) {
|
|
57
|
+
props.onChange({
|
|
58
|
+
model: newModel,
|
|
59
|
+
triggerSchema: props.schema,
|
|
60
|
+
triggerModel: newModel
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [props.schema]);
|
|
64
|
+
var allorderedPropertiesSet = new Set(__spreadArray(__spreadArray([], (props.schema.displayOrder || []), true), Object.keys(props.schema.properties), true));
|
|
65
|
+
var isPropertyDefined = function (propertyName) {
|
|
66
|
+
return typeof props.schema.properties[propertyName] !== 'undefined';
|
|
67
|
+
};
|
|
68
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
69
|
+
var orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
70
|
+
// TODO: LOW avoid type assertion -- what happens when props.errors is not an object?
|
|
71
|
+
var propsErrors = props.errors;
|
|
72
|
+
return (_jsxs("fieldset", { children: [props.schema.title && !props.hideTitle && _jsxs("legend", { children: [" ", props.schema.title, " "] }), props.schema.description && !props.hideTitle && _jsxs("p", { children: [" ", props.schema.description, " "] }), props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsx("div", __assign({ className: "row" }, { children: orderedPropertyNames.map(function (propertyName) { return (_jsx("div", __assign({ className: classNames(getSchemaColumnClasses(props.schema.properties[propertyName].width)) }, { children: _jsx(GenericSchema, { schema: props.schema.properties[propertyName], model: props.model && props.model[propertyName], errors: propsErrors && propsErrors[propertyName], submitted: props.submitted, required: isRequired(propertyName), disabled: props.disabled, onChange: function (onChangeProps) { return onChangeProperty(propertyName, onChangeProps); }, onPersistAsync: props.onPersistAsync }) }), propertyName)); }) }))] }));
|
|
73
|
+
};
|
|
74
|
+
ObjectSchema.defaultProps = {
|
|
75
|
+
hideTitle: false,
|
|
76
|
+
disabled: false
|
|
77
|
+
};
|
|
78
|
+
export default ObjectSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ObjectSchema';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OneOfSchema as OneOfSchemaType } from '../../dynamic-flow-types';
|
|
3
|
+
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
4
|
+
declare const OneOfSchema: {
|
|
5
|
+
(props: OneOfSchemaProps): JSX.Element | null;
|
|
6
|
+
defaultProps: {
|
|
7
|
+
required: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type OneOfSchemaProps = Omit<GenericSchemaProps, 'schema'> & {
|
|
12
|
+
schema: OneOfSchemaType;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export default OneOfSchema;
|