@wise/dynamic-flow-client 3.21.2 → 3.22.0

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.
Files changed (54) hide show
  1. package/build/main.css +14 -0
  2. package/build/main.js +656 -392
  3. package/build/main.min.js +1 -1
  4. package/build/main.mjs +520 -256
  5. package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -0
  6. package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
  7. package/build/types/legacy/test-utils/index.d.ts +1 -1
  8. package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -15
  9. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +3 -3
  10. package/build/types/revamp/domain/components/DateInputComponent.d.ts +3 -3
  11. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -3
  12. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -3
  13. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -0
  14. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -3
  15. package/build/types/revamp/domain/components/{repeatableComponent/RepeatableComponent.d.ts → RepeatableComponent.d.ts} +3 -3
  16. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -0
  17. package/build/types/revamp/domain/components/StatusListComponent.d.ts +19 -2
  18. package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -3
  19. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -0
  20. package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -2
  21. package/build/types/revamp/domain/features/validationAsync/getInitialValidationAsyncState.d.ts +2 -0
  22. package/build/types/revamp/domain/mappers/layout/statusListLayoutToComponent.d.ts +2 -1
  23. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
  24. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +1 -1
  25. package/build/types/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.d.ts +1 -1
  26. package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -1
  27. package/build/types/revamp/domain/types.d.ts +5 -4
  28. package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +1 -1
  29. package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -1
  30. package/build/types/revamp/utils/type-utils.d.ts +1 -1
  31. package/package.json +4 -6
  32. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +0 -1
  33. package/build/types/legacy/formControl/FormControl.spec.d.ts +0 -1
  34. package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +0 -1
  35. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +0 -1
  36. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +0 -1
  37. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +0 -1
  38. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +0 -1
  39. package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +0 -1
  40. package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +0 -1
  41. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +0 -1
  42. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +0 -1
  43. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +0 -1
  44. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +0 -1
  45. package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +0 -1
  46. package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +0 -1
  47. package/build/types/legacy/layout/DynamicLayout.spec.d.ts +0 -1
  48. package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +0 -1
  49. package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +0 -1
  50. package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +0 -1
  51. package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +0 -1
  52. package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +0 -1
  53. package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +0 -1
  54. package/build/types/revamp/domain/features/validationAsync/getInitialValidationState.d.ts +0 -2
@@ -4,5 +4,6 @@ declare function AllOfSchema(props: AllOfSchemaProps): import("react/jsx-runtime
4
4
  export type AllOfSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model'> & {
5
5
  schema: AllOfSchemaType;
6
6
  model: ObjectModel;
7
+ hideTitle?: boolean;
7
8
  };
8
9
  export default AllOfSchema;
@@ -3,5 +3,5 @@ type Props = {
3
3
  component: ListLayout | StatusListLayout;
4
4
  onAction: (action: Action) => void;
5
5
  };
6
- declare const DynamicStatusList: ({ component }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ declare const DynamicStatusList: ({ component, onAction }: Props) => import("react/jsx-runtime").JSX.Element;
7
7
  export default DynamicStatusList;
@@ -1,4 +1,4 @@
1
1
  export { default as DynamicFlowProviders } from './DynamicFlowProviders';
2
- export { mount, mountWithOptions, getMockFetchPromise, wait, getI18n, TestContextProviders, } from './legacy-utils';
2
+ export { wait, TestContextProviders } from './legacy-utils';
3
3
  export { default as mockUseLogger } from './log-utils';
4
4
  export { renderWithProviders } from '../../test-utils/rtl-utils';
@@ -1,18 +1,4 @@
1
- import { type ReactWrapper } from 'enzyme';
2
- import type { ReactNode } from 'react';
3
- import type { EventHandler, LogEventHandler } from '../dynamic-flow-types';
4
- import type { ProviderProps } from '@transferwise/components';
5
- declare const getMockFetchPromise: (status: number, jsonFn: () => void, delay: number, signal?: AbortSignal | null) => Promise<Response>;
6
1
  declare const wait: (t: number) => Promise<unknown>;
7
- declare function mountWithProviders(component: ReactNode, locale?: string, messages?: ProviderProps['i18n']['messages'], baseUrl?: string, onEvent?: EventHandler, onLog?: LogEventHandler): ReactWrapper;
8
- declare function mountWithOptions({ component, locale, messages, baseUrl, onEvent, onLog, }: {
9
- component: ReactNode;
10
- locale?: string;
11
- messages?: ProviderProps['i18n']['messages'];
12
- baseUrl?: string;
13
- onEvent?: EventHandler;
14
- onLog?: LogEventHandler;
15
- }): ReactWrapper;
16
2
  declare function getI18n(locale?: string, messages?: Record<string, string>): {
17
3
  locale: string;
18
4
  messages: Record<string, string>;
@@ -20,4 +6,4 @@ declare function getI18n(locale?: string, messages?: Record<string, string>): {
20
6
  declare function TestContextProviders({ children }: {
21
7
  children: React.ReactNode;
22
8
  }): import("react/jsx-runtime").JSX.Element;
23
- export { mountWithProviders as mount, mountWithOptions, getMockFetchPromise, wait, getI18n, TestContextProviders, };
9
+ export { getI18n, TestContextProviders, wait };
@@ -1,14 +1,14 @@
1
1
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
2
2
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
4
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
4
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
5
5
  export type BooleanInputComponent = InputComponent<boolean> & {
6
6
  type: 'boolean';
7
7
  persistedState: PersistedState;
8
- validationState: ValidationState;
8
+ validationAsyncState: ValidationAsyncState;
9
9
  onChange: (value: boolean) => void;
10
10
  };
11
- export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "uid" | "id" | "analyticsId" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "persistedState" | "required" | "title" | "value" | "validationState"> & {
11
+ export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "uid" | "id" | "analyticsId" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "persistedState" | "required" | "title" | "value" | "validationAsyncState"> & {
12
12
  performPersistAsync: PerformPersistAsync | undefined;
13
13
  performRefresh: PerformRefresh | undefined;
14
14
  performValidationAsync: PerformValidationAsync | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
3
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
4
4
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
5
5
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
6
6
  export type DateInputComponent = InputComponent<string | null> & {
@@ -8,10 +8,10 @@ export type DateInputComponent = InputComponent<string | null> & {
8
8
  minimumDate?: string;
9
9
  maximumDate?: string;
10
10
  persistedState: PersistedState;
11
- validationState: ValidationState;
11
+ validationAsyncState: ValidationAsyncState;
12
12
  onChange: (value: string | null) => void;
13
13
  };
14
- export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "minimumDate" | "maximumDate" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
14
+ export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "minimumDate" | "maximumDate" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
15
15
  checks: IsInvalidCheck<string | null>[];
16
16
  performPersistAsync: PerformPersistAsync | undefined;
17
17
  performRefresh: PerformRefresh | undefined;
@@ -1,4 +1,4 @@
1
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
1
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
3
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
4
4
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
@@ -8,10 +8,10 @@ export type IntegerInputComponent = InputComponent<number | null> & {
8
8
  maximum?: number;
9
9
  minimum?: number;
10
10
  persistedState: PersistedState;
11
- validationState: ValidationState;
11
+ validationAsyncState: ValidationAsyncState;
12
12
  onChange: (value: number | null) => void;
13
13
  };
14
- export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "minimum" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
14
+ export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "minimum" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
15
15
  checks: IsInvalidCheck<number | null>[];
16
16
  performPersistAsync: PerformPersistAsync | undefined;
17
17
  performRefresh: PerformRefresh | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
3
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
4
- import type { InputComponent, LocalValue, DomainComponent, UpdateComponent, LocalValueArray, OnValueChange, ValidationState } from '../types';
4
+ import type { InputComponent, LocalValue, DomainComponent, UpdateComponent, LocalValueArray, OnValueChange, ValidationAsyncState } from '../types';
5
5
  import type { SelectInputOption } from './SelectInputComponent';
6
6
  export type MultiSelectComponent = InputComponent<LocalValueArray | null> & {
7
7
  type: 'multi-select';
@@ -9,13 +9,13 @@ export type MultiSelectComponent = InputComponent<LocalValueArray | null> & {
9
9
  maxItems?: number;
10
10
  minItems?: number;
11
11
  options: SelectInputOption[];
12
- validationState: ValidationState;
12
+ validationAsyncState: ValidationAsyncState;
13
13
  selectedIndices: number[];
14
14
  getChildren: () => DomainComponent[];
15
15
  getSelectedChildren: () => DomainComponent[] | null;
16
16
  onSelect: (indices: number[]) => void;
17
17
  };
18
- export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "hidden" | "maxItems" | "minItems" | "required" | "title" | "validationState"> & {
18
+ export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "hidden" | "maxItems" | "minItems" | "required" | "title" | "validationAsyncState"> & {
19
19
  checks: IsInvalidCheck<LocalValueArray | null>[];
20
20
  initialValue: LocalValue;
21
21
  options: (SelectInputOption & {
@@ -10,6 +10,7 @@ export type MultiUploadInputComponent = InputComponent<File[]> & {
10
10
  maxSize?: number;
11
11
  minItems?: number;
12
12
  persistedState: PersistedState[];
13
+ validationAsyncState?: undefined;
13
14
  uploadLabel?: string;
14
15
  onDelete: (fileId: string) => Promise<void>;
15
16
  onUpload: (file: File, fileId: string) => Promise<void>;
@@ -2,16 +2,16 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
2
2
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
5
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
5
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
6
6
  export type NumberInputComponent = InputComponent<number | null> & {
7
7
  type: 'number';
8
8
  maximum?: number;
9
9
  minimum?: number;
10
10
  persistedState: PersistedState;
11
- validationState: ValidationState;
11
+ validationAsyncState: ValidationAsyncState;
12
12
  onChange: (value: number | null) => void;
13
13
  };
14
- export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "minimum" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
14
+ export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "help" | "hidden" | "maximum" | "minimum" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
15
15
  checks: IsInvalidCheck<number | null>[];
16
16
  performPersistAsync: PerformPersistAsync | undefined;
17
17
  performRefresh: PerformRefresh | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { SummarySummariser } from '@wise/dynamic-flow-types/build/next/feature/SummarySummariser';
2
- import type { ComponentWithTitle, LocalValue, LocalValueArray, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../../types';
3
- import type { IsInvalidCheck } from '../../features/validation/value-checks';
2
+ import type { ComponentWithTitle, LocalValue, LocalValueArray, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../types';
3
+ import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  export type RepeatableComponent = ComponentWithTitle & {
5
5
  type: 'repeatable';
6
6
  id?: string;
@@ -9,7 +9,7 @@ export type RepeatableComponent = ComponentWithTitle & {
9
9
  editableComponent: DomainComponent | null;
10
10
  editableIndex: number | null;
11
11
  editItemTitle: string;
12
- errors: string[];
12
+ errors: string[] | undefined;
13
13
  maxItems?: number;
14
14
  minItems?: number;
15
15
  summaryDefaults: RepeatableSummary;
@@ -8,6 +8,7 @@ export type SelectInputComponent = InputComponent<LocalValue | null> & {
8
8
  selectedIndex: number | null;
9
9
  options: SelectInputOption[];
10
10
  children: DomainComponent[];
11
+ validationAsyncState?: undefined;
11
12
  onSelect: (index: number | null) => void;
12
13
  getChildren: () => DomainComponent[];
13
14
  getSelectedChild: () => DomainComponent | null;
@@ -1,8 +1,25 @@
1
- import type { StatusListLayoutItem } from '@wise/dynamic-flow-types/build/next/layout/StatusListLayoutItem';
2
1
  import type { LayoutComponent } from '../types';
3
2
  export type StatusListComponent = LayoutComponent & {
4
3
  type: 'status-list';
5
- items: StatusListLayoutItem[];
4
+ items: StatusListItem[];
6
5
  title?: string;
7
6
  };
7
+ export type StatusListItem = {
8
+ title: string;
9
+ description?: string;
10
+ icon: {
11
+ name: string;
12
+ } | {
13
+ text: string;
14
+ };
15
+ href?: string;
16
+ status?: 'not-done' | 'pending' | 'done';
17
+ callToAction?: StatusListItemCallToAction;
18
+ };
19
+ export type StatusListItemCallToAction = {
20
+ accessibilityDescription?: string;
21
+ href?: string;
22
+ title: string;
23
+ onClick: () => void;
24
+ };
8
25
  export declare const createStatusListComponent: (statusListProps: Pick<StatusListComponent, "uid" | "control" | "items" | "margin" | "title">) => StatusListComponent;
@@ -2,17 +2,17 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
2
2
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
5
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
5
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
6
6
  export type TextInputComponent = InputComponent<string | null> & {
7
7
  type: 'text';
8
8
  displayFormat?: string;
9
9
  maxLength?: number;
10
10
  minLength?: number;
11
11
  persistedState: PersistedState;
12
- validationState: ValidationState;
12
+ validationAsyncState: ValidationAsyncState;
13
13
  onChange: (value: string | null) => void;
14
14
  };
15
- export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "maxLength" | "minLength" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationState"> & {
15
+ export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "maxLength" | "minLength" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
16
16
  checks: IsInvalidCheck<string | null>[];
17
17
  performPersistAsync: PerformPersistAsync | undefined;
18
18
  performValidationAsync: PerformValidationAsync | undefined;
@@ -8,6 +8,7 @@ export type UploadInputComponent = InputComponent<File | null> & {
8
8
  maxSize?: number;
9
9
  accepts?: string[];
10
10
  persistedState: PersistedState;
11
+ validationAsyncState?: undefined;
11
12
  onUpload: (value: File | null) => Promise<void>;
12
13
  };
13
14
  export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "uid" | "id" | "accepts" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "format" | "help" | "hidden" | "maxSize" | "persistedState" | "placeholder" | "required" | "title" | "value"> & {
@@ -6,10 +6,10 @@ import type { IntegerInputComponent } from '../../components/IntegerInputCompone
6
6
  import type { MultiSelectComponent } from '../../components/MultiSelectInputComponent';
7
7
  import type { NumberInputComponent } from '../../components/NumberInputComponent';
8
8
  import type { TextInputComponent } from '../../components/TextInputComponent';
9
- import type { LocalValue, ValidationState } from '../../types';
9
+ import type { LocalValue, ValidationAsyncState } from '../../types';
10
10
  type Validatable = BooleanInputComponent | DateInputComponent | IntegerInputComponent | MultiSelectComponent | NumberInputComponent | TextInputComponent;
11
11
  /**
12
12
  * Creates an onValidateAsync handler for a component.
13
13
  */
14
- export declare const getComponentValidationAsync: (update: ReturnType<typeof getInputUpdateFunction<Validatable>>, performValidationAsync: PerformValidationAsync) => (validationState: ValidationState, currentValue: LocalValue) => Promise<string | null | undefined>;
14
+ export declare const getComponentValidationAsync: (update: ReturnType<typeof getInputUpdateFunction<Validatable>>, performValidationAsync: PerformValidationAsync) => (validationAsyncState: ValidationAsyncState, currentValue: LocalValue) => Promise<string | null | undefined>;
15
15
  export {};
@@ -0,0 +1,2 @@
1
+ import type { ValidationAsyncState } from '../../types';
2
+ export declare const getInitialValidationAsyncState: () => ValidationAsyncState;
@@ -1,2 +1,3 @@
1
1
  import type { StatusListLayout } from '@wise/dynamic-flow-types/build/next';
2
- export declare const statusListLayoutToComponent: (uid: string, { control, items, margin, title }: StatusListLayout) => import("../../components/StatusListComponent").StatusListComponent;
2
+ import { MapperProps } from '../schema/types';
3
+ export declare const statusListLayoutToComponent: (uid: string, { control, items, margin, title }: StatusListLayout, { onAction, onLink }: MapperProps) => import("../../components/StatusListComponent").StatusListComponent;
@@ -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/MultiSelectInputComponent").MultiSelectComponent | import("../../../components/MultiUploadInputComponent").MultiUploadInputComponent | import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent | import("../../../components/TupleComponent").TupleComponent;
5
+ }, mapperProps: MapperProps) => import("../../../components/MultiSelectInputComponent").MultiSelectComponent | import("../../../components/MultiUploadInputComponent").MultiUploadInputComponent | import("../../../components/RepeatableComponent").RepeatableComponent | import("../../../components/TupleComponent").TupleComponent;
@@ -3,4 +3,4 @@ import type { MapperProps, SchemaMapperProps } from '../types';
3
3
  export declare const arraySchemaToRepeatableComponent: (schemaMapperProps: SchemaMapperProps & {
4
4
  schema: ArraySchemaList;
5
5
  model: Model[] | null;
6
- }, mapperProps: MapperProps) => import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent;
6
+ }, mapperProps: MapperProps) => import("../../../components/RepeatableComponent").RepeatableComponent;
@@ -1,5 +1,5 @@
1
1
  import type { MapperProps, SchemaMapperProps } from '../types';
2
2
  export declare const getValidationAsyncInitialState: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => {
3
3
  performValidationAsync: import("../../../features/validationAsync/getPerformValidationAsync").PerformValidationAsync | undefined;
4
- validationState: import("../../../types").ValidationState;
4
+ validationAsyncState: import("../../../types").ValidationAsyncState;
5
5
  };
@@ -8,7 +8,7 @@ export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps
8
8
  control: string | undefined;
9
9
  description: string | undefined;
10
10
  disabled: boolean;
11
- errors: string[];
11
+ errors: string[] | undefined;
12
12
  hidden: boolean;
13
13
  keywords: string[] | undefined;
14
14
  required: boolean;
@@ -23,15 +23,15 @@ import type { MultiUploadInputComponent } from './components/MultiUploadInputCom
23
23
  import type { NumberInputComponent } from './components/NumberInputComponent';
24
24
  import type { ObjectComponent } from './components/ObjectComponent';
25
25
  import type { ParagraphComponent } from './components/ParagraphComponent';
26
- import type { RepeatableComponent } from './components/repeatableComponent/RepeatableComponent';
26
+ import type { RepeatableComponent } from './components/RepeatableComponent';
27
27
  import type { ReviewComponent } from './components/ReviewComponent';
28
28
  import type { SearchComponent } from './components/searchComponent/SearchComponent';
29
29
  import type { SelectInputComponent } from './components/SelectInputComponent';
30
30
  import type { StatusListComponent } from './components/StatusListComponent';
31
31
  import type { StepDomainComponent } from './components/StepDomainComponent';
32
32
  import type { TextInputComponent } from './components/TextInputComponent';
33
- import type { UploadInputComponent } from './components/UploadInputComponent';
34
33
  import { TupleComponent } from './components/TupleComponent';
34
+ import type { UploadInputComponent } from './components/UploadInputComponent';
35
35
  export type DomainComponent = StepDomainComponent | AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ConstComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | IntegerInputComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | ReviewComponent | SearchComponent | SelectInputComponent | StatusListComponent | TextInputComponent | TupleComponent | UploadInputComponent;
36
36
  export type LocalValue = LocalValuePrimitive | LocalValueObject | LocalValueArray;
37
37
  export type LocalValuePrimitive = string | number | boolean | File | null;
@@ -66,9 +66,10 @@ export type InputComponent<V extends LocalValue> = ComponentWithTitle & {
66
66
  id: string;
67
67
  autoComplete: string;
68
68
  disabled: boolean;
69
- errors: string[];
69
+ errors: string[] | undefined;
70
70
  placeholder?: string;
71
71
  required: boolean;
72
+ validationAsyncState?: ValidationAsyncState;
72
73
  value: V;
73
74
  onBlur: () => void;
74
75
  onFocus: () => void;
@@ -96,7 +97,7 @@ export type PersistedState = {
96
97
  lastResponse: JsonElement | null;
97
98
  submission: Promise<JsonElement | null>;
98
99
  };
99
- export type ValidationState = {
100
+ export type ValidationAsyncState = {
100
101
  abortController: AbortController;
101
102
  lastSubmitted: LocalValue;
102
103
  messages: {
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { RepeatableRendererProps } from '@wise/dynamic-flow-renderers';
3
- import type { RepeatableComponent } from '../../domain/components/repeatableComponent/RepeatableComponent';
3
+ import type { RepeatableComponent } from '../../domain/components/RepeatableComponent';
4
4
  export declare const repeatableComponentToProps: (component: RepeatableComponent, children: ReactNode[], editableItemChildren: ReactNode) => RepeatableRendererProps;
@@ -1,3 +1,4 @@
1
+ import { ValidationResult } from '@wise/dynamic-flow-renderers';
1
2
  import type { InputComponent, LocalValue } from '../../../domain/types';
2
3
  export declare const inputComponentToProps: <T extends string, V extends LocalValue>(component: InputComponent<V>, type: T) => {
3
4
  type: T;
@@ -5,12 +6,13 @@ export declare const inputComponentToProps: <T extends string, V extends LocalVa
5
6
  control: string | undefined;
6
7
  description: string | undefined;
7
8
  disabled: boolean;
8
- error: string;
9
+ error: string | undefined;
9
10
  help: string | undefined;
10
11
  id: string;
11
12
  label: string | undefined;
12
13
  placeholder: string | undefined;
13
14
  required: boolean;
15
+ validationState: ValidationResult | undefined;
14
16
  value: V;
15
17
  onBlur: () => void;
16
18
  onFocus: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { AllOfSchema, ArraySchema, ArraySchemaList, ArraySchemaTuple, BlobSchema, BooleanSchema, ConstSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { PersistAsync } from '@wise/dynamic-flow-types/build/next/feature/PersistAsync';
3
3
  import type { ColumnsComponent } from '../domain/components/ColumnsComponent';
4
- import type { RepeatableComponent } from '../domain/components/repeatableComponent/RepeatableComponent';
4
+ import type { RepeatableComponent } from '../domain/components/RepeatableComponent';
5
5
  import type { DomainComponent, LocalValue, LocalValueArray, LocalValueObject } from '../domain/types';
6
6
  type SchemaWithPersistAsync = (ArraySchemaList | ArraySchemaTuple | BooleanSchema | IntegerSchema | NumberSchema | StringSchema) & {
7
7
  persistAsync: PersistAsync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.21.2",
3
+ "version": "3.22.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -33,7 +33,6 @@
33
33
  "@babel/preset-env": "7.25.7",
34
34
  "@babel/preset-react": "7.25.7",
35
35
  "@babel/preset-typescript": "7.25.7",
36
- "@cfaester/enzyme-adapter-react-18": "0.8.0",
37
36
  "@chromatic-com/storybook": "2.0.2",
38
37
  "@formatjs/cli": "^6.2.12",
39
38
  "@storybook/addon-a11y": "^8.3.5",
@@ -55,7 +54,7 @@
55
54
  "@transferwise/formatting": "^2.13.0",
56
55
  "@transferwise/icons": "3.13.1",
57
56
  "@transferwise/neptune-css": "14.18.0",
58
- "@types/enzyme": "^3.10.18",
57
+ "@types/node": "22.7.4",
59
58
  "@types/jest": "29.5.13",
60
59
  "@types/react": "18.3.11",
61
60
  "@types/react-dom": "18.3.0",
@@ -63,7 +62,6 @@
63
62
  "@wise/art": "2.15.0",
64
63
  "@wise/components-theming": "^1.6.0",
65
64
  "babel-jest": "29.7.0",
66
- "enzyme": "^3.11.0",
67
65
  "esbuild": "0.24.0",
68
66
  "jest": "29.7.0",
69
67
  "jest-environment-jsdom": "29.7.0",
@@ -103,7 +101,7 @@
103
101
  "nanoid": "5.0.7",
104
102
  "react-webcam": "^7.2.0",
105
103
  "screenfull": "^5.2.0",
106
- "@wise/dynamic-flow-types": "2.23.2"
104
+ "@wise/dynamic-flow-types": "2.24.0"
107
105
  },
108
106
  "scripts": {
109
107
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",
@@ -117,7 +115,7 @@
117
115
  "test": "npm-run-all test:once test:tz",
118
116
  "test:once": "jest --config jest.config.js --env=jsdom -w 2",
119
117
  "test:coverage": "jest --config jest.config.js --env=jsdom --coverage",
120
- "test:tz": "TZ=US/Pacific jest ./src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.jsx ./src/legacy/formControl/FormControl.spec.jsx",
118
+ "test:tz": "TZ=US/Pacific jest --config jest.config.js --env=jsdom -w 2",
121
119
  "test:watch": "pnpm test:once --watch",
122
120
  "types": "pnpm tsc",
123
121
  "types:watch": "pnpm tsc --watch",
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import type { ValidationState } from '../../types';
2
- export declare const getInitialValidationState: () => ValidationState;