@wise/dynamic-flow-client 1.3.0 → 1.3.2
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/main.js +614 -3429
- package/build/main.min.js +1 -22
- package/build/types/common/constants/index.d.ts +0 -1
- package/build/types/common/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +1 -10
- package/build/types/common/hooks/usePersistAsync/usePersistAsync.d.ts +1 -1
- package/build/types/common/hooks/useStepPolling/useStepPolling.d.ts +1 -1
- package/build/types/common/utils/index.d.ts +3 -1
- package/build/types/common/utils/misc-utils.d.ts +2 -0
- package/build/types/{types/specification/Model.d.ts → common/utils/model-utils.d.ts} +1 -6
- package/build/types/common/utils/schema-utils.d.ts +23 -11
- package/build/types/common/utils/step-utils.d.ts +1 -1
- package/build/types/common/validators/models/model-validators.d.ts +1 -1
- package/build/types/common/validators/models/models.utils.d.ts +1 -1
- package/build/types/common/validators/schemas/schema-validators.d.ts +1 -1
- package/build/types/common/validators/validationFailures/validation-failures.d.ts +1 -1
- package/build/types/dynamicFlow/DynamicFlowStep.d.ts +1 -1
- package/build/types/dynamicFlow/DynamicFlowTypes.d.ts +1 -1
- package/build/types/dynamicFlow/utils/responseParsers/response-parsers.d.ts +1 -1
- package/build/types/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +2 -1
- package/build/types/dynamicFlow/utils/useDynamicFlowState.d.ts +1 -1
- package/build/types/formControl/FormControl.d.ts +58 -2
- package/build/types/index.d.ts +1 -2
- package/build/types/jsonSchemaForm/JsonSchemaForm.d.ts +1 -1
- package/build/types/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +1 -2
- package/build/types/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
- package/build/types/jsonSchemaForm/genericSchema/GenericSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/oneOfSchema/{utils/one-of-utils.d.ts → utils.d.ts} +1 -2
- package/build/types/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +1 -1
- package/build/types/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.d.ts +1 -1
- package/build/types/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +1 -1
- package/build/types/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
- package/build/types/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -1
- package/build/types/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +1 -1
- package/build/types/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +1 -2
- package/build/types/layout/DynamicLayout.d.ts +1 -1
- package/build/types/layout/alert/DynamicAlert.d.ts +1 -1
- package/build/types/layout/box/DynamicBox.d.ts +1 -1
- package/build/types/layout/button/DynamicButton.d.ts +1 -1
- package/build/types/layout/button/utils.d.ts +1 -2
- package/build/types/layout/columns/DynamicColumns.d.ts +1 -1
- package/build/types/layout/decision/DynamicDecision.d.ts +1 -1
- package/build/types/layout/divider/DynamicDivider.d.ts +1 -1
- package/build/types/layout/external/DynamicExternal.d.ts +1 -1
- package/build/types/layout/form/DynamicForm.d.ts +1 -1
- package/build/types/layout/heading/DynamicHeading.d.ts +1 -1
- package/build/types/layout/image/DynamicImage.d.ts +1 -1
- package/build/types/layout/list/DynamicList.d.ts +1 -1
- package/build/types/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +1 -1
- package/build/types/layout/markdown/DynamicMarkdown.d.ts +1 -1
- package/build/types/layout/paragraph/DynamicParagraph.d.ts +1 -1
- package/build/types/layout/review/DynamicReview.d.ts +1 -1
- package/build/types/layout/utils.d.ts +1 -1
- package/build/types/step/cameraStep/CameraStep.d.ts +1 -1
- package/build/types/step/cameraStep/cameraCapture/CameraCapture.d.ts +1 -1
- package/build/types/step/cameraStep/cameraCapture/hooks/index.d.ts +1 -1
- package/build/types/step/cameraStep/cameraCapture/tracking/index.d.ts +1 -1
- package/build/types/step/layoutStep/LayoutStep.d.ts +1 -1
- package/build/types/step/layoutStep/utils/inline-reference-utils.d.ts +1 -1
- package/build/types/step/layoutStep/utils/layout-utils.d.ts +1 -1
- package/package.json +5 -3
- package/build/types/common/constants/SchemaType.d.ts +0 -11
- package/build/types/fixtures/components/alert.d.ts +0 -3
- package/build/types/fixtures/components/box.d.ts +0 -3
- package/build/types/fixtures/components/button.d.ts +0 -3
- package/build/types/fixtures/components/columns.d.ts +0 -3
- package/build/types/fixtures/components/copyable.d.ts +0 -3
- package/build/types/fixtures/components/decision-flags.d.ts +0 -3
- package/build/types/fixtures/components/decision-icons.d.ts +0 -3
- package/build/types/fixtures/components/decision.d.ts +0 -3
- package/build/types/fixtures/components/heading.d.ts +0 -3
- package/build/types/fixtures/components/image.d.ts +0 -3
- package/build/types/fixtures/components/index.d.ts +0 -15
- package/build/types/fixtures/components/info.d.ts +0 -3
- package/build/types/fixtures/components/list.d.ts +0 -3
- package/build/types/fixtures/components/loading-indicator.d.ts +0 -3
- package/build/types/fixtures/components/paragraph.d.ts +0 -3
- package/build/types/fixtures/components/review.d.ts +0 -3
- package/build/types/fixtures/examples/camera-capture.d.ts +0 -3
- package/build/types/fixtures/examples/index.d.ts +0 -5
- package/build/types/fixtures/examples/recipient-update.d.ts +0 -3
- package/build/types/fixtures/examples/recipient.d.ts +0 -3
- package/build/types/fixtures/examples/single-file-upload.d.ts +0 -3
- package/build/types/fixtures/examples/step-validation-errors.d.ts +0 -3
- package/build/types/fixtures/features/action-response.d.ts +0 -3
- package/build/types/fixtures/features/external.d.ts +0 -3
- package/build/types/fixtures/features/index.d.ts +0 -5
- package/build/types/fixtures/features/persist-async.d.ts +0 -3
- package/build/types/fixtures/features/polling.d.ts +0 -3
- package/build/types/fixtures/features/validation-async.d.ts +0 -3
- package/build/types/fixtures/index.d.ts +0 -50
- package/build/types/fixtures/jsonSchemaForm/allOf.d.ts +0 -3
- package/build/types/fixtures/layouts/all.d.ts +0 -3
- package/build/types/fixtures/layouts/final-step-layout.d.ts +0 -3
- package/build/types/fixtures/layouts/index.d.ts +0 -6
- package/build/types/fixtures/layouts/list.d.ts +0 -3
- package/build/types/fixtures/layouts/pay-in.d.ts +0 -3
- package/build/types/fixtures/layouts/review.d.ts +0 -3
- package/build/types/fixtures/layouts/success.d.ts +0 -3
- package/build/types/fixtures/responses/action-response-final.d.ts +0 -3
- package/build/types/fixtures/responses/action.d.ts +0 -5
- package/build/types/fixtures/responses/exit.d.ts +0 -6
- package/build/types/fixtures/responses/index.d.ts +0 -4
- package/build/types/fixtures/responses/recipient-update-final.d.ts +0 -3
- package/build/types/fixtures/schemas/all-of.d.ts +0 -3
- package/build/types/fixtures/schemas/basic-form.d.ts +0 -3
- package/build/types/fixtures/schemas/boolean.d.ts +0 -3
- package/build/types/fixtures/schemas/index.d.ts +0 -6
- package/build/types/fixtures/schemas/number-and-integer.d.ts +0 -3
- package/build/types/fixtures/schemas/one-of.d.ts +0 -3
- package/build/types/fixtures/schemas/string-formats.d.ts +0 -3
- package/build/types/fixtures/utils/image-util.d.ts +0 -2
- package/build/types/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.d.ts +0 -3
- package/build/types/jsonSchemaForm/oneOfSchema/utils/index.d.ts +0 -2
- package/build/types/types/common/FormControl.d.ts +0 -57
- package/build/types/types/index.d.ts +0 -15
- package/build/types/types/specification/Action.d.ts +0 -19
- package/build/types/types/specification/FileUploadSchema.d.ts +0 -23
- package/build/types/types/specification/LayoutComponent.d.ts +0 -145
- package/build/types/types/specification/PersistAsync.d.ts +0 -8
- package/build/types/types/specification/Polling.d.ts +0 -12
- package/build/types/types/specification/Promotion.d.ts +0 -20
- package/build/types/types/specification/Schema.d.ts +0 -192
- package/build/types/types/specification/Step.d.ts +0 -118
- package/build/types/types/specification/ValidationAsync.d.ts +0 -6
- package/build/types/types/specification/core.d.ts +0 -29
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { Action,
|
|
2
|
-
export type ExternalStepPollingConfiguration = PollingConfiguration & {
|
|
3
|
-
maxConsecutiveFails: number;
|
|
4
|
-
responseHandlers: ResponseHandler[];
|
|
5
|
-
};
|
|
6
|
-
type ResponseHandler = {
|
|
7
|
-
result: string;
|
|
8
|
-
action: Action;
|
|
9
|
-
};
|
|
1
|
+
import { Action, ExternalStepPollingConfiguration } from '@wise/dynamic-flow-types';
|
|
10
2
|
/** @deprecated External step is no longer supported */
|
|
11
3
|
export declare function useExternalStepPolling(polling: ExternalStepPollingConfiguration | undefined, onAction: (action: Action) => void): void;
|
|
12
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Action, PollingConfiguration } from '
|
|
1
|
+
import { Action, PollingConfiguration } from '@wise/dynamic-flow-types';
|
|
2
2
|
export declare function useStepPolling(polling: PollingConfiguration | undefined, onAction: (action: Action) => void): void;
|
|
@@ -4,5 +4,7 @@ export * from './debounce';
|
|
|
4
4
|
export * from './is-equal';
|
|
5
5
|
export * from './file-utils';
|
|
6
6
|
export * from './id-utils';
|
|
7
|
-
export * from './schema-utils';
|
|
8
7
|
export * from './step-utils';
|
|
8
|
+
export * from './model-utils';
|
|
9
|
+
export * from './misc-utils';
|
|
10
|
+
export * from './schema-utils';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type ObjectModel = {
|
|
3
|
-
[key: string]: Model;
|
|
4
|
-
};
|
|
5
|
-
export type ArrayModel = Array<BasicModel | null>;
|
|
6
|
-
export type Model = BasicModel | ObjectModel | ArrayModel | null;
|
|
1
|
+
import { ArrayModel, BasicModel, Model, ObjectModel } from '@wise/dynamic-flow-types';
|
|
7
2
|
export declare const isObjectModel: (model: Model) => model is ObjectModel;
|
|
8
3
|
export declare const isNullableObjectModel: (model: Model) => model is ObjectModel | null;
|
|
9
4
|
export declare const isNullableBasicModel: (model: Model) => model is BasicModel | null;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AllOfSchema, ArraySchema, BasicSchema, BlobSchema, ConstSchema, FileUploadSchema, ListArraySchema, MultipleFileUploadSchema, ObjectSchema, OneOfObjectSchema, OneOfSchema, PersistAsyncSchema, Schema, StringSchema, TupleArraySchema, ValidationAsyncSchema } from '@wise/dynamic-flow-types';
|
|
2
|
+
export declare function isConstSchema(schema: Schema | undefined): schema is ConstSchema;
|
|
3
|
+
export declare function isNoNConstSchema(schema: Schema | undefined): boolean;
|
|
2
4
|
export declare const isReadOnlySchema: (schema: Schema) => boolean;
|
|
3
5
|
export declare const isPromotedOneOfSchema: (schema: Schema) => boolean;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
13
|
-
export declare function
|
|
6
|
+
export declare const basicTypes: Set<string>;
|
|
7
|
+
export declare function isBasicSchema(schema: Schema): schema is BasicSchema;
|
|
8
|
+
export declare function isObjectSchema(schema: Schema): schema is ObjectSchema;
|
|
9
|
+
export declare function isOneOfObjectSchema(schema: Schema): schema is OneOfObjectSchema;
|
|
10
|
+
export declare function isOneOfSchema(schema: Schema): schema is OneOfSchema;
|
|
11
|
+
export declare function isAllOfSchema(schema: Schema): schema is AllOfSchema;
|
|
12
|
+
export declare function isBlobSchema(schema: Schema): schema is BlobSchema;
|
|
13
|
+
export declare function isArraySchema(schema: Schema): schema is ArraySchema;
|
|
14
|
+
export declare function isTupleArraySchema(schema: ArraySchema): schema is TupleArraySchema;
|
|
15
|
+
export declare function isListArraySchema(schema: ArraySchema): schema is ListArraySchema;
|
|
16
|
+
export declare function isStringSchema(schema: Schema): schema is StringSchema;
|
|
17
|
+
export declare function isPersistAsyncSchema(schema: Schema): schema is PersistAsyncSchema;
|
|
18
|
+
export declare function isPersistAsyncFileSchema(schema: Schema): schema is PersistAsyncSchema;
|
|
19
|
+
export declare const isValidationAsyncSchema: (schema: Schema) => schema is ValidationAsyncSchema;
|
|
20
|
+
export declare function isFileUploadSchema(schema: {
|
|
21
|
+
type?: string;
|
|
22
|
+
format?: string;
|
|
23
|
+
}): schema is FileUploadSchema;
|
|
24
|
+
export declare const isMultipleFileUploadSchema: (schema: Schema) => schema is MultipleFileUploadSchema;
|
|
25
|
+
export declare const getSchemaType: (schema: Schema) => "persistAsync" | "array" | "object" | "allOf" | "oneOf" | "readOnly" | "validationAsync" | "promotedOneOf" | "basic" | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicModel, Model, ObjectModel, Schema } from '
|
|
1
|
+
import { BasicModel, Model, ObjectModel, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
export declare const getValidModelParts: (model: Model, schema: Schema) => Model;
|
|
3
3
|
export declare function getValidBasicModelOrNull(model: BasicModel | null, schema: Schema): BasicModel | null;
|
|
4
4
|
export declare function getValidObjectModelParts(model: ObjectModel | null, schema: Schema): ObjectModel | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '
|
|
1
|
+
import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
export declare function cleanBasicModelWithOneOfSchema(model: BasicModel, schema: OneOfSchema): BasicModel | null;
|
|
3
3
|
export declare function cleanArrayModelWithOneOfSchema(model: ArrayModel, schema: OneOfSchema): ArrayModel | null;
|
|
4
4
|
export declare function cleanModelWithStringSchema(model: Model): string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '
|
|
1
|
+
import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
declare function getValidationFailures(value: Model, schema: Schema, isRequired: boolean): string[];
|
|
3
3
|
declare function getStringValidationFailures(value: Model, schema: StringSchema, isRequired?: boolean): string[];
|
|
4
4
|
declare function getNumberValidationFailures(value: Model, schema: AllOfSchema | OneOfSchema | NumberSchema | IntegerSchema, isRequired?: boolean): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { GlobalError, Step } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { LayoutStepProps } from '../step/layoutStep/LayoutStep';
|
|
2
|
-
import { GlobalError, Step } from '../types';
|
|
3
3
|
type DynamicFlowStepProps = Omit<LayoutStepProps, 'stepSpecification'> & {
|
|
4
4
|
step: Step | undefined;
|
|
5
5
|
globalError: GlobalError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Action, Schema, Size, Step } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { EventHandler, LogEventHandler } from '../common/contexts';
|
|
2
3
|
import { OnChangeProps } from '../jsonSchemaForm/JsonSchemaForm';
|
|
3
|
-
import { Action, Schema, Size, Step } from '../types';
|
|
4
4
|
export type DynamicFlowPropsBasic = {
|
|
5
5
|
flowId: string;
|
|
6
6
|
loaderConfig?: LoaderConfig;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Schema } from '
|
|
1
|
+
import { Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { ETag } from '../../DynamicFlowTypes';
|
|
3
3
|
type FetchRefresh = (url: string, data: unknown, etag: ETag | undefined) => Promise<void | null>;
|
|
4
4
|
export declare function useDebouncedRefresh(fetchRefresh: FetchRefresh): (url: string, data: unknown, etag: ETag | undefined, schema: Schema) => void;
|
|
5
|
+
export declare const shouldDebounceSchema: (schema: Schema) => boolean;
|
|
5
6
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RadioGroupRadios } from '@transferwise/components/build/types/radioGroup/RadioGroup';
|
|
2
|
+
import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
import { PureComponent } from 'react';
|
|
3
|
-
import {
|
|
5
|
+
import { FormControlType } from '../common/constants';
|
|
4
6
|
export default class FormControl extends PureComponent<FormControlProps, FormControlState> {
|
|
5
7
|
static Type: {
|
|
6
8
|
RADIO: string;
|
|
@@ -44,7 +46,7 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
|
|
|
44
46
|
* is present. Chrome ignores autocomplete=off, the only way to disable it is
|
|
45
47
|
* to provide an 'invalid' value, for which 'disabled' serves.
|
|
46
48
|
*/
|
|
47
|
-
getAutocompleteStatus: () => "
|
|
49
|
+
getAutocompleteStatus: () => "on" | "disabled";
|
|
48
50
|
handleOnChange: (value: string | number | boolean | null) => void;
|
|
49
51
|
handleInputOnChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
50
52
|
handleOnFocus: () => void;
|
|
@@ -84,3 +86,57 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
|
|
|
84
86
|
value: null;
|
|
85
87
|
};
|
|
86
88
|
}
|
|
89
|
+
type FormControlOption = {
|
|
90
|
+
value: number | string | boolean;
|
|
91
|
+
label: string;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
note?: string;
|
|
94
|
+
secondary?: string;
|
|
95
|
+
};
|
|
96
|
+
type FormControlSelectedOption = {
|
|
97
|
+
value: number | string | boolean;
|
|
98
|
+
label: string;
|
|
99
|
+
icon?: ReactNode;
|
|
100
|
+
currency?: string;
|
|
101
|
+
note?: ReactNode;
|
|
102
|
+
secondary?: ReactNode;
|
|
103
|
+
};
|
|
104
|
+
type FormControlProps = {
|
|
105
|
+
name: string;
|
|
106
|
+
onChange: (value: string | number | boolean | null, type?: 'init' | 'user') => void;
|
|
107
|
+
autoComplete?: boolean;
|
|
108
|
+
countryCode?: string;
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
displayPattern?: string;
|
|
111
|
+
id: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
max?: number;
|
|
114
|
+
maxDate?: Date;
|
|
115
|
+
maxLength?: number;
|
|
116
|
+
min?: number;
|
|
117
|
+
minDate?: Date;
|
|
118
|
+
minLength?: number;
|
|
119
|
+
mode?: 'day-month-year' | 'month-year';
|
|
120
|
+
monthFormat?: 'long' | 'short';
|
|
121
|
+
onBlur?: () => void;
|
|
122
|
+
onFocus?: () => void;
|
|
123
|
+
onSearchChange?: (searchValue: string) => void;
|
|
124
|
+
options: Array<FormControlOption>;
|
|
125
|
+
placeholder?: string;
|
|
126
|
+
readOnly?: boolean;
|
|
127
|
+
required?: boolean;
|
|
128
|
+
searchPlaceholder?: string;
|
|
129
|
+
searchValue?: string;
|
|
130
|
+
selectedOption?: FormControlSelectedOption;
|
|
131
|
+
size?: 'sm' | 'md' | 'lg';
|
|
132
|
+
step?: number;
|
|
133
|
+
type?: (typeof FormControlType)[keyof typeof FormControlType];
|
|
134
|
+
uploadProps: UploadProps;
|
|
135
|
+
value: Date | string | number | boolean | null;
|
|
136
|
+
};
|
|
137
|
+
type FormControlState = {
|
|
138
|
+
prevValue: FormControlProps['value'];
|
|
139
|
+
selectedOption: FormControlSelectedOption | undefined;
|
|
140
|
+
touched: boolean;
|
|
141
|
+
};
|
|
142
|
+
export {};
|
package/build/types/index.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ export { makeHttpClient } from './common/makeHttpClient';
|
|
|
4
4
|
export { default as JsonSchemaForm } from './jsonSchemaForm';
|
|
5
5
|
export { DynamicLayout as Layout } from './layout';
|
|
6
6
|
export { isValidSchema } from './common/validators';
|
|
7
|
-
export { fixtures } from './fixtures';
|
|
8
7
|
export { default as translations } from './i18n';
|
|
9
8
|
export * from './dynamicFlow/DynamicFlow';
|
|
10
9
|
export type { DynamicFlowProps, InitialAction } from './dynamicFlow/DynamicFlowTypes';
|
|
11
|
-
export type { Step } from '
|
|
10
|
+
export type { Step } from '@wise/dynamic-flow-types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { FormErrors, Model, Schema } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { EventHandler, LogEventHandler } from '../common/contexts';
|
|
2
3
|
import { OnPersistAsync } from '../dynamicFlow/DynamicFlowTypes';
|
|
3
|
-
import { FormErrors, Model, Schema } from '../types';
|
|
4
4
|
declare const JsonSchemaForm: (props: JsonSchemaFormProps) => JSX.Element;
|
|
5
5
|
export type OnChange = (parameters: OnChangeProps) => void;
|
|
6
6
|
export type OnChangeProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllOfSchema as AllOfSchemaType, ObjectModel } from '
|
|
1
|
+
import { AllOfSchema as AllOfSchemaType, ObjectModel } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const AllOfSchema: {
|
|
4
4
|
(props: AllOfSchemaProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayModel, ArraySchema as ArraySchemaType } from '
|
|
1
|
+
import { ArrayModel, ArraySchema as ArraySchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const ArraySchema: {
|
|
4
4
|
(props: ArraySchemaProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayModel, ArraySchema as ArraySchemaType } from '
|
|
1
|
+
import { ArrayModel, ArraySchema as ArraySchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
|
|
3
3
|
declare const ArrayListSchema: {
|
|
4
4
|
(props: Props): JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ArrayModel } from '
|
|
2
|
-
import { MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '../../../../types';
|
|
1
|
+
import { ArrayModel, MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '@wise/dynamic-flow-types';
|
|
3
2
|
import { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
|
|
4
3
|
declare const MultipleFileUploadSchema: {
|
|
5
4
|
(props: Props): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicModel, BasicSchema } from '
|
|
1
|
+
import { BasicModel, BasicSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { OnChange } from '../JsonSchemaForm';
|
|
3
3
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
4
4
|
declare const BasicTypeSchema: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { FormErrors, Model, Schema } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { OnPersistAsync } from '../../dynamicFlow/DynamicFlowTypes';
|
|
2
|
-
import { FormErrors, Model, Schema } from '../../types';
|
|
3
3
|
import { OnChange } from '../JsonSchemaForm';
|
|
4
4
|
declare const GenericSchemaForm: (props: GenericSchemaFormProps) => JSX.Element;
|
|
5
5
|
export type GenericSchemaProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectModel, ObjectSchema as ObjectSchemaType } from '
|
|
1
|
+
import { ObjectModel, ObjectSchema as ObjectSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const ObjectSchema: {
|
|
4
4
|
(props: ObjectSchemaProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OneOfSchema as OneOfSchemaType } from '
|
|
1
|
+
import { OneOfSchema as OneOfSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const OneOfSchema: {
|
|
4
4
|
(props: OneOfSchemaProps): JSX.Element | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Model, ObjectModel, OneOfSchema } from '
|
|
2
|
-
import { OneOfObjectSchema } from '../../../types';
|
|
1
|
+
import { Model, ObjectModel, OneOfSchema, OneOfObjectSchema } from '@wise/dynamic-flow-types';
|
|
3
2
|
export declare const getActiveSchemaIndex: (schema: OneOfSchema, model: Model) => number | null;
|
|
4
3
|
export declare const getValidIndexFromValue: (schema: OneOfSchema, value: Model | undefined) => number;
|
|
5
4
|
export declare function getBestMatchingSchemaIndexForValue(schema: OneOfObjectSchema, value: ObjectModel): number | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PersistAsyncSchema as PersistAsyncSchemaType } from '
|
|
1
|
+
import { PersistAsyncSchema as PersistAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const PersistAsyncSchema: {
|
|
4
4
|
(props: PersistAsyncSchemaProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PersistAsync, Schema } from '
|
|
1
|
+
import { PersistAsync, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
|
|
3
3
|
export declare const getIdFromResponse: (idProperty: string, response: Record<string, unknown>) => string | number;
|
|
4
4
|
export declare const getErrorFromResponse: (errorProperty: string, response: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlobSchema, PersistAsync, Schema } from '
|
|
1
|
+
import { BlobSchema, PersistAsync, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
|
|
3
3
|
declare const PersistAsyncBlobSchema: {
|
|
4
4
|
(props: PersistAsyncBlobSchemaProps): JSX.Element;
|
package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
|
|
2
|
+
import { PersistAsync } from '@wise/dynamic-flow-types';
|
|
2
3
|
import { HttpClient } from '../../../dynamicFlow/DynamicFlowTypes';
|
|
3
|
-
import { PersistAsync } from '../../../types';
|
|
4
4
|
type Props = UploadProps & {
|
|
5
5
|
id: string;
|
|
6
6
|
httpClient: HttpClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectModel, OneOfObjectSchema } from '
|
|
1
|
+
import { ObjectModel, OneOfObjectSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare const PromotedOneOfSchema: (props: PromotedOneOfSchemaProps) => JSX.Element;
|
|
4
4
|
export type PromotedOneOfSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model'> & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ObjectModel, OneOfObjectSchema } from '
|
|
1
|
+
import { ObjectModel, OneOfObjectSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
export declare const getSelectionFromModel: (schema: OneOfObjectSchema, model: ObjectModel) => "promoted" | "other" | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { BasicModel, Schema } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { FormControlType } from '../../common/constants';
|
|
2
|
-
import { BasicModel, Schema } from '../../types';
|
|
3
3
|
export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
|
|
4
4
|
declare const SchemaFormControl: {
|
|
5
5
|
(props: SchemaFormControlProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Icon, Image, Schema } from '
|
|
1
|
+
import { Icon, Image, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
declare const mapConstSchemaToOption: <ControlType extends string>(schema: Schema, controlType?: ControlType | undefined) => ControlType extends "select" ? SelectOption : RadioOption;
|
|
3
3
|
type RadioOption = {
|
|
4
4
|
disabled?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BasicModel } from '
|
|
2
|
-
import { ValidationAsyncSchema as ValidationAsyncSchemaType } from '../../types';
|
|
1
|
+
import { BasicModel, ValidationAsyncSchema as ValidationAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
3
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
4
3
|
declare const ValidationAsyncSchema: {
|
|
5
4
|
(props: ValidationAsyncSchemaProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { FormErrors, LayoutComponent, Model } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { OnAction, OnModelChange, OnPersistAsync } from '../dynamicFlow/DynamicFlowTypes';
|
|
2
|
-
import { FormErrors, LayoutComponent, Model } from '../types';
|
|
3
3
|
export type CommonLayoutProps = {
|
|
4
4
|
model?: Model;
|
|
5
5
|
submitted: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonLayout } from '
|
|
1
|
+
import { ButtonLayout } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { CommonLayoutProps } from '../DynamicLayout';
|
|
3
3
|
type Props = Omit<CommonLayoutProps, 'submitted' | 'onModelChange' | 'onPersistAsync'> & {
|
|
4
4
|
component: ButtonLayout;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ButtonLayout } from '
|
|
2
|
-
import { Size } from '../../types';
|
|
1
|
+
import { ButtonLayout, Size } from '@wise/dynamic-flow-types';
|
|
3
2
|
export declare const getButtonPriority: (component: ButtonLayout) => "primary" | "secondary" | "tertiary";
|
|
4
3
|
export declare const getButtonType: (component: ButtonLayout) => "positive" | "negative" | "accent";
|
|
5
4
|
export declare const getButtonSize: (size: Size | undefined) => "sm" | "md" | "lg";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Align, Size } from '
|
|
1
|
+
import { Align, Size } from '@wise/dynamic-flow-types';
|
|
2
2
|
declare const getMarginBottom: (size: Size | undefined) => "" | "m-b-0" | "m-b-1" | "m-b-2" | "m-b-3" | "m-b-5";
|
|
3
3
|
declare const getTextAlignmentAndMargin: (component: {
|
|
4
4
|
align?: Align;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CameraDirection } from '@wise/dynamic-flow-types';
|
|
1
2
|
import { EventHandler } from '../../../../common/contexts';
|
|
2
|
-
import { CameraDirection } from '../../../../types';
|
|
3
3
|
export declare const trackCameraPermissionDenied: (onEvent: EventHandler | undefined) => void | undefined;
|
|
4
4
|
export declare const trackCameraFeedStarted: (onEvent: EventHandler | undefined, props: {
|
|
5
5
|
direction?: CameraDirection;
|