@wise/dynamic-flow-client 2.9.3 → 2.9.5
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/i18n/pt.json +1 -1
- package/build/i18n/th.json +3 -3
- package/build/main.css +2 -2
- package/build/main.js +20 -11
- package/build/main.min.js +1 -1
- package/build/types/legacy/formControl/utils/getAutocompleteString.d.ts +1 -1
- package/build/types/legacy/layout/modal/DynamicModal.d.ts +3 -3
- package/build/types/revamp/DynamicFlowCore.d.ts +2 -3
- package/build/types/revamp/DynamicFlowWise.d.ts +1 -1
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +8 -4
- package/build/types/revamp/domain/components/ConstComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/ContainerComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +7 -3
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +7 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +21 -0
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +7 -3
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +4 -9
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +10 -7
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +7 -3
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +9 -4
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +9 -13
- package/build/types/revamp/domain/components/utils/file-utils.d.ts +1 -0
- package/build/types/revamp/domain/components/utils/isPartialLocalValueMatch.d.ts +2 -0
- package/build/types/revamp/domain/features/events/getAnalyticsEventDispatcher.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +7 -1
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +4 -4
- package/build/types/revamp/domain/features/persistAsync/persist-async-utils.d.ts +3 -2
- package/build/types/revamp/domain/features/refresh/getPerformRefresh.d.ts +5 -0
- package/build/types/revamp/domain/features/search/getPerformSearchFunction.d.ts +1 -1
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +2 -2
- package/build/types/revamp/domain/features/validation/spec-utils.d.ts +2 -0
- package/build/types/revamp/domain/features/validation/validation-functions.d.ts +3 -3
- package/build/types/revamp/domain/features/validation/value-checks.d.ts +9 -6
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/decisionLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/dividerLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/imageLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/infoLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/instructionsLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/listLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/loadingIndicatorLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/markdownLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/modalLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/reviewLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/searchLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/statusListLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.d.ts +9 -0
- package/build/types/revamp/domain/mappers/schema/blobSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/booleanSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/constSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/integerSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/numberSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +4 -0
- package/build/types/revamp/domain/mappers/schema/types.d.ts +6 -2
- package/build/types/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +3 -4
- package/build/types/revamp/domain/mappers/types.d.ts +2 -0
- package/build/types/revamp/domain/types.d.ts +27 -18
- package/build/types/revamp/flow/executeRefresh.d.ts +19 -0
- package/build/types/revamp/flow/executeSubmission.d.ts +20 -0
- package/build/types/revamp/flow/getResponseType.d.ts +10 -0
- package/build/types/revamp/flow/response-utils.d.ts +6 -0
- package/build/types/revamp/renderers/CoreContainerRenderer.d.ts +2 -2
- package/build/types/revamp/renderers/mappers/instructionsComponentToProps.d.ts +2 -7
- package/build/types/revamp/renderers/mappers/multiUploadInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -3
- package/build/types/revamp/renderers/types.d.ts +113 -66
- package/build/types/revamp/step/Step.d.ts +11 -4
- package/build/types/revamp/step/utils/getRenderFunction.d.ts +2 -2
- package/build/types/revamp/test-utils/step-utils.d.ts +2 -0
- package/build/types/revamp/types.d.ts +41 -0
- package/build/types/revamp/utils/component-utils.d.ts +3 -2
- package/build/types/revamp/utils/findComponent.d.ts +1 -1
- package/build/types/revamp/utils/type-utils.d.ts +13 -2
- package/build/types/revamp/utils/type-validators.d.ts +1 -0
- package/build/types/revamp/wise/renderers/MultiUploadInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/components/LabelContentWithHelp.d.ts +4 -0
- package/build/types/revamp/wise/renderers/components/UploadFieldInput.d.ts +11 -0
- package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +1 -2
- package/build/types/revamp/wise/renderers/utils/file-utils.d.ts +3 -0
- package/build/types/revamp/wise/renderers/utils/getRandomId.d.ts +1 -0
- package/package.json +24 -25
- package/build/types/revamp/domain/components/utils/isModelPartialOf.d.ts +0 -2
- package/build/types/revamp/dynamic-flow-types.d.ts +0 -38
- /package/build/types/{legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts → common/messages/multi-file-upload.messages.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SearchLayout } from '@wise/dynamic-flow-types/build/next/layout/SearchLayout';
|
|
2
2
|
import type { MapperProps } from '../schema/types';
|
|
3
|
-
export declare const searchLayoutToComponent: ({ control, emptyMessage, method, param, title, url, margin }: SearchLayout, mapperProps: MapperProps) => import("../../components/searchComponent/SearchComponent").SearchComponent;
|
|
3
|
+
export declare const searchLayoutToComponent: (uid: string, { control, emptyMessage, method, param, title, url, margin }: SearchLayout, mapperProps: MapperProps) => import("../../components/searchComponent/SearchComponent").SearchComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { StatusListLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
export declare const statusListLayoutToComponent: ({ control, items, margin, title
|
|
2
|
+
export declare const statusListLayoutToComponent: (uid: string, { control, items, margin, title }: StatusListLayout) => import("../../components/StatusListComponent").StatusListComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Layout } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { StepComponent } from '../types';
|
|
3
3
|
import type { MapperProps } from './schema/types';
|
|
4
|
-
export declare const mapLayoutToComponent: (layout: Layout, mapperProps: MapperProps) => StepComponent;
|
|
4
|
+
export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps) => StepComponent;
|
package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { MapperProps, SchemaMapperProps } from '../types';
|
|
|
2
2
|
import type { ArraySchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
3
|
export declare const arraySchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: ArraySchema;
|
|
5
|
-
}, mapperProps: MapperProps) => import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/MultiUploadInputComponent").MultiUploadInputComponent | import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArraySchemaList, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
import { type PersistAsyncWithUploadSchema, type StringSchemaWithUpload } from '../../../../utils/type-utils';
|
|
4
|
+
export declare const arraySchemaToMultiUploadComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
5
|
+
schema: ArraySchemaList & {
|
|
6
|
+
items: PersistAsyncWithUploadSchema | StringSchemaWithUpload;
|
|
7
|
+
};
|
|
8
|
+
model: Model[] | null;
|
|
9
|
+
}, mapperProps: MapperProps) => import("../../../components/MultiUploadInputComponent").MultiUploadInputComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BlobSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from './types';
|
|
3
|
+
export declare const blobSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: BlobSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../components/UploadInputComponent").UploadInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
1
|
import type { BooleanSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from './types';
|
|
3
3
|
export declare const booleanSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: BooleanSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/BooleanInputComponent").BooleanInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaMapperProps } from './types';
|
|
2
2
|
import type { ConstSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
export declare const constSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
3
|
+
export declare const constSchemaToComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: ConstSchema;
|
|
5
5
|
}) => import("../../components/ConstComponent").ConstComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
1
|
import type { IntegerSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from './types';
|
|
3
3
|
export declare const integerSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: IntegerSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/IntegerInputComponent").IntegerInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
1
|
import type { NumberSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from './types';
|
|
3
3
|
export declare const numberSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: NumberSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/NumberInputComponent").NumberInputComponent;
|
|
@@ -3,10 +3,12 @@ import type { Schema, Step } from '@wise/dynamic-flow-types/build/next';
|
|
|
3
3
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
4
4
|
import type { StepComponent } from '../../../types';
|
|
5
5
|
export declare const getMockMapperProps: (mapperProps?: Partial<MapperProps>) => {
|
|
6
|
+
stepLocalValue: import("../../../types").LocalValue;
|
|
6
7
|
step: Step;
|
|
7
8
|
getErrorMessageFunctions: jest.Mock<any, any, any> | import("../../types").GetErrorMessageFunctions;
|
|
8
9
|
httpClient: typeof fetch | jest.Mock<any, any, any>;
|
|
9
10
|
onAction: jest.Mock<any, any, any> | import("../../../types").OnAction;
|
|
11
|
+
onRefresh: jest.Mock<any, any, any> | import("../../../types").OnRefresh;
|
|
10
12
|
updateComponent: jest.Mock<any, any, any> | import("../../../types").UpdateComponent;
|
|
11
13
|
trackEvent: jest.Mock<any, any, any> | import("../../../features/events").AnalyticsEventDispatcher;
|
|
12
14
|
logEvent: jest.Mock<any, any, any> | import("../../../features/events").LoggingEventDispatcher;
|
|
@@ -14,8 +16,10 @@ export declare const getMockMapperProps: (mapperProps?: Partial<MapperProps>) =>
|
|
|
14
16
|
export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperProps: Partial<SchemaMapperProps> & {
|
|
15
17
|
schema: S;
|
|
16
18
|
}) => {
|
|
19
|
+
uid: string;
|
|
17
20
|
schema: (Schema | undefined) & S;
|
|
18
21
|
model: import("@wise/dynamic-flow-types/build/next").JsonElement;
|
|
22
|
+
localValue: import("../../../types").LocalValue;
|
|
19
23
|
required: boolean;
|
|
20
24
|
validationErrors: import("@wise/dynamic-flow-types/build/next").JsonElement;
|
|
21
25
|
persistAsyncConfig?: import("../../types").PersistAsyncConfig | undefined;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { Step as DFStep, Model, Schema, ValidationError } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { OnAction, UpdateComponent } from '../../types';
|
|
2
|
+
import type { LocalValue, OnAction, OnRefresh, UpdateComponent } from '../../types';
|
|
3
3
|
import type { GetErrorMessageFunctions, PersistAsyncConfig } from '../types';
|
|
4
4
|
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
|
|
5
|
-
import type { HttpClient } from '../../../
|
|
5
|
+
import type { HttpClient } from '../../../types';
|
|
6
6
|
export type MapperProps = {
|
|
7
|
+
stepLocalValue: LocalValue;
|
|
7
8
|
step: DFStep;
|
|
8
9
|
getErrorMessageFunctions: GetErrorMessageFunctions;
|
|
9
10
|
httpClient: HttpClient;
|
|
10
11
|
onAction: OnAction;
|
|
12
|
+
onRefresh: OnRefresh;
|
|
11
13
|
updateComponent: UpdateComponent;
|
|
12
14
|
trackEvent: AnalyticsEventDispatcher;
|
|
13
15
|
logEvent: LoggingEventDispatcher;
|
|
14
16
|
};
|
|
15
17
|
export type SchemaMapperProps = {
|
|
18
|
+
uid: string;
|
|
16
19
|
schema: Schema;
|
|
17
20
|
model: Model;
|
|
21
|
+
localValue: LocalValue;
|
|
18
22
|
required?: boolean;
|
|
19
23
|
validationErrors?: ValidationError;
|
|
20
24
|
persistAsyncConfig?: PersistAsyncConfig;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
2
|
+
export declare const getPersistAsyncInitialState: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => {
|
|
3
|
+
performPersistAsync: import("../../../features/persistAsync/getPerformPersistAsync").PerformPersistAsync | undefined;
|
|
4
|
+
persistedState: import("../../../types").PersistedState;
|
|
5
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
|
|
1
|
+
import type { SchemaMapperProps } from '../types';
|
|
2
|
+
export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps) => {
|
|
3
3
|
placeholder?: string | undefined;
|
|
4
4
|
help?: string | undefined;
|
|
5
5
|
uid: string;
|
|
@@ -13,8 +13,7 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
|
|
|
13
13
|
keywords: string[] | undefined;
|
|
14
14
|
required: boolean;
|
|
15
15
|
title: string | undefined;
|
|
16
|
-
|
|
17
|
-
summariser: (model: import("@wise/dynamic-flow-types/build/next").JsonElement) => {
|
|
16
|
+
summariser: (value: import("../../../types").LocalValue) => {
|
|
18
17
|
title?: undefined;
|
|
19
18
|
description?: undefined;
|
|
20
19
|
icon?: undefined;
|
|
@@ -8,6 +8,8 @@ export type ErrorMessageFunctions = {
|
|
|
8
8
|
minimumDate: (minDate: string) => string;
|
|
9
9
|
maxLength: (maxLength: number) => string;
|
|
10
10
|
minLength: (minLength: number) => string;
|
|
11
|
+
maxFiles: (maxFiles: number) => string;
|
|
12
|
+
minFiles: (minFiles: number) => string;
|
|
11
13
|
maxItems: (maxItems: number) => string;
|
|
12
14
|
minItems: (minItems: number) => string;
|
|
13
15
|
pattern: () => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Action, Icon, Image, Margin, Model } from '@wise/dynamic-flow-types/build/next';
|
|
1
|
+
import type { Action, Icon, Image, JsonElement, Margin, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { ConstComponent } from './components/ConstComponent';
|
|
3
3
|
import type { AlertComponent } from './components/AlertComponent';
|
|
4
4
|
import type { AllOfComponent } from './components/AllOfComponent';
|
|
@@ -28,41 +28,49 @@ import type { SelectInputComponent } from './components/SelectInputComponent';
|
|
|
28
28
|
import type { StatusListComponent } from './components/StatusListComponent';
|
|
29
29
|
import type { TextInputComponent } from './components/TextInputComponent';
|
|
30
30
|
import type { UploadInputComponent } from './components/UploadInputComponent';
|
|
31
|
-
|
|
32
|
-
export type
|
|
31
|
+
import type { MultiUploadInputComponent } from './components/MultiUploadInputComponent';
|
|
32
|
+
export type StepComponent = AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ConstComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | IntegerInputComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | ReviewComponent | SearchComponent | SelectInputComponent | StatusListComponent | TextInputComponent | UploadInputComponent;
|
|
33
|
+
export type LocalValue = LocalValuePrimitive | LocalValueObject | LocalValueArray;
|
|
34
|
+
export type LocalValuePrimitive = string | number | boolean | File | null;
|
|
35
|
+
export interface LocalValueObject extends Record<string, LocalValuePrimitive | LocalValueObject | LocalValueArray> {
|
|
36
|
+
}
|
|
37
|
+
export interface LocalValueArray extends Array<LocalValuePrimitive | LocalValueObject | LocalValueArray> {
|
|
38
|
+
}
|
|
39
|
+
export type BaseComponent = {
|
|
33
40
|
type: string;
|
|
34
41
|
uid: string;
|
|
35
42
|
analyticsId?: string;
|
|
36
43
|
getSubmittableValue: () => Promise<Model>;
|
|
37
|
-
getLocalValue: () => M | null;
|
|
38
44
|
getSummary: () => RepeatableSummary;
|
|
39
45
|
validate: () => boolean;
|
|
40
46
|
};
|
|
41
|
-
export type LayoutComponent = BaseComponent
|
|
47
|
+
export type LayoutComponent = BaseComponent & {
|
|
42
48
|
control?: string;
|
|
43
49
|
margin: Margin;
|
|
50
|
+
getLocalValue: () => LocalValue;
|
|
44
51
|
};
|
|
45
|
-
export type
|
|
46
|
-
id: string;
|
|
47
|
-
autoComplete: string;
|
|
52
|
+
export type ComponentWithTitle = BaseComponent & {
|
|
48
53
|
control?: string;
|
|
49
54
|
description?: string;
|
|
55
|
+
help?: string;
|
|
56
|
+
hidden: boolean;
|
|
57
|
+
title?: string;
|
|
58
|
+
};
|
|
59
|
+
export type InputComponent<V extends LocalValue> = ComponentWithTitle & {
|
|
60
|
+
id: string;
|
|
61
|
+
autoComplete: string;
|
|
50
62
|
disabled: boolean;
|
|
51
63
|
errors: string[];
|
|
52
|
-
help?: string;
|
|
53
64
|
placeholder?: string;
|
|
54
65
|
required: boolean;
|
|
55
|
-
|
|
56
|
-
value: M | null;
|
|
57
|
-
persistedState: PersistedState<M>;
|
|
58
|
-
hidden: boolean;
|
|
59
|
-
onChange: (value: M | null) => void;
|
|
66
|
+
value: V;
|
|
60
67
|
onBlur: () => void;
|
|
61
68
|
onFocus: () => void;
|
|
62
|
-
getLocalValue: () =>
|
|
69
|
+
getLocalValue: () => V;
|
|
63
70
|
};
|
|
64
71
|
export type UpdateComponent = (id: string, update: (component: StepComponent) => void) => void;
|
|
65
72
|
export type OnAction = (action: Action) => Promise<void>;
|
|
73
|
+
export type OnRefresh = (schemaId: string | undefined, url?: string) => Promise<void> | void;
|
|
66
74
|
export type Align = 'start' | 'center' | 'end';
|
|
67
75
|
export type Bias = 'none' | 'start' | 'end';
|
|
68
76
|
export type Context = 'positive' | 'negative' | 'warning' | 'neutral';
|
|
@@ -72,8 +80,9 @@ export type RepeatableSummary = {
|
|
|
72
80
|
icon?: Icon;
|
|
73
81
|
image?: Image;
|
|
74
82
|
};
|
|
75
|
-
export type PersistedState
|
|
83
|
+
export type PersistedState = {
|
|
84
|
+
id?: string;
|
|
76
85
|
abortController: AbortController;
|
|
77
|
-
lastSubmitted:
|
|
78
|
-
submission: Promise<
|
|
86
|
+
lastSubmitted: LocalValue;
|
|
87
|
+
submission: Promise<JsonElement | null>;
|
|
79
88
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Model, Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { AnalyticsEventDispatcher } from '../domain/features/events';
|
|
3
|
+
type Command = {
|
|
4
|
+
type: 'refresh-step';
|
|
5
|
+
step: Step;
|
|
6
|
+
etag: string | null;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'noop';
|
|
9
|
+
};
|
|
10
|
+
export declare const executeRefresh: (props: {
|
|
11
|
+
abortSignal: AbortSignal;
|
|
12
|
+
url: string;
|
|
13
|
+
model: Model;
|
|
14
|
+
schemaId: string | undefined;
|
|
15
|
+
etag: string | null;
|
|
16
|
+
httpClient: typeof fetch;
|
|
17
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
18
|
+
}) => Promise<Command>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Action, Model, Step, ErrorResponseBody } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { AnalyticsEventDispatcher } from '../domain/features/events';
|
|
3
|
+
type Command = {
|
|
4
|
+
type: 'complete';
|
|
5
|
+
result: Model;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'replace-step';
|
|
8
|
+
step: Step;
|
|
9
|
+
etag: string | null;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'errors';
|
|
12
|
+
errors: ErrorResponseBody;
|
|
13
|
+
};
|
|
14
|
+
export declare const executeSubmission: (props: {
|
|
15
|
+
action: Action;
|
|
16
|
+
model: Model;
|
|
17
|
+
httpClient: typeof fetch;
|
|
18
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
19
|
+
}) => Promise<Command>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const responseTypes: readonly ["step", "action", "exit"];
|
|
2
|
+
export type ResponseType = (typeof responseTypes)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Returns either 'step', 'action', or 'exit' based on the response headers and body.
|
|
5
|
+
* This function is async because, for legacy reasons, we still need to parse the response body as JSON
|
|
6
|
+
* to determine the response type, in cases where the response headers are not set.
|
|
7
|
+
* Ideally it should just be a matter of checking the "X-Df-Response-Type" response header.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getResponseType: (response: Response) => Promise<ResponseType>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ActionResponseBody, ErrorResponseBody, JsonElement, Step } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
export declare const assertResponseIsValid: (response: unknown) => void;
|
|
3
|
+
export declare const parseResponseBodyAsJsonElement: (response: Response) => Promise<JsonElement>;
|
|
4
|
+
export declare function assertActionResponseBody(body: unknown): asserts body is ActionResponseBody;
|
|
5
|
+
export declare function assertErrorResponseBody(body: unknown): asserts body is ErrorResponseBody;
|
|
6
|
+
export declare function assertStepResponseBody(body: unknown): asserts body is Step;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Renderer
|
|
3
|
-
export interface CoreContainerRendererProps
|
|
2
|
+
import type { Renderer } from './types';
|
|
3
|
+
export interface CoreContainerRendererProps {
|
|
4
4
|
type: 'container';
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import type { InstructionsComponent } from '../../domain/components/InstructionsComponent';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
control: string | undefined;
|
|
5
|
-
items: import("../../domain/components/InstructionsComponent").InstructionItem[];
|
|
6
|
-
margin: import("@wise/dynamic-flow-types/build/next").Size;
|
|
7
|
-
title: string | undefined;
|
|
8
|
-
};
|
|
2
|
+
import type { InstructionsRendererProps } from '../types';
|
|
3
|
+
export declare const instructionsComponentToProps: ({ control, items, margin, title, }: InstructionsComponent) => InstructionsRendererProps;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { MultiUploadInputComponent } from '../../domain/components/MultiUploadInputComponent';
|
|
2
|
+
import type { MultiUploadInputRendererProps } from '../types';
|
|
3
|
+
export declare const multiUploadInputComponentToProps: (component: MultiUploadInputComponent) => MultiUploadInputRendererProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { RepeatableRendererProps } from '../types';
|
|
3
3
|
import type { RepeatableComponent } from '../../domain/components/repeatableComponent/RepeatableComponent';
|
|
4
|
-
export declare const repeatableComponentToProps: (component: RepeatableComponent, editableItemChildren: ReactNode) => RepeatableRendererProps;
|
|
4
|
+
export declare const repeatableComponentToProps: (component: RepeatableComponent, children: ReactNode[], editableItemChildren: ReactNode) => RepeatableRendererProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InputComponent } from '../../../domain/types';
|
|
2
|
-
export declare const inputComponentToProps: <T extends string,
|
|
1
|
+
import type { InputComponent, LocalValue } from '../../../domain/types';
|
|
2
|
+
export declare const inputComponentToProps: <T extends string, V extends LocalValue>(component: InputComponent<V>, type: T) => {
|
|
3
3
|
type: T;
|
|
4
4
|
autoComplete: string;
|
|
5
5
|
control: string | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const inputComponentToProps: <T extends string, M extends import(
|
|
|
11
11
|
label: string | undefined;
|
|
12
12
|
placeholder: string | undefined;
|
|
13
13
|
required: boolean;
|
|
14
|
-
value:
|
|
14
|
+
value: V;
|
|
15
15
|
onBlur: () => void;
|
|
16
16
|
onFocus: () => void;
|
|
17
17
|
};
|