@wise/dynamic-flow-client 2.9.1 → 2.9.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/main.js +38 -40
- package/build/main.min.js +1 -1
- package/build/types/common/makeHttpClient/makeHttpClient.d.ts +1 -0
- package/build/types/legacy/common/utils/schema-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.d.ts +3 -3
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchResults.d.ts +4 -4
- package/build/types/legacy/layout/search/useSearch.d.ts +1 -1
- package/build/types/revamp/DynamicFlowCore.d.ts +7 -0
- package/build/types/revamp/DynamicFlowWise.d.ts +3 -0
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ConstComponent.d.ts +9 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +6 -5
- package/build/types/revamp/domain/mappers/schema/constSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -0
- package/build/types/revamp/domain/types.d.ts +6 -6
- package/build/types/revamp/renderers/types.d.ts +1 -0
- package/build/types/revamp/step/Step.d.ts +5 -4
- package/build/types/revamp/utils/component-utils.d.ts +2 -1
- package/build/types/revamp/utils/type-utils.d.ts +3 -3
- package/build/types/revamp/wise/renderers/UploadInputRenderer.d.ts +2 -1
- package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +2 -0
- package/build/types/test-utils/fetch-utils.d.ts +1 -0
- package/package.json +2 -2
- package/build/types/revamp/DynamicFlowRevamp.d.ts +0 -3
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +0 -9
- package/build/types/revamp/domain/mappers/schema/hiddenSchemaToComponent.d.ts +0 -7
- /package/build/types/common/errorBoundary/{ErrorBoundary.messages.d.ts → error-boundary.messages.d.ts} +0 -0
|
@@ -22,4 +22,4 @@ export declare function isFileUploadSchema(schema: {
|
|
|
22
22
|
format?: string;
|
|
23
23
|
}): schema is FileUploadSchema;
|
|
24
24
|
export declare const isMultipleFileUploadSchema: (schema: Schema) => schema is MultipleFileUploadSchema;
|
|
25
|
-
export declare const getSchemaType: (schema: Schema) => "
|
|
25
|
+
export declare const getSchemaType: (schema: Schema) => "allOf" | "persistAsync" | "array" | "object" | "oneOf" | "readOnly" | "validationAsync" | "promotedOneOf" | "basic" | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Icon, Image, Model } from '@wise/dynamic-flow-types';
|
|
1
|
+
import type { Icon, Image, Model } from '@wise/dynamic-flow-types';
|
|
2
2
|
export type ItemSummary = {
|
|
3
3
|
value: Model | null;
|
|
4
4
|
title?: string;
|
|
@@ -6,7 +6,7 @@ export type ItemSummary = {
|
|
|
6
6
|
icon?: Icon;
|
|
7
7
|
image?: Image;
|
|
8
8
|
};
|
|
9
|
-
export declare
|
|
9
|
+
export declare function ItemSummaryOption({ item, onClick }: {
|
|
10
10
|
item: ItemSummary;
|
|
11
11
|
onClick: () => void;
|
|
12
|
-
})
|
|
12
|
+
}): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ArraySchema, Model, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { ItemSummary } from '../ItemSummary';
|
|
3
|
-
export declare const getItemSummaryFromSchema: (schema: Schema, model: Model | null, defaults?: ArraySchema['summary']) => ItemSummary;
|
|
3
|
+
export declare const getItemSummaryFromSchema: (schema: Schema, model: Model | null, defaults?: ArraySchema['summary'], summaryTextOverride?: string) => ItemSummary;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SearchResult } from '@wise/dynamic-flow-types';
|
|
1
|
+
import type { SearchResult } from '@wise/dynamic-flow-types';
|
|
2
2
|
export type SearchResultsProps = {
|
|
3
3
|
results: SearchResult[];
|
|
4
4
|
emptyMessage: string;
|
|
5
5
|
onSelect: (result: SearchResult) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
7
|
+
export declare function SearchResults({ results, emptyMessage, onSelect }: SearchResultsProps): JSX.Element;
|
|
8
|
+
export declare function ErrorResult({ onRetrySearch }: {
|
|
9
9
|
onRetrySearch: () => void;
|
|
10
|
-
})
|
|
10
|
+
}): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SearchConfig, SearchResult } from '@wise/dynamic-flow-types';
|
|
2
2
|
export declare const useSearch: (defaultSearchConfig: SearchConfig) => {
|
|
3
|
-
status: "
|
|
3
|
+
status: "success" | "loading" | "error" | "idle";
|
|
4
4
|
results: SearchResult[];
|
|
5
5
|
search: (query: string, { url, method, param }?: SearchConfig) => Promise<void>;
|
|
6
6
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DynamicFlowProps } from './dynamic-flow-types';
|
|
2
|
+
import type { Renderer, RendererProps } from './renderers/types';
|
|
3
|
+
type DynamicFlowCoreProps = DynamicFlowProps & {
|
|
4
|
+
renderers: Renderer<RendererProps>[];
|
|
5
|
+
};
|
|
6
|
+
export declare function DynamicFlowCore(props: DynamicFlowCoreProps): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -6,10 +6,11 @@ export type AllOfComponent = BaseComponent<Model> & {
|
|
|
6
6
|
control?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
help?: string;
|
|
9
|
+
hidden: boolean;
|
|
9
10
|
title?: string;
|
|
10
11
|
getChildren: () => StepComponent[];
|
|
11
12
|
};
|
|
12
|
-
export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "
|
|
13
|
+
export declare const createAllOfComponent: (allOfProps: Pick<AllOfComponent, "description" | "help" | "hidden" | "title" | "control" | "components"> & {
|
|
13
14
|
uid: string;
|
|
14
15
|
analyticsId?: string | undefined;
|
|
15
16
|
summariser: (value: Model | null) => RepeatableSummary;
|
|
@@ -4,7 +4,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
|
|
|
4
4
|
export type BooleanInputComponent = InputComponent<boolean> & {
|
|
5
5
|
type: 'boolean';
|
|
6
6
|
};
|
|
7
|
-
export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "
|
|
7
|
+
export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "control" | "id" | "errors" | "required" | "value" | "uid"> & {
|
|
8
8
|
checks: IsInvalidCheck<boolean | null>[];
|
|
9
9
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
10
10
|
summariser: (value: boolean | null) => RepeatableSummary;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { BaseComponent, RepeatableSummary } from '../types';
|
|
3
|
+
export type ConstComponent = BaseComponent<Model> & {
|
|
4
|
+
type: 'const';
|
|
5
|
+
};
|
|
6
|
+
export declare const createConstComponent: (hiddenProps: Pick<ConstComponent, "analyticsId" | "uid"> & {
|
|
7
|
+
value: Model;
|
|
8
|
+
summary: RepeatableSummary;
|
|
9
|
+
}) => ConstComponent;
|
|
@@ -6,7 +6,7 @@ export type DateInputComponent = InputComponent<string> & {
|
|
|
6
6
|
minimumDate?: string;
|
|
7
7
|
maximumDate?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "
|
|
9
|
+
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "minimumDate" | "maximumDate" | "uid"> & {
|
|
10
10
|
checks: IsInvalidCheck<string | null>[];
|
|
11
11
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
12
12
|
summariser: (value: string | null) => RepeatableSummary;
|
|
@@ -4,7 +4,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
|
|
|
4
4
|
export type IntegerInputComponent = InputComponent<number> & {
|
|
5
5
|
type: 'integer';
|
|
6
6
|
};
|
|
7
|
-
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "
|
|
7
|
+
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
8
8
|
checks: IsInvalidCheck<number | null>[];
|
|
9
9
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
10
10
|
summariser: (value: number | null) => RepeatableSummary;
|
|
@@ -4,7 +4,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
|
|
|
4
4
|
export type NumberInputComponent = InputComponent<number> & {
|
|
5
5
|
type: 'number';
|
|
6
6
|
};
|
|
7
|
-
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "
|
|
7
|
+
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
8
8
|
checks: IsInvalidCheck<number | null>[];
|
|
9
9
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
10
10
|
summariser: (value: number | null) => RepeatableSummary;
|
|
@@ -6,10 +6,11 @@ export type ObjectComponent = BaseComponent<Record<string, Model>> & {
|
|
|
6
6
|
control?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
help?: string;
|
|
9
|
+
hidden: boolean;
|
|
9
10
|
title?: string;
|
|
10
11
|
getChildren: () => StepComponent[];
|
|
11
12
|
};
|
|
12
|
-
export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "
|
|
13
|
+
export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "description" | "help" | "hidden" | "title" | "control" | "componentMap"> & {
|
|
13
14
|
uid: string;
|
|
14
15
|
analyticsId?: string | undefined;
|
|
15
16
|
displayOrder: string[];
|
|
@@ -20,7 +20,7 @@ export type SelectInputOption = {
|
|
|
20
20
|
keywords?: string[];
|
|
21
21
|
disabled: boolean;
|
|
22
22
|
};
|
|
23
|
-
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "
|
|
23
|
+
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "autoComplete" | "uid"> & {
|
|
24
24
|
initialValue: Model;
|
|
25
25
|
options: (SelectInputOption & {
|
|
26
26
|
component: StepComponent;
|
|
@@ -5,7 +5,7 @@ export type TextInputComponent = InputComponent<string> & {
|
|
|
5
5
|
type: 'text';
|
|
6
6
|
displayFormat?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "
|
|
8
|
+
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "displayFormat" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
9
9
|
checks: IsInvalidCheck<string | null>[];
|
|
10
10
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
11
11
|
summariser: (value: string | null) => RepeatableSummary;
|
|
@@ -3,9 +3,10 @@ import type { InputComponent, RepeatableSummary, UpdateComponent } from '../type
|
|
|
3
3
|
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
4
4
|
export type UploadInputComponent = InputComponent<string> & {
|
|
5
5
|
type: 'upload';
|
|
6
|
+
maxSize?: number;
|
|
6
7
|
accepts?: string[];
|
|
7
8
|
};
|
|
8
|
-
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "
|
|
9
|
+
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "analyticsId" | "description" | "disabled" | "help" | "hidden" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "accepts" | "maxSize" | "autoComplete" | "uid"> & {
|
|
9
10
|
checks: IsInvalidCheck<string | null>[];
|
|
10
11
|
performPersistAsync: PerformPersistAsync | undefined;
|
|
11
12
|
summariser: (value: string | null) => RepeatableSummary;
|
|
@@ -22,7 +22,7 @@ export type RepeatableComponent = BaseComponent<Model[]> & {
|
|
|
22
22
|
onRemove: () => void;
|
|
23
23
|
onSave: () => boolean;
|
|
24
24
|
};
|
|
25
|
-
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "
|
|
25
|
+
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "description" | "title" | "control" | "id" | "errors" | "components" | "addItemTitle" | "editItemTitle" | "uid"> & {
|
|
26
26
|
analyticsId?: string | undefined;
|
|
27
27
|
checks: IsInvalidCheck<Model[] | null>[];
|
|
28
28
|
summary?: SummarySummariser | undefined;
|
|
@@ -11,5 +11,5 @@ type Persistable = BooleanInputComponent | DateInputComponent | IntegerInputComp
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates an onPersistAsync handler for a component.
|
|
13
13
|
*/
|
|
14
|
-
export declare const getComponentPersistAsync: <C extends Persistable>(update: (updateFn: (component: C) => void) => void, performPersistAsync: PerformPersistAsync) => (component: C) =>
|
|
14
|
+
export declare const getComponentPersistAsync: <C extends Persistable>(update: (updateFn: (component: C) => void) => void, performPersistAsync: PerformPersistAsync) => (component: C) => Promise<import("@wise/dynamic-flow-types/build/next").JsonElement>;
|
|
15
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonElement, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { PersistAsyncConfig } from '../../mappers/types';
|
|
3
3
|
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
4
|
-
import type { AnalyticsEventDispatcher } from '../events';
|
|
4
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../events';
|
|
5
5
|
export type PerformPersistAsync = (props: PersistAsyncProps) => Promise<JsonElement>;
|
|
6
6
|
type PersistAsyncModel = Model | Blob;
|
|
7
7
|
type PersistAsyncProps = {
|
|
@@ -12,11 +12,12 @@ type PersistAsyncProps = {
|
|
|
12
12
|
* Takes an httpClient and schema persist async config and returns a function that can
|
|
13
13
|
* execute a persist async request.
|
|
14
14
|
*/
|
|
15
|
-
export declare const getPerformPersistAsync: ({
|
|
16
|
-
|
|
15
|
+
export declare const getPerformPersistAsync: ({ genericErrorMessage, httpClient, persistAsyncConfig, schemaId, logEvent, trackEvent, }: {
|
|
16
|
+
genericErrorMessage: string;
|
|
17
17
|
httpClient: HttpClient;
|
|
18
|
-
trackEvent: AnalyticsEventDispatcher;
|
|
19
18
|
persistAsyncConfig: PersistAsyncConfig;
|
|
20
|
-
|
|
19
|
+
schemaId?: string | undefined;
|
|
20
|
+
logEvent: LoggingEventDispatcher;
|
|
21
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
21
22
|
}) => PerformPersistAsync;
|
|
22
23
|
export {};
|
|
@@ -2,4 +2,4 @@ import type { SchemaMapperProps } from './types';
|
|
|
2
2
|
import type { ConstSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
3
|
export declare const constSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: ConstSchema;
|
|
5
|
-
}) => import("../../components/
|
|
5
|
+
}) => import("../../components/ConstComponent").ConstComponent;
|
|
@@ -9,6 +9,7 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
|
|
|
9
9
|
description: string | undefined;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
errors: string[];
|
|
12
|
+
hidden: boolean;
|
|
12
13
|
keywords: string[] | undefined;
|
|
13
14
|
required: boolean;
|
|
14
15
|
title: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Action, Icon, Image, Margin, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ConstComponent } from './components/ConstComponent';
|
|
3
3
|
import type { AlertComponent } from './components/AlertComponent';
|
|
4
4
|
import type { AllOfComponent } from './components/AllOfComponent';
|
|
5
5
|
import type { BooleanInputComponent } from './components/BooleanInputComponent';
|
|
@@ -28,12 +28,12 @@ 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
|
-
export type StepComponent = AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent |
|
|
31
|
+
export type StepComponent = AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ConstComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | IntegerInputComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | ReviewComponent | SearchComponent | SelectInputComponent | StatusListComponent | TextInputComponent | UploadInputComponent;
|
|
32
32
|
export type BaseComponent<M extends Model> = {
|
|
33
33
|
type: string;
|
|
34
34
|
uid: string;
|
|
35
35
|
analyticsId?: string;
|
|
36
|
-
getSubmittableValue: () =>
|
|
36
|
+
getSubmittableValue: () => Promise<Model>;
|
|
37
37
|
getLocalValue: () => M | null;
|
|
38
38
|
getSummary: () => RepeatableSummary;
|
|
39
39
|
validate: () => boolean;
|
|
@@ -55,13 +55,14 @@ export type InputComponent<M extends Model> = BaseComponent<M> & {
|
|
|
55
55
|
title?: string;
|
|
56
56
|
value: M | null;
|
|
57
57
|
persistedState: PersistedState<M>;
|
|
58
|
+
hidden: boolean;
|
|
58
59
|
onChange: (value: M | null) => void;
|
|
59
60
|
onBlur: () => void;
|
|
60
61
|
onFocus: () => void;
|
|
61
62
|
getLocalValue: () => M | null;
|
|
62
63
|
};
|
|
63
64
|
export type UpdateComponent = (id: string, update: (component: StepComponent) => void) => void;
|
|
64
|
-
export type OnAction = (action: Action) => void
|
|
65
|
+
export type OnAction = (action: Action) => Promise<void>;
|
|
65
66
|
export type Align = 'start' | 'center' | 'end';
|
|
66
67
|
export type Bias = 'none' | 'start' | 'end';
|
|
67
68
|
export type Context = 'positive' | 'negative' | 'warning' | 'neutral';
|
|
@@ -74,6 +75,5 @@ export type RepeatableSummary = {
|
|
|
74
75
|
export type PersistedState<M extends Model> = {
|
|
75
76
|
abortController: AbortController;
|
|
76
77
|
lastSubmitted: M | null;
|
|
77
|
-
submission: Promise<
|
|
78
|
-
value: M | null;
|
|
78
|
+
submission: Promise<Model>;
|
|
79
79
|
};
|
|
@@ -261,6 +261,7 @@ export interface TextInputRendererProps extends BaseInputRendererProps<string> {
|
|
|
261
261
|
}
|
|
262
262
|
export interface UploadInputRendererProps extends BaseInputRendererProps<string> {
|
|
263
263
|
type: 'input-upload';
|
|
264
|
+
maxSize?: number;
|
|
264
265
|
accepts?: string[];
|
|
265
266
|
}
|
|
266
267
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { Step as DFStep } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type {
|
|
1
|
+
import type { Action, Step as DFStep, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { StepComponent } from '../domain/types';
|
|
3
3
|
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../domain/features/events';
|
|
4
4
|
import type { HttpClient } from '../dynamic-flow-types';
|
|
5
5
|
type StepProps = {
|
|
6
6
|
step: DFStep;
|
|
7
|
-
|
|
7
|
+
render: (component: StepComponent) => JSX.Element;
|
|
8
8
|
httpClient: HttpClient;
|
|
9
9
|
trackEvent: AnalyticsEventDispatcher;
|
|
10
10
|
logEvent: LoggingEventDispatcher;
|
|
11
|
+
onStepAction: (type: 'submit' | 'refresh', action: Action, model: Model) => Promise<void>;
|
|
11
12
|
};
|
|
12
|
-
declare function Step({ step,
|
|
13
|
+
declare function Step({ step, render, httpClient, trackEvent, logEvent, onStepAction }: StepProps): JSX.Element;
|
|
13
14
|
export default Step;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { StepComponent } from '../domain/types';
|
|
3
|
-
export declare const getSubmittableData: (components: StepComponent[]) => Model
|
|
3
|
+
export declare const getSubmittableData: (components: StepComponent[]) => Promise<Model>;
|
|
4
4
|
export declare const getLocalValues: (components: StepComponent[]) => Model;
|
|
5
|
+
export declare const mergeModels: (valueA: Model, valueB: Model) => Model;
|
|
@@ -10,6 +10,9 @@ export declare const hasChildren: (component: StepComponent) => component is Ste
|
|
|
10
10
|
getChildren: () => StepComponent[];
|
|
11
11
|
};
|
|
12
12
|
export declare const isColumnsComponent: (component: StepComponent) => component is ColumnsComponent;
|
|
13
|
+
export declare const isHiddenComponent: (component: StepComponent) => component is StepComponent & {
|
|
14
|
+
hidden: true;
|
|
15
|
+
};
|
|
13
16
|
export declare const isRepeatableComponent: (component: StepComponent) => component is RepeatableComponent;
|
|
14
17
|
export declare const isObjectModel: (model: Model) => model is Record<string, import("@wise/dynamic-flow-types/build/next").JsonElement>;
|
|
15
18
|
export declare const isArrayModel: (model: Model) => model is import("@wise/dynamic-flow-types/build/next").JsonElement[];
|
|
@@ -24,7 +27,4 @@ export declare const isArraySchema: (schema: Schema) => schema is ArraySchema;
|
|
|
24
27
|
export declare const isArrayListSchema: (schema: Schema) => schema is ArraySchemaList;
|
|
25
28
|
export declare const isStringSchema: (schema: Schema) => schema is StringSchema;
|
|
26
29
|
export declare const isSchemaWithPersistAsync: (schema: Schema) => schema is SchemaWithPersistAsync;
|
|
27
|
-
export declare const isHiddenSchema: (schema: Schema) => schema is Schema & {
|
|
28
|
-
hidden: true;
|
|
29
|
-
};
|
|
30
30
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Renderer, UploadInputRendererProps } from '../../renderers/types';
|
|
2
2
|
declare const UploadInputRenderer: Renderer<UploadInputRendererProps>;
|
|
3
|
-
|
|
3
|
+
declare const LargeUploadRenderer: Renderer<UploadInputRendererProps>;
|
|
4
|
+
export { UploadInputRenderer, LargeUploadRenderer };
|
|
@@ -12,6 +12,7 @@ type HttpClient = typeof fetch;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const getMockHttpClient: (handlers: Record<string, HttpClient | undefined>) => HttpClient;
|
|
14
14
|
export declare const respondWith: (data: unknown, init?: ResponseInit) => Promise<Response>;
|
|
15
|
+
export declare const respondWithDelay: (data: unknown, delayMs: number, init?: ResponseInit) => Promise<Response>;
|
|
15
16
|
export declare const respondWithEtag: (step: Step) => Promise<Response>;
|
|
16
17
|
export declare const respondWithEmptyOk: () => Promise<Response>;
|
|
17
18
|
export declare const respondWithEmptyAndEtag: (step: Step) => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.3",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"classnames": "2.5.1",
|
|
93
93
|
"react-webcam": "^7.2.0",
|
|
94
94
|
"screenfull": "^5.2.0",
|
|
95
|
-
"@wise/dynamic-flow-types": "2.6.
|
|
95
|
+
"@wise/dynamic-flow-types": "2.6.5"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"dev": "storybook dev -p 3003",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { BaseComponent, RepeatableSummary } from '../types';
|
|
3
|
-
export type HiddenComponent = BaseComponent<Model> & {
|
|
4
|
-
type: 'hidden';
|
|
5
|
-
};
|
|
6
|
-
export declare const createHiddenComponent: (hiddenProps: Pick<HiddenComponent, "analyticsId" | "uid"> & {
|
|
7
|
-
value: Model;
|
|
8
|
-
summary: RepeatableSummary;
|
|
9
|
-
}) => HiddenComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import { SchemaMapperProps } from './types';
|
|
3
|
-
export declare const hiddenSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
|
-
schema: Schema & {
|
|
5
|
-
hidden: true;
|
|
6
|
-
};
|
|
7
|
-
}) => import("../../components/HiddenComponent").HiddenComponent;
|
|
File without changes
|