@wise/dynamic-flow-client 3.5.0-experimental-63c768d → 3.5.1-experimental-ccbce45
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/errorBoundary/ErrorBoundaryAlert.js +1 -1
- package/build/common/httpClientContext/HttpClientContext.js +2 -13
- package/build/common/makeHttpClient/makeHttpClient.spec.js +10 -10
- package/build/common/messages/external-confirmation.messages.js +5 -5
- package/build/common/messages/generic-error.messages.js +4 -4
- package/build/common/messages/help.messages.js +2 -2
- package/build/common/messages/multi-file-upload.messages.js +4 -4
- package/build/common/messages/multi-select.messages.js +2 -2
- package/build/common/messages/paragraph.messages.js +3 -3
- package/build/common/messages/repeatable.messages.js +5 -5
- package/build/common/messages/validation.array.messages.js +3 -3
- package/build/common/messages/validation.messages.js +11 -11
- package/build/i18n/index.js +1 -1
- package/build/legacy/common/constants/DateMode.js +1 -1
- package/build/legacy/common/constants/FormControlType.js +1 -1
- package/build/legacy/common/constants/MonthFormat.js +1 -1
- package/build/legacy/common/constants/Size.js +1 -1
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +3 -14
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +3 -1
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +2 -2
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +4 -15
- package/build/legacy/common/contexts/logContext/LogContext.js +2 -2
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +1 -12
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +6 -6
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +3 -2
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +1 -1
- package/build/legacy/common/hooks/usePolling/usePolling.js +4 -2
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +5 -3
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +4 -4
- package/build/legacy/common/messages.js +2 -2
- package/build/legacy/common/utils/file-utils.spec.js +4 -4
- package/build/legacy/common/utils/mobile-utils.spec.js +1 -1
- package/build/legacy/common/utils/schema-utils.js +2 -2
- package/build/legacy/common/validators/models/model-utils.spec.js +7 -7
- package/build/legacy/common/validators/models/model-validators.js +2 -2
- package/build/legacy/common/validators/models/model-validators.spec.js +54 -54
- package/build/legacy/common/validators/schemas/schema-validators.js +1 -1
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +20 -20
- package/build/legacy/common/validators/validationFailures/validation-failures.js +2 -2
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +11 -11
- package/build/legacy/dynamicFlow/BackButton.js +2 -2
- package/build/legacy/dynamicFlow/DynamicFlow.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +7 -7
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +24 -24
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +10 -21
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +19 -19
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +25 -25
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +17 -17
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +11 -11
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +13 -13
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +48 -48
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +4 -4
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +3 -3
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +20 -20
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +21 -21
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +16 -16
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +77 -77
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +10 -10
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +46 -46
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +62 -62
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +4 -4
- package/build/legacy/formControl/FormControl.js +9 -9
- package/build/legacy/formControl/Select.spec.js +3 -3
- package/build/legacy/formControl/utils/getAutocompleteString.js +1 -1
- package/build/legacy/formControl/utils/value-utils.js +1 -1
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +66 -66
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +1 -1
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +5 -5
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +6 -17
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +3 -3
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +6 -6
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +190 -190
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +8 -19
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +14 -14
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +2 -2
- package/build/legacy/jsonSchemaForm/help/Help.js +1 -12
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +12 -12
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +6 -6
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +1 -12
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +1 -1
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +3 -3
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +3 -3
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -6
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +12 -12
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +10 -10
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +23 -23
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +2 -2
- package/build/legacy/layout/DynamicLayout.js +1 -1
- package/build/legacy/layout/box/DynamicBox.js +2 -13
- package/build/legacy/layout/button/DynamicButton.js +1 -12
- package/build/legacy/layout/button/DynamicButton.spec.js +13 -24
- package/build/legacy/layout/button/utils.js +3 -3
- package/build/legacy/layout/button/utils.spec.js +6 -6
- package/build/legacy/layout/columns/DynamicColumns.js +4 -15
- package/build/legacy/layout/decision/DynamicDecision.js +1 -12
- package/build/legacy/layout/external/DynamicExternal.js +1 -1
- package/build/legacy/layout/external/DynamicExternal.messages.js +2 -2
- package/build/legacy/layout/form/DynamicForm.js +2 -2
- package/build/legacy/layout/heading/DynamicHeading.js +8 -19
- package/build/legacy/layout/image/DynamicImage.js +5 -4
- package/build/legacy/layout/instructions/DynamicInstructions.js +1 -12
- package/build/legacy/layout/list/DynamicStatusList.js +3 -3
- package/build/legacy/layout/list/DynamicStatusList.spec.js +9 -9
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +1 -1
- package/build/legacy/layout/markdown/DynamicMarkdown.js +2 -13
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +4 -4
- package/build/legacy/layout/modal/DynamicModal.js +2 -2
- package/build/legacy/layout/paragraph/DynamicParagraph.js +5 -16
- package/build/legacy/layout/review/DynamicReview.js +3 -14
- package/build/legacy/layout/review/DynamicReview.spec.js +6 -6
- package/build/legacy/layout/search/DynamicSearch.js +2 -13
- package/build/legacy/layout/search/SearchInput.js +1 -12
- package/build/legacy/layout/search/SearchResults.js +3 -14
- package/build/legacy/layout/search/useSearch.js +4 -4
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +2 -13
- package/build/legacy/step/cameraStep/CameraStep.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +12 -12
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +13 -13
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +3 -14
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +2 -2
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +6 -4
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +1 -1
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +7 -7
- package/build/legacy/step/layoutStep/LayoutStep.js +1 -1
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +3 -3
- package/build/legacy/step/layoutStep/utils/layout-utils.js +12 -12
- package/build/legacy/test-utils/DynamicFlowProviders.js +1 -12
- package/build/legacy/test-utils/legacy-utils.js +4 -4
- package/build/legacy/test-utils/log-utils.js +1 -1
- package/build/revamp/DynamicFlowCore.js +5 -5
- package/build/revamp/DynamicFlowWise.js +1 -1
- package/build/revamp/DynamicFlowWise.spec.js +11 -11
- package/build/revamp/domain/components/AllOfComponent.js +1 -1
- package/build/revamp/domain/components/BooleanInputComponent.js +2 -2
- package/build/revamp/domain/components/ConstComponent.js +1 -1
- package/build/revamp/domain/components/DateInputComponent.js +2 -2
- package/build/revamp/domain/components/IntegerInputComponent.js +2 -2
- package/build/revamp/domain/components/NumberInputComponent.js +2 -2
- package/build/revamp/domain/components/ObjectComponent.js +1 -1
- package/build/revamp/domain/components/SelectInputComponent.js +2 -2
- package/build/revamp/domain/components/StepDomainComponent.js +1 -1
- package/build/revamp/domain/components/TextInputComponent.js +2 -2
- package/build/revamp/domain/components/UploadInputComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -1
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +4 -3
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +13 -13
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +7 -7
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +4 -4
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -1
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +1 -1
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +17 -17
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +3 -3
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +18 -18
- package/build/revamp/domain/features/summary/summary-utils.js +2 -2
- package/build/revamp/domain/features/summary/summary-utils.spec.js +27 -27
- package/build/revamp/domain/features/utils/http-utils.js +1 -1
- package/build/revamp/domain/features/validation/spec-utils.js +1 -1
- package/build/revamp/domain/features/validation/validation-functions.spec.js +4 -4
- package/build/revamp/domain/features/validation/value-checks.spec.js +4 -4
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +4 -3
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -1
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +17 -17
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +1 -1
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +3 -3
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +22 -22
- package/build/revamp/domain/mappers/mapStepToComponent.js +3 -3
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +12 -12
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +4 -4
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +48 -48
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +1 -1
- package/build/revamp/domain/mappers/utils/legacy-utils.js +2 -2
- package/build/revamp/flow/executeRefresh.js +2 -2
- package/build/revamp/flow/executeSubmission.js +1 -1
- package/build/revamp/renderers/CoreContainerRenderer.js +1 -1
- package/build/revamp/renderers/getRenderFunction.js +3 -3
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +12 -12
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/containerComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/headingComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/imageComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/modalComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/objectComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/searchComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +1 -1
- package/build/revamp/renderers/step/ExternalConfirmationDialog.js +2 -13
- package/build/revamp/renderers/step/StepRenderer.js +2 -13
- package/build/revamp/renderers/stepComponentToProps.js +1 -1
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +53 -53
- package/build/revamp/stories/dev-tools/EditableStep.story.js +7 -7
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +17 -17
- package/build/revamp/stories/dev-tools/External.story.js +6 -6
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +14 -14
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +16 -16
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +41 -41
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +210 -210
- package/build/revamp/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/revamp/stories/dev-tools/Upload.story.js +18 -18
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/revamp/stories/examples/ObjectConst.story.js +25 -25
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +10 -10
- package/build/revamp/stories/utils/fixtureHttpClient.js +1 -1
- package/build/revamp/stories/utils/mockSearchHandler.js +8 -8
- package/build/revamp/stories/visual-tests/VisualTests.story.js +1 -1
- package/build/revamp/test-utils/step-utils.js +1 -1
- package/build/revamp/tests/ImageRenderer.spec.js +3 -3
- package/build/revamp/tests/InitialAction.spec.js +9 -9
- package/build/revamp/tests/InitialStep.spec.js +3 -3
- package/build/revamp/tests/Logging.spec.js +5 -5
- package/build/revamp/tests/OneOfInitialisation.spec.js +73 -73
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +19 -19
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -57
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +13 -13
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +38 -38
- package/build/revamp/tests/Submission.spec.js +23 -23
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +24 -24
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +27 -27
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +18 -18
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +8 -8
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +15 -14
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +50 -50
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +14 -14
- package/build/revamp/tests/legacy/useExternal.spec.js +6 -6
- package/build/revamp/utils/component-utils.spec.js +43 -43
- package/build/revamp/utils/findComponent.spec.js +14 -14
- package/build/revamp/utils/type-utils.js +1 -1
- package/build/revamp/wise/renderers/AlertRenderer.js +1 -1
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/BoxRenderer.js +4 -15
- package/build/revamp/wise/renderers/ButtonRenderer.js +2 -13
- package/build/revamp/wise/renderers/ColumnsRenderer.js +4 -15
- package/build/revamp/wise/renderers/DateInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/DecisionRenderer.js +3 -14
- package/build/revamp/wise/renderers/DividerRenderer.js +1 -1
- package/build/revamp/wise/renderers/FormRenderer.js +2 -13
- package/build/revamp/wise/renderers/FormSectionRenderer.js +1 -1
- package/build/revamp/wise/renderers/HeadingRenderer.js +7 -7
- package/build/revamp/wise/renderers/ImageRenderer.js +5 -4
- package/build/revamp/wise/renderers/InstructionsRenderer.js +2 -13
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +1 -1
- package/build/revamp/wise/renderers/MarkdownRenderer.js +2 -13
- package/build/revamp/wise/renderers/ModalRenderer.js +2 -2
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +3 -14
- package/build/revamp/wise/renderers/NumberInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/ParagraphRenderer.js +5 -4
- package/build/revamp/wise/renderers/RepeatableRenderer.js +5 -5
- package/build/revamp/wise/renderers/ReviewRenderer.js +5 -16
- package/build/revamp/wise/renderers/SearchRenderer.js +5 -5
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +1 -1
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +4 -4
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/StatusListRenderer.js +3 -14
- package/build/revamp/wise/renderers/TextInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/UploadInputRenderer.js +6 -6
- package/build/revamp/wise/renderers/components/FieldInput.js +1 -12
- package/build/revamp/wise/renderers/components/Help.js +1 -12
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +3 -14
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +2 -13
- package/build/test-utils/NeptuneProviders.js +1 -1
- package/build/types/common/messages/multi-file-upload.messages.d.ts +9 -9
- package/build/types/legacy/common/utils/mobile-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +6 -6
- package/build/types/legacy/layout/external/DynamicExternal.messages.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/package.json +3 -3
|
@@ -26,18 +26,18 @@ var mapConstSchemaToOption = function (schema, controlType) {
|
|
|
26
26
|
};
|
|
27
27
|
var mapConstSchemaToRadioOption = function (schema) { return (__assign(__assign(__assign({
|
|
28
28
|
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
29
|
-
label: schema.title, value: schema
|
|
29
|
+
label: schema.title, value: schema.const }, getRadioOptionDescription(schema.title, schema.description)), getAvatarPropertyForRadioOption(schema)), getDisabled(schema.disabled))); };
|
|
30
30
|
var mapConstSchemaToSelectOption = function (schema) { return (__assign(__assign(__assign(__assign(__assign({
|
|
31
31
|
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
32
|
-
label: schema.title, value: schema
|
|
32
|
+
label: schema.title, value: schema.const }, getOptionDescription(schema.title, schema.description)), getIconPropertyForSelectOption(schema.icon)), mapImage(schema.image)), getDisabled(schema.disabled)), mapKeywordsToSearchStrings(schema.keywords))); };
|
|
33
33
|
var mapKeywordsToSearchStrings = function (searchStrings) {
|
|
34
34
|
return isArray(searchStrings) ? { searchStrings: searchStrings } : {};
|
|
35
35
|
};
|
|
36
36
|
var mapImage = function (image) {
|
|
37
37
|
if (image === null || image === void 0 ? void 0 : image.url) {
|
|
38
38
|
return {
|
|
39
|
-
icon: (_jsx("div",
|
|
40
|
-
hideIconInTrigger: true
|
|
39
|
+
icon: (_jsx("div", { className: "media", children: _jsx("div", { className: "np-option__no-media-circle", children: _jsx("img", { src: image.url, alt: image.name || '' }) }) })),
|
|
40
|
+
hideIconInTrigger: true,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
return null;
|
|
@@ -45,17 +45,17 @@ var mapImage = function (image) {
|
|
|
45
45
|
var getIconPropertyForSelectOption = function (icon) {
|
|
46
46
|
if ((icon === null || icon === void 0 ? void 0 : icon.name) && isFlagIcon(icon.name)) {
|
|
47
47
|
return {
|
|
48
|
-
icon: _jsx(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
48
|
+
icon: _jsx(Flag, { code: icon.name.substring(5), intrinsicSize: 24 }),
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
if ((icon === null || icon === void 0 ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
52
52
|
return {
|
|
53
|
-
icon: _jsx(DynamicIcon, { type: icon.name })
|
|
53
|
+
icon: _jsx(DynamicIcon, { type: icon.name }),
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
if (icon === null || icon === void 0 ? void 0 : icon.text) {
|
|
57
57
|
return {
|
|
58
|
-
icon: _jsx("span", { children: icon.text })
|
|
58
|
+
icon: _jsx("span", { children: icon.text }),
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
@@ -64,17 +64,17 @@ var getAvatarPropertyForRadioOption = function (_a) {
|
|
|
64
64
|
var image = _a.image, icon = _a.icon;
|
|
65
65
|
if (image === null || image === void 0 ? void 0 : image.url) {
|
|
66
66
|
return {
|
|
67
|
-
avatar: (_jsx(Avatar,
|
|
67
|
+
avatar: (_jsx(Avatar, { type: AvatarType.THUMBNAIL, children: _jsx("img", { src: image.url, alt: "" }) })),
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
if ((icon === null || icon === void 0 ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
71
71
|
return {
|
|
72
|
-
avatar: (_jsx(Avatar,
|
|
72
|
+
avatar: (_jsx(Avatar, { type: AvatarType.ICON, children: _jsx(DynamicIcon, { type: icon.name }) })),
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
if (icon === null || icon === void 0 ? void 0 : icon.text) {
|
|
76
76
|
return {
|
|
77
|
-
avatar: _jsx(Avatar,
|
|
77
|
+
avatar: _jsx(Avatar, { type: AvatarType.INITIALS, children: icon.text }),
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
return null;
|
|
@@ -22,9 +22,9 @@ describe('mapConstSchemaToOption', function () {
|
|
|
22
22
|
title: 'Emoji Option',
|
|
23
23
|
icon: {
|
|
24
24
|
name: 'emoji',
|
|
25
|
-
type: 'icon'
|
|
25
|
+
type: 'icon',
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
const: 'emoji-option',
|
|
28
28
|
};
|
|
29
29
|
describe('when the controlType is "radio"', function () {
|
|
30
30
|
it('maps the "icon" to the "avatar" property', function () {
|
|
@@ -32,7 +32,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
32
32
|
expect(mapped).toMatchObject({
|
|
33
33
|
label: 'Emoji Option',
|
|
34
34
|
value: 'emoji-option',
|
|
35
|
-
avatar: expect.anything()
|
|
35
|
+
avatar: expect.anything(),
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
describe('and when the icon has a "name" property', function () {
|
|
@@ -41,15 +41,15 @@ describe('mapConstSchemaToOption', function () {
|
|
|
41
41
|
expect(mapped).toMatchObject({
|
|
42
42
|
label: 'Emoji Option',
|
|
43
43
|
value: 'emoji-option',
|
|
44
|
-
avatar: expect.anything()
|
|
44
|
+
avatar: expect.anything(),
|
|
45
45
|
});
|
|
46
|
-
expect(mapped.avatar).toStrictEqual(_jsx(Avatar,
|
|
46
|
+
expect(mapped.avatar).toStrictEqual(_jsx(Avatar, { type: "icon", children: _jsx(DynamicIcon, { type: "emoji" }) }));
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
describe('and when the icon has a "text" property', function () {
|
|
50
50
|
it('uses an Avatar of type "initials" with the string text', function () {
|
|
51
51
|
var mapped = mapConstSchemaToOption(__assign(__assign({}, schema), { icon: { text: 'JJ' } }), 'radio');
|
|
52
|
-
expect(mapped.avatar).toStrictEqual(_jsx(Avatar,
|
|
52
|
+
expect(mapped.avatar).toStrictEqual(_jsx(Avatar, { type: "initials", children: "JJ" }));
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
});
|
|
@@ -59,7 +59,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
59
59
|
expect(mapped).toMatchObject({
|
|
60
60
|
label: 'Emoji Option',
|
|
61
61
|
value: 'emoji-option',
|
|
62
|
-
icon: expect.anything()
|
|
62
|
+
icon: expect.anything(),
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
describe('and when the icon has a "name" property and the controlType is "select"', function () {
|
|
@@ -79,7 +79,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
79
79
|
var schema = {
|
|
80
80
|
title: 'GBP',
|
|
81
81
|
icon: { name: 'flag-gbp' },
|
|
82
|
-
|
|
82
|
+
const: 'GBP',
|
|
83
83
|
};
|
|
84
84
|
var mapped = mapConstSchemaToOption(schema, 'select');
|
|
85
85
|
expect(mapped).toMatchObject({ icon: _jsx(Flag, { code: "gbp", intrinsicSize: 24 }) });
|
|
@@ -90,7 +90,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
90
90
|
var schema = {
|
|
91
91
|
title: 'GBP',
|
|
92
92
|
icon: { name: 'flag-xxx' },
|
|
93
|
-
|
|
93
|
+
const: 'GBP',
|
|
94
94
|
};
|
|
95
95
|
var mapped = mapConstSchemaToOption(schema, 'select');
|
|
96
96
|
expect(mapped).not.toHaveProperty('icon');
|
|
@@ -101,12 +101,12 @@ describe('mapConstSchemaToOption', function () {
|
|
|
101
101
|
var mapped = mapConstSchemaToOption({
|
|
102
102
|
title: 'Some Very Long Title',
|
|
103
103
|
description: 'The description here is even longer.',
|
|
104
|
-
|
|
104
|
+
const: 'option-2',
|
|
105
105
|
}, 'select');
|
|
106
106
|
expect(mapped).toMatchObject({
|
|
107
107
|
label: 'Some Very Long Title',
|
|
108
108
|
secondary: 'The description here is even longer.',
|
|
109
|
-
value: 'option-2'
|
|
109
|
+
value: 'option-2',
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
});
|
|
@@ -115,12 +115,12 @@ describe('mapConstSchemaToOption', function () {
|
|
|
115
115
|
var mapped = mapConstSchemaToOption({
|
|
116
116
|
title: "Title's 16 chars",
|
|
117
117
|
description: 'This description is not too short.',
|
|
118
|
-
|
|
118
|
+
const: 'option-1',
|
|
119
119
|
}, 'select');
|
|
120
120
|
expect(mapped).toMatchObject({
|
|
121
121
|
label: "Title's 16 chars",
|
|
122
122
|
note: 'This description is not too short.',
|
|
123
|
-
value: 'option-1'
|
|
123
|
+
value: 'option-1',
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
});
|
|
@@ -131,9 +131,9 @@ describe('mapConstSchemaToOption', function () {
|
|
|
131
131
|
title: 'Emoji Option',
|
|
132
132
|
image: {
|
|
133
133
|
url: 'https://placeholder.pic/',
|
|
134
|
-
type: 'image'
|
|
134
|
+
type: 'image',
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
const: 'emoji-option',
|
|
137
137
|
};
|
|
138
138
|
describe('when the controlType is "radio"', function () {
|
|
139
139
|
it('maps the "icon" to the "avatar" property', function () {
|
|
@@ -141,7 +141,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
141
141
|
expect(mapped).toMatchObject({
|
|
142
142
|
label: 'Emoji Option',
|
|
143
143
|
value: 'emoji-option',
|
|
144
|
-
avatar: expect.anything()
|
|
144
|
+
avatar: expect.anything(),
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
});
|
|
@@ -151,7 +151,7 @@ describe('mapConstSchemaToOption', function () {
|
|
|
151
151
|
expect(mapped).toMatchObject({
|
|
152
152
|
label: 'Emoji Option',
|
|
153
153
|
value: 'emoji-option',
|
|
154
|
-
icon: expect.anything()
|
|
154
|
+
icon: expect.anything(),
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
157
|
});
|
|
@@ -162,24 +162,24 @@ describe('getAvatarPropertyForRadioOption', function () {
|
|
|
162
162
|
it("returns an { avatar } object with an Avatar and a DynamicIcon", function () {
|
|
163
163
|
var iconName = 'bank';
|
|
164
164
|
var result = getAvatarPropertyForRadioOption({
|
|
165
|
-
icon: { name: iconName }
|
|
165
|
+
icon: { name: iconName },
|
|
166
166
|
});
|
|
167
|
-
expect(result === null || result === void 0 ? void 0 : result.avatar).toStrictEqual(_jsx(Avatar,
|
|
167
|
+
expect(result === null || result === void 0 ? void 0 : result.avatar).toStrictEqual(_jsx(Avatar, { type: "icon", children: _jsx(DynamicIcon, { type: iconName }) }));
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
170
|
describe('given a valid currency flag icon', function () {
|
|
171
171
|
it("returns an { avatar } object with an Avatar and a DynamicIcon", function () {
|
|
172
172
|
var iconName = 'flag-usd';
|
|
173
173
|
var result = getAvatarPropertyForRadioOption({
|
|
174
|
-
icon: { name: iconName }
|
|
174
|
+
icon: { name: iconName },
|
|
175
175
|
});
|
|
176
|
-
expect(result === null || result === void 0 ? void 0 : result.avatar).toStrictEqual(_jsx(Avatar,
|
|
176
|
+
expect(result === null || result === void 0 ? void 0 : result.avatar).toStrictEqual(_jsx(Avatar, { type: "icon", children: _jsx(DynamicIcon, { type: iconName }) }));
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
describe('given an unrecognised icon', function () {
|
|
180
180
|
it('returns null', function () {
|
|
181
181
|
var result = getAvatarPropertyForRadioOption({
|
|
182
|
-
icon: { name: 'unknown' }
|
|
182
|
+
icon: { name: 'unknown' },
|
|
183
183
|
});
|
|
184
184
|
expect(result).toBeNull();
|
|
185
185
|
});
|
|
@@ -217,7 +217,7 @@ describe('getAvatarPropertyForRadioOption', function () {
|
|
|
217
217
|
it('returns an { avatar } object with an image (image takes precendence over icon)', function () {
|
|
218
218
|
var result = getAvatarPropertyForRadioOption({
|
|
219
219
|
image: { url: 'someURL' },
|
|
220
|
-
icon: { name: 'bank' }
|
|
220
|
+
icon: { name: 'bank' },
|
|
221
221
|
});
|
|
222
222
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
223
223
|
var getByRole = render(result === null || result === void 0 ? void 0 : result.avatar).getByRole;
|
|
@@ -84,7 +84,7 @@ function ValidationAsyncSchema(props) {
|
|
|
84
84
|
method: validationAsyncSpec.method || 'POST',
|
|
85
85
|
headers: { 'Content-Type': 'application/json' },
|
|
86
86
|
body: validationAsyncSpec.method === 'GET' ? undefined : JSON.stringify(requestBody),
|
|
87
|
-
signal: signal
|
|
87
|
+
signal: signal,
|
|
88
88
|
})];
|
|
89
89
|
case 1:
|
|
90
90
|
response = _c.sent();
|
|
@@ -142,7 +142,7 @@ function ValidationAsyncSchema(props) {
|
|
|
142
142
|
onChange: onValidationAsyncChange,
|
|
143
143
|
onBlur: onBlur,
|
|
144
144
|
required: required,
|
|
145
|
-
schema: schema
|
|
145
|
+
schema: schema,
|
|
146
146
|
};
|
|
147
147
|
return _jsx(BasicTypeSchema, __assign({}, basicTypeSchemaProps));
|
|
148
148
|
}
|
|
@@ -63,6 +63,6 @@ function DynamicLayout(props) {
|
|
|
63
63
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
64
64
|
return _jsx(_Fragment, { children: components.map(renderComponent) });
|
|
65
65
|
}
|
|
66
|
-
return (_jsx(HttpClientProviderFromBaseUrl,
|
|
66
|
+
return (_jsx(HttpClientProviderFromBaseUrl, { baseUrl: baseUrl, children: components.map(renderComponent) }));
|
|
67
67
|
}
|
|
68
68
|
export default DynamicLayout;
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { DynamicLayout } from '..';
|
|
14
3
|
import { getMargin } from '../utils';
|
|
@@ -16,9 +5,9 @@ var DynamicBox = function (props) {
|
|
|
16
5
|
var box = props.component;
|
|
17
6
|
var margin = getMargin(box.margin || box.border ? 'lg' : 'xs');
|
|
18
7
|
if (!box.width || box.width === 'xl') {
|
|
19
|
-
return (_jsx("div",
|
|
8
|
+
return (_jsx("div", { className: margin + getBorderClass(box.border), children: _jsx(DynamicLayout, { components: box.components, model: props.model, submitted: props.submitted, errors: props.errors, onModelChange: props.onModelChange, onAction: props.onAction, onPersistAsync: props.onPersistAsync }) }));
|
|
20
9
|
}
|
|
21
|
-
return (_jsx("div",
|
|
10
|
+
return (_jsx("div", { className: "row", children: _jsx("div", { className: margin + getBoxWidthClasses(box), children: _jsx("div", { className: getBorderClass(box.border), children: _jsx(DynamicLayout, { components: box.components, model: props.model, submitted: props.submitted, errors: props.errors, onModelChange: props.onModelChange, onAction: props.onAction, onPersistAsync: props.onPersistAsync }) }) }) }));
|
|
22
11
|
};
|
|
23
12
|
var getBorderClass = function (border) {
|
|
24
13
|
return border ? ' well p-b-0' : '';
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { Button } from '@transferwise/components';
|
|
14
3
|
import { useDynamicFlow } from '../../common/contexts';
|
|
@@ -22,6 +11,6 @@ function DynamicButton(props) {
|
|
|
22
11
|
var priority = getButtonPriority(component);
|
|
23
12
|
var loading = useDynamicFlow().loading;
|
|
24
13
|
var className = getMargin(component.margin || 'md');
|
|
25
|
-
return (_jsx(Button,
|
|
14
|
+
return (_jsx(Button, { size: getButtonSize(component.size), type: priority === 'tertiary' ? undefined : type, priority: priority, block: true, className: className, disabled: loading || component.disabled || componentAction.disabled, onClick: function () { return onAction(componentAction); }, children: (_a = component.title) !== null && _a !== void 0 ? _a : componentAction.title }));
|
|
26
15
|
}
|
|
27
16
|
export default DynamicButton;
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58,8 +47,8 @@ describe('DynamicButton', function () {
|
|
|
58
47
|
title: 'Button Title',
|
|
59
48
|
action: {
|
|
60
49
|
title: 'Action Title',
|
|
61
|
-
url: '/example'
|
|
62
|
-
}
|
|
50
|
+
url: '/example',
|
|
51
|
+
},
|
|
63
52
|
}, onAction: jest.fn() }));
|
|
64
53
|
expect(screen.getByText('Button Title')).toBeInTheDocument();
|
|
65
54
|
});
|
|
@@ -68,8 +57,8 @@ describe('DynamicButton', function () {
|
|
|
68
57
|
type: 'button',
|
|
69
58
|
action: {
|
|
70
59
|
title: 'Action Title',
|
|
71
|
-
url: '/example'
|
|
72
|
-
}
|
|
60
|
+
url: '/example',
|
|
61
|
+
},
|
|
73
62
|
}, onAction: jest.fn() }));
|
|
74
63
|
expect(screen.getByText('Action Title')).toBeInTheDocument();
|
|
75
64
|
});
|
|
@@ -81,8 +70,8 @@ describe('DynamicButton', function () {
|
|
|
81
70
|
action: {
|
|
82
71
|
title: 'Action Title',
|
|
83
72
|
url: '/example',
|
|
84
|
-
disabled: true
|
|
85
|
-
}
|
|
73
|
+
disabled: true,
|
|
74
|
+
},
|
|
86
75
|
}, onAction: jest.fn() }));
|
|
87
76
|
expect(screen.getByText('Action Title')).toBeDisabled();
|
|
88
77
|
});
|
|
@@ -91,7 +80,7 @@ describe('DynamicButton', function () {
|
|
|
91
80
|
type: 'button',
|
|
92
81
|
title: 'Button Title',
|
|
93
82
|
disabled: true,
|
|
94
|
-
action: { url: '/example' }
|
|
83
|
+
action: { url: '/example' },
|
|
95
84
|
}, onAction: jest.fn() }));
|
|
96
85
|
expect(screen.getByText('Button Title')).toBeDisabled();
|
|
97
86
|
});
|
|
@@ -103,7 +92,7 @@ describe('DynamicButton', function () {
|
|
|
103
92
|
title: 'Button Title',
|
|
104
93
|
margin: 'md',
|
|
105
94
|
disabled: true,
|
|
106
|
-
action: { url: '/example' }
|
|
95
|
+
action: { url: '/example' },
|
|
107
96
|
}, onAction: jest.fn() }));
|
|
108
97
|
expect(screen.getByText('Button Title')).toHaveClass('m-b-2');
|
|
109
98
|
});
|
|
@@ -113,7 +102,7 @@ describe('DynamicButton', function () {
|
|
|
113
102
|
var component = {
|
|
114
103
|
type: 'button',
|
|
115
104
|
title: 'Button Title',
|
|
116
|
-
action: { url: '/example' }
|
|
105
|
+
action: { url: '/example' },
|
|
117
106
|
};
|
|
118
107
|
var onAction = jest.fn();
|
|
119
108
|
renderWithProviders(_jsx(DynamicButton, { component: component, onAction: onAction }));
|
|
@@ -128,9 +117,9 @@ describe('DynamicButton', function () {
|
|
|
128
117
|
component = {
|
|
129
118
|
type: 'button',
|
|
130
119
|
title: 'Button Title',
|
|
131
|
-
action: { url: '/example' }
|
|
120
|
+
action: { url: '/example' },
|
|
132
121
|
};
|
|
133
|
-
renderWithProviders(_jsx(DynamicFlowProvider,
|
|
122
|
+
renderWithProviders(_jsx(DynamicFlowProvider, { loading: true, children: _jsx(DynamicButton, { component: component, onAction: jest.fn() }) }));
|
|
134
123
|
expect(screen.getByRole('button')).toBeDisabled();
|
|
135
124
|
return [2 /*return*/];
|
|
136
125
|
});
|
|
@@ -141,9 +130,9 @@ describe('DynamicButton', function () {
|
|
|
141
130
|
component = {
|
|
142
131
|
type: 'button',
|
|
143
132
|
title: 'Button Title',
|
|
144
|
-
action: { url: '/example' }
|
|
133
|
+
action: { url: '/example' },
|
|
145
134
|
};
|
|
146
|
-
renderWithProviders(_jsx(DynamicFlowProvider,
|
|
135
|
+
renderWithProviders(_jsx(DynamicFlowProvider, { loading: true, children: _jsx(DynamicButton, { component: component, onAction: jest.fn() }) }));
|
|
147
136
|
expect(screen.getByRole('button')).toBeDisabled();
|
|
148
137
|
return [2 /*return*/];
|
|
149
138
|
});
|
|
@@ -3,7 +3,7 @@ var priorities = {
|
|
|
3
3
|
secondary: 'secondary',
|
|
4
4
|
link: 'tertiary',
|
|
5
5
|
positive: 'primary',
|
|
6
|
-
negative: 'primary'
|
|
6
|
+
negative: 'primary',
|
|
7
7
|
};
|
|
8
8
|
export var getButtonPriority = function (component) {
|
|
9
9
|
var _a;
|
|
@@ -14,14 +14,14 @@ var contextToType = {
|
|
|
14
14
|
positive: 'positive',
|
|
15
15
|
negative: 'negative',
|
|
16
16
|
neutral: 'accent',
|
|
17
|
-
warning: 'accent'
|
|
17
|
+
warning: 'accent',
|
|
18
18
|
};
|
|
19
19
|
var actionTypeToType = {
|
|
20
20
|
primary: 'accent',
|
|
21
21
|
secondary: 'accent',
|
|
22
22
|
link: 'accent',
|
|
23
23
|
positive: 'positive',
|
|
24
|
-
negative: 'negative'
|
|
24
|
+
negative: 'negative',
|
|
25
25
|
};
|
|
26
26
|
export var getButtonType = function (component) {
|
|
27
27
|
if (component.context) {
|
|
@@ -4,21 +4,21 @@ describe('getButtonPriority', function () {
|
|
|
4
4
|
var button = {
|
|
5
5
|
type: 'button',
|
|
6
6
|
action: { type: 'primary' },
|
|
7
|
-
control: 'secondary'
|
|
7
|
+
control: 'secondary',
|
|
8
8
|
};
|
|
9
9
|
expect(getButtonPriority(button)).toBe('secondary');
|
|
10
10
|
});
|
|
11
11
|
it('maps action types to priorities', function () {
|
|
12
12
|
var button = {
|
|
13
13
|
type: 'button',
|
|
14
|
-
action: { type: 'link' }
|
|
14
|
+
action: { type: 'link' },
|
|
15
15
|
};
|
|
16
16
|
expect(getButtonPriority(button)).toBe('tertiary');
|
|
17
17
|
});
|
|
18
18
|
it('defaults to secondary if neither action.type nor control are provided', function () {
|
|
19
19
|
var button = {
|
|
20
20
|
type: 'button',
|
|
21
|
-
action: { title: '' }
|
|
21
|
+
action: { title: '' },
|
|
22
22
|
};
|
|
23
23
|
expect(getButtonPriority(button)).toBe('secondary');
|
|
24
24
|
});
|
|
@@ -28,7 +28,7 @@ describe('getButtonType', function () {
|
|
|
28
28
|
var button = {
|
|
29
29
|
type: 'button',
|
|
30
30
|
action: { title: '', type: 'negative' },
|
|
31
|
-
context: 'positive'
|
|
31
|
+
context: 'positive',
|
|
32
32
|
};
|
|
33
33
|
expect(getButtonType(button)).toBe('positive');
|
|
34
34
|
});
|
|
@@ -36,14 +36,14 @@ describe('getButtonType', function () {
|
|
|
36
36
|
var button = {
|
|
37
37
|
type: 'button',
|
|
38
38
|
action: { title: '' },
|
|
39
|
-
context: 'neutral'
|
|
39
|
+
context: 'neutral',
|
|
40
40
|
};
|
|
41
41
|
expect(getButtonType(button)).toBe('accent');
|
|
42
42
|
});
|
|
43
43
|
it('defaults to accent if neither action.type nor context are provided', function () {
|
|
44
44
|
var button = {
|
|
45
45
|
type: 'button',
|
|
46
|
-
action: { title: '' }
|
|
46
|
+
action: { title: '' },
|
|
47
47
|
};
|
|
48
48
|
expect(getButtonType(button)).toBe('accent');
|
|
49
49
|
});
|
|
@@ -1,38 +1,27 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { DynamicLayout } from '..';
|
|
14
3
|
import { getMargin } from '../utils';
|
|
15
4
|
var DynamicColumns = function (props) {
|
|
16
5
|
var columns = props.component;
|
|
17
6
|
var _a = getWidth(columns.bias), leftWidth = _a.leftWidth, rightWidth = _a.rightWidth;
|
|
18
|
-
return (_jsxs("div",
|
|
7
|
+
return (_jsxs("div", { className: "".concat(getMargin(columns.margin || 'xs'), " row"), children: [_jsx("div", { className: "".concat(leftWidth, " m-b-0"), children: _jsx(DynamicLayout, { components: columns.left, model: props.model, submitted: props.submitted, errors: props.errors, onModelChange: props.onModelChange, onAction: props.onAction, onPersistAsync: props.onPersistAsync }) }), _jsx("div", { className: "".concat(rightWidth, " m-b-0"), children: _jsx(DynamicLayout, { components: columns.right, model: props.model, submitted: props.submitted, errors: props.errors, onModelChange: props.onModelChange, onAction: props.onAction, onPersistAsync: props.onPersistAsync }) })] }));
|
|
19
8
|
};
|
|
20
9
|
var getWidth = function (bias) {
|
|
21
10
|
if (bias === 'left') {
|
|
22
11
|
return {
|
|
23
12
|
leftWidth: 'col-md-8',
|
|
24
|
-
rightWidth: 'col-md-4'
|
|
13
|
+
rightWidth: 'col-md-4',
|
|
25
14
|
};
|
|
26
15
|
}
|
|
27
16
|
if (bias === 'right') {
|
|
28
17
|
return {
|
|
29
18
|
leftWidth: 'col-md-4',
|
|
30
|
-
rightWidth: 'col-md-8'
|
|
19
|
+
rightWidth: 'col-md-8',
|
|
31
20
|
};
|
|
32
21
|
}
|
|
33
22
|
return {
|
|
34
23
|
leftWidth: 'col-md-6',
|
|
35
|
-
rightWidth: 'col-md-6'
|
|
24
|
+
rightWidth: 'col-md-6',
|
|
36
25
|
};
|
|
37
26
|
};
|
|
38
27
|
export default DynamicColumns;
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { NavigationOption, NavigationOptionsList } from '@transferwise/components';
|
|
14
3
|
import { getNavigationOptionMedia, getMargin } from '../utils';
|
|
@@ -16,6 +5,6 @@ import { useDynamicFlow } from '../../common/contexts';
|
|
|
16
5
|
function DynamicDecision(_a) {
|
|
17
6
|
var component = _a.component, onAction = _a.onAction;
|
|
18
7
|
var loading = useDynamicFlow().loading;
|
|
19
|
-
return (_jsx("div",
|
|
8
|
+
return (_jsx("div", { className: getMargin(component.margin), children: _jsx(NavigationOptionsList, { children: component.options.map(function (option) { return (_jsx(NavigationOption, { title: option.title, content: option.description, disabled: loading || option.disabled, media: getNavigationOptionMedia(option), showMediaCircle: false, showMediaAtAllSizes: true, onClick: function () { return onAction(option.action); } }, JSON.stringify(option))); }) }) }));
|
|
20
9
|
}
|
|
21
10
|
export default DynamicDecision;
|
|
@@ -27,6 +27,6 @@ var DynamicExternal = function (_a) {
|
|
|
27
27
|
var pollingConfiguration = polling && responseHandlers
|
|
28
28
|
? __assign(__assign({}, polling), { responseHandlers: responseHandlers }) : undefined;
|
|
29
29
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsx(Loader, { size: Size.LARGE, classNames: { 'tw-loader': 'tw-loader m-x-auto' } }), _jsx("br", {}), _jsx(Button,
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(Loader, { size: Size.LARGE, classNames: { 'tw-loader': 'tw-loader m-x-auto' } }), _jsx("br", {}), _jsx(Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(messages.retryTitle) })] }));
|
|
31
31
|
};
|
|
32
32
|
export default DynamicExternal;
|
|
@@ -15,8 +15,8 @@ import { getMargin } from '../utils';
|
|
|
15
15
|
function DynamicForm(_a) {
|
|
16
16
|
var component = _a.component, _b = _a.model, model = _b === void 0 ? null : _b, _c = _a.errors, errors = _c === void 0 ? null : _c, submitted = _a.submitted, onModelChange = _a.onModelChange, onPersistAsync = _a.onPersistAsync;
|
|
17
17
|
var formSchema = component.schema; // There should be no $ref, nor schemaId at this point
|
|
18
|
-
return (_jsx("div",
|
|
18
|
+
return (_jsx("div", { className: getMargin(component.margin || 'md'), children: _jsx(GenericSchema, { schema: formSchema, model: model, errors: errors, submitted: submitted, onChange: function (parameters) {
|
|
19
19
|
onModelChange(__assign({ formSchema: formSchema }, parameters));
|
|
20
|
-
}, onPersistAsync: onPersistAsync }) }))
|
|
20
|
+
}, onPersistAsync: onPersistAsync }) }));
|
|
21
21
|
}
|
|
22
22
|
export default DynamicForm;
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { Display } from '@transferwise/components';
|
|
14
3
|
import classNames from 'classnames';
|
|
@@ -22,16 +11,16 @@ var StandardHeading = function (_a) {
|
|
|
22
11
|
var size = _a.size, text = _a.text, classes = _a.classes;
|
|
23
12
|
switch (size) {
|
|
24
13
|
case 'xs':
|
|
25
|
-
return _jsx("h5",
|
|
14
|
+
return _jsx("h5", { className: classes, children: text });
|
|
26
15
|
case 'sm':
|
|
27
|
-
return _jsx("h4",
|
|
16
|
+
return _jsx("h4", { className: classes, children: text });
|
|
28
17
|
case 'lg':
|
|
29
|
-
return _jsx("h2",
|
|
18
|
+
return _jsx("h2", { className: classes, children: text });
|
|
30
19
|
case 'xl':
|
|
31
|
-
return _jsx("h1",
|
|
20
|
+
return _jsx("h1", { className: classes, children: text });
|
|
32
21
|
case 'md':
|
|
33
22
|
default:
|
|
34
|
-
return _jsx("h3",
|
|
23
|
+
return _jsx("h3", { className: classes, children: text });
|
|
35
24
|
}
|
|
36
25
|
};
|
|
37
26
|
var DisplayHeading = function (_a) {
|
|
@@ -39,13 +28,13 @@ var DisplayHeading = function (_a) {
|
|
|
39
28
|
switch (size) {
|
|
40
29
|
case 'xs':
|
|
41
30
|
case 'sm':
|
|
42
|
-
return (_jsx(Display,
|
|
31
|
+
return (_jsx(Display, { type: "display-small", className: classes, children: text }));
|
|
43
32
|
case 'xl':
|
|
44
33
|
case 'lg':
|
|
45
|
-
return (_jsx(Display,
|
|
34
|
+
return (_jsx(Display, { type: "display-large", className: classes, children: text }));
|
|
46
35
|
case 'md':
|
|
47
36
|
default:
|
|
48
|
-
return (_jsx(Display,
|
|
37
|
+
return (_jsx(Display, { type: "display-medium", className: classes, children: text }));
|
|
49
38
|
}
|
|
50
39
|
};
|
|
51
40
|
export default DynamicHeading;
|