@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,106 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { isNull, isUndefined } from '@transferwise/neptune-validation';
|
|
14
|
+
import { FormControlType } from '../../common';
|
|
15
|
+
import { useLogger } from '../../common/logging';
|
|
16
|
+
import { getValidBasicModelOrNull } from '../../common/validation/valid-model';
|
|
17
|
+
import { isOneOfSchema, } from '../../dynamic-flow-types';
|
|
18
|
+
import FormControl from '../../formControl';
|
|
19
|
+
import schema from '../schemas/allOf.json';
|
|
20
|
+
import { mapConstSchemaToOption, mapSchemaToUploadOptions } from './optionMapper';
|
|
21
|
+
var isNativeInput = function (propsSchemaType) {
|
|
22
|
+
return propsSchemaType === 'string' || propsSchemaType === 'number';
|
|
23
|
+
};
|
|
24
|
+
export var getControlType = function (schema) {
|
|
25
|
+
if ('control' in schema && schema.control) {
|
|
26
|
+
if (isOneOfSchema(schema) && schema.oneOf.length > 3) {
|
|
27
|
+
return FormControlType.SELECT;
|
|
28
|
+
}
|
|
29
|
+
return schema.control;
|
|
30
|
+
}
|
|
31
|
+
if (schema.oneOf) {
|
|
32
|
+
return schema.oneOf.length === 1 || schema.oneOf.length >= 3 ? 'select' : 'radio';
|
|
33
|
+
}
|
|
34
|
+
if (schema.type === 'string') {
|
|
35
|
+
switch (schema.format) {
|
|
36
|
+
case 'date':
|
|
37
|
+
return 'date';
|
|
38
|
+
case 'password':
|
|
39
|
+
return 'password';
|
|
40
|
+
case 'phone-number':
|
|
41
|
+
return 'tel';
|
|
42
|
+
case 'base64url':
|
|
43
|
+
return 'file';
|
|
44
|
+
default:
|
|
45
|
+
return 'text';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (schema.type === 'boolean') {
|
|
49
|
+
return 'checkbox';
|
|
50
|
+
}
|
|
51
|
+
if (schema.type === 'integer') {
|
|
52
|
+
return 'number';
|
|
53
|
+
}
|
|
54
|
+
return schema.type;
|
|
55
|
+
};
|
|
56
|
+
var getOptions = function (schema, controlType) {
|
|
57
|
+
if (schema.oneOf) {
|
|
58
|
+
return schema.oneOf.map(function (childSchema) { return mapConstSchemaToOption(childSchema, controlType); });
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
};
|
|
62
|
+
var SchemaFormControl = function (props) {
|
|
63
|
+
var log = useLogger();
|
|
64
|
+
var getSanitisedValue = function (value) {
|
|
65
|
+
return isNativeInput(props.schema.type) && (isNull(value) || isUndefined(value)) ? '' : value;
|
|
66
|
+
};
|
|
67
|
+
var onChange = function (value, type) {
|
|
68
|
+
props.onChange(getValidBasicModelOrNull(value, props.schema), type);
|
|
69
|
+
};
|
|
70
|
+
var controlType = getControlType(props.schema);
|
|
71
|
+
if (controlType === 'file') {
|
|
72
|
+
log.warning('Deprecation advanced warning', 'Please use a persist-async blob schema instead of string with base64url for file uploads. The base64url does not perform well on low end devices. Support for this schema will be removed in a later release.');
|
|
73
|
+
}
|
|
74
|
+
if (props.schema.values) {
|
|
75
|
+
log.error('Deprecated schema', 'Schema.values is a legacy approach. Please use oneOf.');
|
|
76
|
+
}
|
|
77
|
+
var options = schema.values || getOptions(props.schema, controlType);
|
|
78
|
+
var events = {
|
|
79
|
+
onFocus: props.onFocus,
|
|
80
|
+
onBlur: props.onBlur,
|
|
81
|
+
onSearchChange: props.onSearchChange,
|
|
82
|
+
onChange: onChange
|
|
83
|
+
};
|
|
84
|
+
var safeValue = getSanitisedValue(props.value);
|
|
85
|
+
var controlProps = {
|
|
86
|
+
id: props.id,
|
|
87
|
+
name: props.id,
|
|
88
|
+
label: props.schema.title,
|
|
89
|
+
options: options || [],
|
|
90
|
+
placeholder: props.schema.placeholder,
|
|
91
|
+
autoComplete: !props.schema.help,
|
|
92
|
+
disabled: props.disabled || props.schema.disabled,
|
|
93
|
+
displayPattern: props.schema.displayFormat,
|
|
94
|
+
// TODO: LOW avoid type assertion below
|
|
95
|
+
uploadProps: mapSchemaToUploadOptions(props.schema)
|
|
96
|
+
};
|
|
97
|
+
return _jsx(FormControl, __assign({ type: controlType, value: safeValue }, events, controlProps));
|
|
98
|
+
};
|
|
99
|
+
SchemaFormControl.defaultProps = {
|
|
100
|
+
value: null,
|
|
101
|
+
onFocus: null,
|
|
102
|
+
onBlur: null,
|
|
103
|
+
onSearchChange: null,
|
|
104
|
+
disabled: false
|
|
105
|
+
};
|
|
106
|
+
export default SchemaFormControl;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export function getCurrencyFlag(iconName) {
|
|
2
|
+
if (iconName) {
|
|
3
|
+
var index = availablePrefixedCurrencyFlags.indexOf(iconName);
|
|
4
|
+
if (index >= 0) {
|
|
5
|
+
return {
|
|
6
|
+
currency: availableCurrencyFlags[index]
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
var availableCurrencyFlags = [
|
|
13
|
+
'eur',
|
|
14
|
+
'gbp',
|
|
15
|
+
'inr',
|
|
16
|
+
'usd',
|
|
17
|
+
'aed',
|
|
18
|
+
'ars',
|
|
19
|
+
'aud',
|
|
20
|
+
'bdt',
|
|
21
|
+
'bgn',
|
|
22
|
+
'brl',
|
|
23
|
+
'bwp',
|
|
24
|
+
'cad',
|
|
25
|
+
'chf',
|
|
26
|
+
'clp',
|
|
27
|
+
'cny',
|
|
28
|
+
'cop',
|
|
29
|
+
'crc',
|
|
30
|
+
'czk',
|
|
31
|
+
'dkk',
|
|
32
|
+
'egp',
|
|
33
|
+
'fjd',
|
|
34
|
+
'gel',
|
|
35
|
+
'ghs',
|
|
36
|
+
'hkd',
|
|
37
|
+
'hrk',
|
|
38
|
+
'huf',
|
|
39
|
+
'idr',
|
|
40
|
+
'ils',
|
|
41
|
+
'jpy',
|
|
42
|
+
'kes',
|
|
43
|
+
'krw',
|
|
44
|
+
'lkr',
|
|
45
|
+
'mad',
|
|
46
|
+
'mxn',
|
|
47
|
+
'myr',
|
|
48
|
+
'mzn',
|
|
49
|
+
'nad',
|
|
50
|
+
'ngn',
|
|
51
|
+
'nok',
|
|
52
|
+
'npr',
|
|
53
|
+
'nzd',
|
|
54
|
+
'pen',
|
|
55
|
+
'php',
|
|
56
|
+
'pkr',
|
|
57
|
+
'pln',
|
|
58
|
+
'ron',
|
|
59
|
+
'rub',
|
|
60
|
+
'sek',
|
|
61
|
+
'sgd',
|
|
62
|
+
'thb',
|
|
63
|
+
'try',
|
|
64
|
+
'tzs',
|
|
65
|
+
'uah',
|
|
66
|
+
'ugx',
|
|
67
|
+
'uyu',
|
|
68
|
+
'vnd',
|
|
69
|
+
'xof',
|
|
70
|
+
'zar',
|
|
71
|
+
'zmw',
|
|
72
|
+
];
|
|
73
|
+
var availablePrefixedCurrencyFlags = availableCurrencyFlags.map(function (code) { return "flag-".concat(code); });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SchemaFormControl';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SchemaFormControl';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Icon, Image, Schema } from '../../dynamic-flow-types';
|
|
3
|
+
export declare const mapConstSchemaToOption: (schema: Schema, controlType?: string) => {
|
|
4
|
+
searchStrings: string[];
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
icon?: JSX.Element | undefined;
|
|
7
|
+
currency?: string | undefined;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
} | {
|
|
11
|
+
searchStrings?: undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
icon?: JSX.Element | undefined;
|
|
14
|
+
currency?: string | undefined;
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
} | {
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
avatar?: JSX.Element | undefined;
|
|
20
|
+
currency?: string | undefined;
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const mapImage: (image?: Image) => {
|
|
25
|
+
icon: JSX.Element;
|
|
26
|
+
} | null;
|
|
27
|
+
export declare const mapIcon: (icon?: Icon) => {
|
|
28
|
+
icon: JSX.Element;
|
|
29
|
+
} | null;
|
|
30
|
+
export declare const mapIconToAvatar: (icon?: Icon) => {
|
|
31
|
+
avatar: JSX.Element;
|
|
32
|
+
} | null;
|
|
33
|
+
export declare const mapAvatar: (image?: Image) => {
|
|
34
|
+
avatar: JSX.Element;
|
|
35
|
+
} | null;
|
|
36
|
+
export declare const mapSchemaToUploadOptions: ({ accepts }: {
|
|
37
|
+
accepts?: string[] | undefined;
|
|
38
|
+
}) => {
|
|
39
|
+
usAccept?: string | undefined;
|
|
40
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { Avatar, AvatarType } from '@transferwise/components';
|
|
14
|
+
import { isArray, isNull, isUndefined } from '@transferwise/neptune-validation';
|
|
15
|
+
import DynamicIcon, { isValidIconName } from '../../layout/icon';
|
|
16
|
+
import { getCurrencyFlag } from './availableCurrencyFlags';
|
|
17
|
+
export var mapConstSchemaToOption = function (schema, controlType) {
|
|
18
|
+
switch (controlType) {
|
|
19
|
+
case 'select':
|
|
20
|
+
return __assign(__assign(__assign(__assign(__assign(__assign({
|
|
21
|
+
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
22
|
+
label: schema.title, value: schema["const"] }, getOptionDescription(schema.title, schema.description)), mapIcon(schema.icon)), mapCurrency(schema.icon)), mapImage(schema.image)), getDisabled(schema.disabled)), mapKeywordsToSearchStrings(schema.keywords));
|
|
23
|
+
case 'radio':
|
|
24
|
+
default:
|
|
25
|
+
return __assign(__assign(__assign(__assign(__assign({
|
|
26
|
+
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
27
|
+
label: schema.title, value: schema["const"] }, getOptionDescription(schema.title, schema.description)), mapIconToAvatar(schema.icon)), mapCurrency(schema.icon)), mapAvatar(schema.image)), getDisabled(schema.disabled));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// TODO: LOW avoid type assertion below -- icon.name may be undefined
|
|
31
|
+
var mapCurrency = function (icon) { return (icon ? getCurrencyFlag(icon.name) : null); };
|
|
32
|
+
var mapKeywordsToSearchStrings = function (searchStrings) {
|
|
33
|
+
return isArray(searchStrings) ? { searchStrings: searchStrings } : {};
|
|
34
|
+
};
|
|
35
|
+
export var mapImage = function (image) {
|
|
36
|
+
if (image === null || image === void 0 ? void 0 : image.url) {
|
|
37
|
+
return {
|
|
38
|
+
icon: (_jsx("div", __assign({ className: "media" }, { children: _jsx("div", __assign({ className: "np-option__no-media-circle" }, { children: _jsx("img", { src: image.url, alt: image.name || '' }) })) })))
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
export var mapIcon = function (icon) {
|
|
44
|
+
if ((icon === null || icon === void 0 ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
45
|
+
return { icon: _jsx(DynamicIcon, { type: icon.name }) };
|
|
46
|
+
}
|
|
47
|
+
if (icon === null || icon === void 0 ? void 0 : icon.text) {
|
|
48
|
+
return { icon: _jsx("span", { children: icon.text }) };
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
export var mapIconToAvatar = function (icon) {
|
|
53
|
+
if ((icon === null || icon === void 0 ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
54
|
+
return {
|
|
55
|
+
avatar: (_jsx(Avatar, __assign({ type: AvatarType.ICON }, { children: _jsx(DynamicIcon, { type: icon.name }) })))
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (icon === null || icon === void 0 ? void 0 : icon.text) {
|
|
59
|
+
return {
|
|
60
|
+
avatar: _jsx(Avatar, __assign({ type: AvatarType.INITIALS }, { children: icon.text }))
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
export var mapAvatar = function (image) {
|
|
66
|
+
return image && image.url
|
|
67
|
+
? {
|
|
68
|
+
avatar: (_jsx(Avatar, __assign({ type: AvatarType.THUMBNAIL }, { children: _jsx("img", { src: image.url, alt: "User avatar" }) })))
|
|
69
|
+
}
|
|
70
|
+
: null;
|
|
71
|
+
};
|
|
72
|
+
export var mapSchemaToUploadOptions = function (_a) {
|
|
73
|
+
var accepts = _a.accepts;
|
|
74
|
+
return (__assign({}, (isArray(accepts) && { usAccept: accepts.join(',') })));
|
|
75
|
+
};
|
|
76
|
+
var getOptionDescription = function (title, description) {
|
|
77
|
+
var _a;
|
|
78
|
+
if (title && description) {
|
|
79
|
+
var keyForDescription = (title + description).length > 50 ? 'secondary' : 'note';
|
|
80
|
+
return _a = {}, _a[keyForDescription] = description, _a;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
};
|
|
84
|
+
var getDisabled = function (disabled) {
|
|
85
|
+
if (!isUndefined(disabled) && !isNull(disabled)) {
|
|
86
|
+
return { disabled: disabled };
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var schema = {
|
|
2
|
+
allOf: [
|
|
3
|
+
{
|
|
4
|
+
title: 'Number schemas',
|
|
5
|
+
type: 'object',
|
|
6
|
+
displayOrder: ['number'],
|
|
7
|
+
properties: {
|
|
8
|
+
number: {
|
|
9
|
+
type: 'number',
|
|
10
|
+
title: 'Number input',
|
|
11
|
+
minimum: 2,
|
|
12
|
+
maximum: 200,
|
|
13
|
+
"default": 1,
|
|
14
|
+
help: { markdown: '2 or more' },
|
|
15
|
+
validationMessages: {
|
|
16
|
+
min: 'Too low buddy!',
|
|
17
|
+
max: 'Crazy high!'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
required: ['number']
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: 'String schemas',
|
|
25
|
+
type: 'object',
|
|
26
|
+
displayOrder: ['string', 'date', 'phone', 'file'],
|
|
27
|
+
properties: {
|
|
28
|
+
string: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'Text input',
|
|
31
|
+
minLength: 2,
|
|
32
|
+
maxLength: 8,
|
|
33
|
+
pattern: '^[a-z]+$',
|
|
34
|
+
"default": 'abc',
|
|
35
|
+
help: {
|
|
36
|
+
markdown: 'Keep it secret, Keep it safe'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
date: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
format: 'date',
|
|
42
|
+
title: 'Date input',
|
|
43
|
+
minimum: '2000-02-01',
|
|
44
|
+
maximum: '2010-01-01',
|
|
45
|
+
validationMessages: {
|
|
46
|
+
min: 'Must be after Feb 2000',
|
|
47
|
+
max: 'Must be before Jan 2010'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
phone: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
format: 'phone',
|
|
53
|
+
title: 'Phone input',
|
|
54
|
+
minLength: 10,
|
|
55
|
+
maxLength: 12
|
|
56
|
+
},
|
|
57
|
+
file: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
format: 'base64url',
|
|
60
|
+
title: 'File input'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
required: ['string']
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'Boolean schemas',
|
|
67
|
+
type: 'object',
|
|
68
|
+
displayOrder: ['boolean'],
|
|
69
|
+
properties: {
|
|
70
|
+
boolean: {
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
title: 'Boolean input',
|
|
73
|
+
width: 'md'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'OneOf Const schema',
|
|
79
|
+
type: 'object',
|
|
80
|
+
displayOrder: ['select', 'radio'],
|
|
81
|
+
properties: {
|
|
82
|
+
select: {
|
|
83
|
+
title: 'Select',
|
|
84
|
+
placeholder: 'Please choose',
|
|
85
|
+
oneOf: [
|
|
86
|
+
{
|
|
87
|
+
title: 'One',
|
|
88
|
+
"const": 'one'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: 'Two',
|
|
92
|
+
"const": 'two'
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: 'Three',
|
|
96
|
+
"const": 'three'
|
|
97
|
+
},
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
radio: {
|
|
101
|
+
title: 'Radio',
|
|
102
|
+
placeholder: 'Please choose',
|
|
103
|
+
oneOf: [
|
|
104
|
+
{
|
|
105
|
+
title: 'One',
|
|
106
|
+
"const": 'one'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
title: 'Two',
|
|
110
|
+
"const": 'two'
|
|
111
|
+
},
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
required: ['select', 'radio']
|
|
116
|
+
},
|
|
117
|
+
]
|
|
118
|
+
};
|
|
119
|
+
export default schema;
|