@wise/dynamic-flow-client 2.8.9 → 2.8.11
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 +118 -132
- package/build/main.min.js +1 -1
- package/build/types/common/messages/validation.array.messages.d.ts +13 -0
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.d.ts +3 -3
- package/build/types/legacy/layout/button/DynamicButton.d.ts +3 -3
- package/build/types/legacy/layout/icon/DynamicIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/FlagIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/NamedIcon.d.ts +1 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +9 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +4 -6
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +8 -9
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +30 -0
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +31 -0
- package/build/types/revamp/domain/components/searchComponent/SearchComponent.d.ts +25 -0
- package/build/types/revamp/domain/components/utils/debounce.d.ts +6 -0
- package/build/types/revamp/domain/components/utils/isModelPartialOf.d.ts +2 -0
- package/build/types/revamp/domain/{events → features/events}/getAnalyticsEventDispatcher.d.ts +1 -1
- package/build/types/revamp/domain/features/search/getPerformSearchFunction.d.ts +3 -0
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +32 -0
- package/build/types/revamp/domain/{validation → features/validation}/spec-utils.d.ts +2 -0
- package/build/types/revamp/domain/{validation → features/validation}/validateComponents.d.ts +1 -1
- package/build/types/revamp/domain/{validation → features/validation}/value-checks.d.ts +4 -2
- 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/formLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/searchLayoutToComponent.d.ts +3 -0
- package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/mapSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +6 -0
- package/build/types/revamp/domain/mappers/schema/booleanSchemaToComponent.d.ts +5 -0
- 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/objectSchemaToComponent/objectSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +4 -2
- package/build/types/revamp/domain/mappers/schema/types.d.ts +3 -1
- package/build/types/revamp/domain/mappers/types.d.ts +2 -0
- package/build/types/revamp/domain/mappers/utils/getRandomId.d.ts +1 -0
- package/build/types/revamp/domain/types.d.ts +20 -8
- package/build/types/revamp/domain/validation/validation-functions.d.ts +8 -0
- package/build/types/revamp/dynamic-flow-types.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/booleanInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +4 -3
- package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/mappers/searchComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/selectInputComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +19 -0
- package/build/types/revamp/renderers/types.d.ts +109 -30
- package/build/types/revamp/step/Step.d.ts +4 -2
- package/build/types/revamp/stories/utils/mockSearchHandler.d.ts +1 -0
- package/build/types/revamp/stories/visual-tests/array.d.ts +3 -0
- package/build/types/revamp/test-utils/component-utils.d.ts +2 -0
- package/build/types/revamp/utils/type-utils.d.ts +11 -5
- package/build/types/revamp/wise/renderers/BooleanInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/RepeatableRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SearchRenderer.d.ts +14 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/OptionMedia.d.ts +5 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.d.ts +5 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +2 -1
- package/build/types/revamp/wise/renderers/components/icon/DynamicIcon.d.ts +6 -0
- package/build/types/revamp/wise/renderers/components/icon/FlagIcon.d.ts +6 -0
- package/build/types/revamp/wise/renderers/components/icon/NamedIcon.d.ts +6 -0
- package/build/types/revamp/wise/renderers/components/icon/NavigationOptionMedia.d.ts +5 -0
- package/build/types/test-utils/fetch-utils.d.ts +19 -0
- package/package.json +7 -6
- /package/build/types/{legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.messages.d.ts → common/messages/repeatable.messages.d.ts} +0 -0
- /package/build/types/revamp/domain/{events → features/events}/getLogggingEventDispatcher.d.ts +0 -0
- /package/build/types/revamp/domain/{events → features/events}/index.d.ts +0 -0
- /package/build/types/revamp/domain/{validation → features/validation}/getModelValidationErrors.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ArrayModel, ListArraySchema } from '@wise/dynamic-flow-types';
|
|
2
|
-
import { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
|
|
1
|
+
import type { ArrayModel, ListArraySchema } from '@wise/dynamic-flow-types';
|
|
2
|
+
import type { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
|
|
3
3
|
type RepeatableSchemaProps = Omit<GenericSchemaProps, 'model' | 'onPersistAsync'> & {
|
|
4
4
|
schema: ListArraySchema;
|
|
5
5
|
model: ArrayModel | null;
|
|
6
6
|
};
|
|
7
|
-
declare
|
|
7
|
+
declare function RepeatableSchema({ schema, model, errors, submitted, onChange }: RepeatableSchemaProps): JSX.Element;
|
|
8
8
|
export default RepeatableSchema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ButtonLayout } from '@wise/dynamic-flow-types';
|
|
2
|
-
import { CommonLayoutProps } from '../DynamicLayout';
|
|
1
|
+
import type { ButtonLayout } from '@wise/dynamic-flow-types';
|
|
2
|
+
import type { CommonLayoutProps } from '../DynamicLayout';
|
|
3
3
|
type Props = Omit<CommonLayoutProps, 'submitted' | 'onModelChange' | 'onPersistAsync'> & {
|
|
4
4
|
component: ButtonLayout;
|
|
5
5
|
};
|
|
6
|
-
declare
|
|
6
|
+
declare function DynamicButton(props: Props): JSX.Element;
|
|
7
7
|
export default DynamicButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Props = {
|
|
2
2
|
type: string;
|
|
3
3
|
};
|
|
4
|
-
declare
|
|
4
|
+
declare function DynamicIcon({ type }: Props): JSX.Element | null;
|
|
5
5
|
export declare function isValidIconName(name: string): boolean;
|
|
6
6
|
export default DynamicIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
+
export type BooleanInputComponent = InputComponent<boolean> & {
|
|
4
|
+
type: 'boolean';
|
|
5
|
+
};
|
|
6
|
+
export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "control" | "id" | "errors" | "required" | "value" | "uid"> & {
|
|
7
|
+
checks: IsInvalidCheck<boolean | null>[];
|
|
8
|
+
summariser: (value: boolean | null) => RepeatableSummary;
|
|
9
|
+
}, updateComponent: UpdateComponent) => BooleanInputComponent;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
3
|
export type DateInputComponent = InputComponent<string> & {
|
|
4
4
|
type: 'date';
|
|
5
5
|
minimumDate?: string;
|
|
6
6
|
maximumDate?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "minimumDate" | "maximumDate" | "uid"> & {
|
|
8
|
+
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "analyticsId" | "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "minimumDate" | "maximumDate" | "uid"> & {
|
|
9
9
|
checks: IsInvalidCheck<string | null>[];
|
|
10
|
+
summariser: (value: string | null) => RepeatableSummary;
|
|
10
11
|
}, updateComponent: UpdateComponent) => DateInputComponent;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { BaseComponent } from '../types';
|
|
2
|
+
import type { BaseComponent, RepeatableSummary } from '../types';
|
|
3
3
|
export type HiddenComponent = BaseComponent<Model> & {
|
|
4
4
|
type: 'hidden';
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
uid: string;
|
|
6
|
+
export declare const createHiddenComponent: (hiddenProps: Pick<HiddenComponent, "analyticsId" | "uid"> & {
|
|
8
7
|
value: Model;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {};
|
|
8
|
+
summary: RepeatableSummary;
|
|
9
|
+
}) => HiddenComponent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
|
-
import type { IsInvalidCheck } from '../validation/value-checks';
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
export type IntegerInputComponent = InputComponent<number> & {
|
|
4
4
|
type: 'integer';
|
|
5
5
|
};
|
|
6
|
-
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
6
|
+
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
7
|
checks: IsInvalidCheck<number | null>[];
|
|
8
|
+
summariser: (value: number | null) => RepeatableSummary;
|
|
8
9
|
}, updateComponent: UpdateComponent) => IntegerInputComponent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
|
-
import type { IsInvalidCheck } from '../validation/value-checks';
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
export type NumberInputComponent = InputComponent<number> & {
|
|
4
4
|
type: 'number';
|
|
5
5
|
};
|
|
6
|
-
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
6
|
+
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
7
|
checks: IsInvalidCheck<number | null>[];
|
|
8
|
+
summariser: (value: number | null) => RepeatableSummary;
|
|
8
9
|
}, updateComponent: UpdateComponent) => NumberInputComponent;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { BaseComponent, StepComponent } from '../types';
|
|
3
|
-
export type ObjectComponent =
|
|
2
|
+
import type { BaseComponent, RepeatableSummary, StepComponent } from '../types';
|
|
3
|
+
export type ObjectComponent = BaseComponent<Record<string, Model>> & {
|
|
4
4
|
type: 'object';
|
|
5
|
-
title?: string;
|
|
6
|
-
description?: string;
|
|
7
5
|
componentMap: Record<string, StepComponent>;
|
|
6
|
+
control?: string;
|
|
7
|
+
description?: string;
|
|
8
8
|
help?: string;
|
|
9
|
+
title?: string;
|
|
9
10
|
getChildren: () => StepComponent[];
|
|
10
11
|
getValue: () => Record<string, Model>;
|
|
11
12
|
};
|
|
12
|
-
export declare const createObjectComponent: (objectProps: {
|
|
13
|
+
export declare const createObjectComponent: (objectProps: Pick<ObjectComponent, "description" | "help" | "title" | "control" | "componentMap"> & {
|
|
13
14
|
uid: string;
|
|
14
|
-
|
|
15
|
-
description?: string | undefined;
|
|
15
|
+
analyticsId?: string | undefined;
|
|
16
16
|
displayOrder: string[];
|
|
17
|
-
|
|
18
|
-
help?: string | undefined;
|
|
17
|
+
summariser: (value: Model | null) => RepeatableSummary;
|
|
19
18
|
}) => ObjectComponent;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Icon, Image, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { InputComponent, RepeatableSummary, StepComponent, UpdateComponent } from '../types';
|
|
3
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
|
+
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
5
|
+
export type SelectInputComponent = Omit<InputComponent<Model>, 'onChange'> & {
|
|
6
|
+
type: 'select';
|
|
7
|
+
selectedIndex: number | null;
|
|
8
|
+
options: SelectInputOption[];
|
|
9
|
+
children: StepComponent[];
|
|
10
|
+
onSelect: (index: number | null) => void;
|
|
11
|
+
getChildren: () => StepComponent[];
|
|
12
|
+
getSelectedChild: () => StepComponent | null;
|
|
13
|
+
};
|
|
14
|
+
export type SelectInputOption = {
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
icon?: Icon;
|
|
18
|
+
image?: Image;
|
|
19
|
+
keywords?: string[];
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "autoComplete" | "uid"> & {
|
|
23
|
+
initialValue: Model;
|
|
24
|
+
options: (SelectInputOption & {
|
|
25
|
+
component: StepComponent;
|
|
26
|
+
})[];
|
|
27
|
+
checks: IsInvalidCheck<Model>[];
|
|
28
|
+
summariser: (value: Model | null) => RepeatableSummary;
|
|
29
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
30
|
+
}, updateComponent: UpdateComponent) => SelectInputComponent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
3
|
export type TextInputComponent = InputComponent<string> & {
|
|
4
4
|
type: 'text';
|
|
5
5
|
displayFormat?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "displayFormat" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
|
+
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "displayFormat" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
8
8
|
checks: IsInvalidCheck<string | null>[];
|
|
9
|
+
summariser: (value: string | null) => RepeatableSummary;
|
|
9
10
|
}, updateComponent: UpdateComponent) => TextInputComponent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
3
|
export type UploadInputComponent = InputComponent<string> & {
|
|
4
4
|
type: 'upload';
|
|
5
5
|
accepts?: string[];
|
|
6
6
|
};
|
|
7
|
-
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "accepts" | "autoComplete" | "uid"> & {
|
|
7
|
+
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "analyticsId" | "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "accepts" | "autoComplete" | "uid"> & {
|
|
8
8
|
checks: IsInvalidCheck<string | null>[];
|
|
9
|
+
summariser: (value: string | null) => RepeatableSummary;
|
|
9
10
|
}, updateComponent: UpdateComponent) => UploadInputComponent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ArrayModel, Model } from '@wise/dynamic-flow-types';
|
|
2
|
+
import type { SummarySummariser } from '@wise/dynamic-flow-types/build/next/feature/SummarySummariser';
|
|
3
|
+
import type { BaseComponent, RepeatableSummary, StepComponent, UpdateComponent } from '../../types';
|
|
4
|
+
import type { IsInvalidCheck } from '../../features/validation/value-checks';
|
|
5
|
+
export type RepeatableComponent = BaseComponent<ArrayModel> & {
|
|
6
|
+
id?: string;
|
|
7
|
+
type: 'repeatable';
|
|
8
|
+
addItemTitle: string;
|
|
9
|
+
components: StepComponent[];
|
|
10
|
+
control?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
editableComponent: StepComponent | null;
|
|
13
|
+
editableIndex: number | null;
|
|
14
|
+
editItemTitle: string;
|
|
15
|
+
errors: string[];
|
|
16
|
+
summaryDefaults: RepeatableSummary;
|
|
17
|
+
title?: string;
|
|
18
|
+
getChildren: () => StepComponent[];
|
|
19
|
+
getValue: () => ArrayModel | null;
|
|
20
|
+
onAdd: () => void;
|
|
21
|
+
onEdit: (itemIndex: number) => void;
|
|
22
|
+
onRemove: () => void;
|
|
23
|
+
onSave: () => boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const createRepeatableComponent: (repeatableProps: Pick<RepeatableComponent, "description" | "title" | "control" | "id" | "errors" | "components" | "addItemTitle" | "editItemTitle" | "uid"> & {
|
|
26
|
+
analyticsId?: string | undefined;
|
|
27
|
+
checks: IsInvalidCheck<ArrayModel | null>[];
|
|
28
|
+
summary?: SummarySummariser | undefined;
|
|
29
|
+
summariser: (value: ArrayModel | null) => RepeatableSummary;
|
|
30
|
+
createEditableComponent: (model: Model) => StepComponent;
|
|
31
|
+
}, updateComponent: UpdateComponent) => RepeatableComponent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SearchResult } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { LayoutComponent, OnAction, UpdateComponent } from '../../types';
|
|
3
|
+
export type SearchConfig = {
|
|
4
|
+
method: string;
|
|
5
|
+
param: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
export type SearchProps = {
|
|
9
|
+
config?: SearchConfig;
|
|
10
|
+
query: string;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
};
|
|
13
|
+
export type PerformSearch = (props: SearchProps) => Promise<SearchResult[]>;
|
|
14
|
+
export type SearchComponent = LayoutComponent & {
|
|
15
|
+
type: 'search';
|
|
16
|
+
emptyMessage: string;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
query: string;
|
|
19
|
+
title: string;
|
|
20
|
+
results: SearchResult[];
|
|
21
|
+
error?: string;
|
|
22
|
+
onChange: (query: string) => void;
|
|
23
|
+
onSelect: (result: SearchResult) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const createSearchComponent: (searchProps: Pick<SearchComponent, 'uid' | 'control' | 'emptyMessage' | 'margin' | 'title'>, performSearch: PerformSearch, onAction: OnAction, updateComponent: UpdateComponent) => SearchComponent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface DebouncedFunc<T extends (...args: Parameters<T>) => ReturnType<T>> {
|
|
2
|
+
(...args: Parameters<T>): void;
|
|
3
|
+
cancel: () => void;
|
|
4
|
+
flush: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const debounce: <T extends (...args: Parameters<T>) => ReturnType<T>>(callback: T, waitMs: number) => DebouncedFunc<T>;
|
package/build/types/revamp/domain/{events → features/events}/getAnalyticsEventDispatcher.d.ts
RENAMED
|
@@ -6,4 +6,4 @@ export declare const getAnalyticsEventDispatcher: ({ flowId, step, onEvent, }: {
|
|
|
6
6
|
step?: Step | null | undefined;
|
|
7
7
|
onEvent?: AnalyticsEventHandler | undefined;
|
|
8
8
|
}) => AnalyticsEventDispatcher;
|
|
9
|
-
export type EventName = 'Flow Started' | 'Flow Completed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Failed' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed' | 'Search Started' | 'Search Result Selected';
|
|
9
|
+
export type EventName = 'Flow Started' | 'Flow Completed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Failed' | 'OneOf Selected' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed' | 'Search Started' | 'Search Result Selected';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SearchConfig, PerformSearch } from '../../components/searchComponent/SearchComponent';
|
|
2
|
+
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
3
|
+
export declare const getPerformSearchFunction: (httpClient: HttpClient, defaultConfig: SearchConfig) => PerformSearch;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Icon, Image, Model, Schema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { RepeatableSummary, StepComponent } from '../../types';
|
|
3
|
+
/** A summariser that accepts a schema and returns a function that can form a summary based on a value. */
|
|
4
|
+
export declare const getSummariser: <S extends Schema>(schema: S) => (model: Model | null) => {
|
|
5
|
+
title?: undefined;
|
|
6
|
+
description?: undefined;
|
|
7
|
+
icon?: undefined;
|
|
8
|
+
image?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
title: string | undefined;
|
|
11
|
+
description: string | undefined;
|
|
12
|
+
icon: Icon | undefined;
|
|
13
|
+
image: Image | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const getConstSummary: (schema: Schema, model: Model | null) => {
|
|
16
|
+
title?: undefined;
|
|
17
|
+
description?: undefined;
|
|
18
|
+
icon?: undefined;
|
|
19
|
+
image?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
title: string | undefined;
|
|
22
|
+
description: string | undefined;
|
|
23
|
+
icon: Icon | undefined;
|
|
24
|
+
image: Image | undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare const summariseFromChildren: (components: StepComponent[]) => RepeatableSummary;
|
|
27
|
+
export declare const mergeSummaries: (summaryA: RepeatableSummary, summaryB: RepeatableSummary) => {
|
|
28
|
+
title: string | undefined;
|
|
29
|
+
description: string | undefined;
|
|
30
|
+
icon: Icon | undefined;
|
|
31
|
+
image: Image | undefined;
|
|
32
|
+
};
|
|
@@ -6,6 +6,8 @@ export declare const mockErrorMessageFunctions: {
|
|
|
6
6
|
maximumDate: jest.Mock<any, any, any>;
|
|
7
7
|
minLength: jest.Mock<any, any, any>;
|
|
8
8
|
maxLength: jest.Mock<any, any, any>;
|
|
9
|
+
minItems: jest.Mock<any, any, any>;
|
|
10
|
+
maxItems: jest.Mock<any, any, any>;
|
|
9
11
|
pattern: jest.Mock<any, any, any>;
|
|
10
12
|
required: jest.Mock<any, any, any>;
|
|
11
13
|
};
|
package/build/types/revamp/domain/{validation → features/validation}/validateComponents.d.ts
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StepComponent } from '
|
|
1
|
+
import type { StepComponent } from '../../types';
|
|
2
2
|
export declare const validateComponents: (components: StepComponent[]) => boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { IntegerSchema, Model, NumberSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { ErrorMessageFunctions } from '
|
|
1
|
+
import type { ArrayModel, ArraySchemaList, IntegerSchema, Model, NumberSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { ErrorMessageFunctions } from '../../mappers/types';
|
|
3
3
|
export type IsInvalidCheck<M extends Model> = (model: M | null) => string | null;
|
|
4
4
|
type GetIsInvalidCheck<S extends Schema, M extends Model> = (schema: S, messageFunctions: ErrorMessageFunctions) => IsInvalidCheck<M>;
|
|
5
|
+
export declare const getAboveMaxItemsCheck: GetIsInvalidCheck<ArraySchemaList, ArrayModel | null>;
|
|
6
|
+
export declare const getBelowMinItemsCheck: GetIsInvalidCheck<ArraySchemaList, ArrayModel | null>;
|
|
5
7
|
export declare const getAboveMaxLengthCheck: GetIsInvalidCheck<StringSchema, string | null>;
|
|
6
8
|
export declare const getBelowMinLengthCheck: GetIsInvalidCheck<StringSchema, string | null>;
|
|
7
9
|
export declare const getAboveMaximumCheck: GetIsInvalidCheck<NumberSchema | IntegerSchema, number | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AlertLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
export declare const alertLayoutToComponent: (
|
|
2
|
+
export declare const alertLayoutToComponent: ({ control, markdown, margin, context, }: AlertLayout) => import("../../components/AlertComponent").AlertComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { BoxLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import { type BoxComponent } from '../../components/BoxComponent';
|
|
3
3
|
import type { MapperProps } from '../schema/types';
|
|
4
|
-
export declare const boxLayoutToComponent: (
|
|
4
|
+
export declare const boxLayoutToComponent: ({ border, components, control, margin, width }: BoxLayout, mapperProps: MapperProps) => BoxComponent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ButtonLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps } from '../schema/types';
|
|
3
|
-
export declare const buttonLayoutToComponent: (
|
|
3
|
+
export declare const buttonLayoutToComponent: ({ action, context, control, disabled, margin, pinOrder, size, title }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnsLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps } from '../schema/types';
|
|
3
3
|
import { type ColumnsComponent } from '../../components/ColumnsComponent';
|
|
4
|
-
export declare const columnsLayoutToComponent: (
|
|
4
|
+
export declare const columnsLayoutToComponent: ({ control, left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps) => ColumnsComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FormLayout } 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 formLayoutToComponent: (
|
|
4
|
+
export declare const formLayoutToComponent: ({ schemaId, control, margin }: FormLayout, mapperProps: MapperProps) => StepComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { HeadingLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
export declare const headingLayoutToComponent: (
|
|
2
|
+
export declare const headingLayoutToComponent: ({ align, margin, size, control, text, }: HeadingLayout) => import("../../components/HeadingComponent").HeadingComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ParagraphLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
export declare const paragraphLayoutToComponent: (
|
|
2
|
+
export declare const paragraphLayoutToComponent: ({ align, control, margin, text, }: ParagraphLayout) => import("../../components/ParagraphComponent").ParagraphComponent;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SearchLayout } from '@wise/dynamic-flow-types/build/next/layout/SearchLayout';
|
|
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;
|
|
@@ -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: (
|
|
4
|
+
export declare const mapLayoutToComponent: (layout: Layout, mapperProps: MapperProps) => StepComponent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StepComponent } from '../types';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from './schema/types';
|
|
3
|
-
export declare const mapSchemaToComponent: (
|
|
3
|
+
export declare const mapSchemaToComponent: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => StepComponent;
|
package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
2
|
+
import type { ArraySchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
+
export declare const arraySchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: ArraySchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ArrayModel, ArraySchemaList } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const arraySchemaToRepeatableComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: ArraySchemaList;
|
|
5
|
+
model: ArrayModel | null;
|
|
6
|
+
}, mapperProps: MapperProps) => import("../../../components/repeatableComponent/RepeatableComponent").RepeatableComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
|
+
import type { BooleanSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
+
export declare const booleanSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: BooleanSchema;
|
|
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: (
|
|
3
|
+
export declare const constSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: ConstSchema;
|
|
5
5
|
}) => import("../../components/HiddenComponent").HiddenComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
2
|
import type { IntegerSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
export declare const integerSchemaToComponent: (
|
|
3
|
+
export declare const integerSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: IntegerSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/IntegerInputComponent").IntegerInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
2
|
import type { NumberSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
export declare const numberSchemaToComponent: (
|
|
3
|
+
export declare const numberSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: NumberSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/NumberInputComponent").NumberInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObjectSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const objectSchemaToComponent: (
|
|
3
|
+
export declare const objectSchemaToComponent: ({ schema, model, validationErrors }: SchemaMapperProps & {
|
|
4
4
|
schema: ObjectSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../../components/ObjectComponent").ObjectComponent;
|
package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OneOfSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const oneOfSchemaToComponent: ({ schema, model, validationErrors: initialError, required, }: SchemaMapperProps & {
|
|
4
|
+
schema: OneOfSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/SelectInputComponent").SelectInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const stringSchemaToComponent: (
|
|
3
|
+
export declare const stringSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: StringSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../../components/DateInputComponent").DateInputComponent | import("../../../components/TextInputComponent").TextInputComponent | import("../../../components/UploadInputComponent").UploadInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const stringSchemaToDateInputComponent: (
|
|
3
|
+
export declare const stringSchemaToDateInputComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: StringSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../../components/DateInputComponent").DateInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const stringSchemaToTextInputComponent: (
|
|
3
|
+
export declare const stringSchemaToTextInputComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: StringSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../../components/TextInputComponent").TextInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const stringSchemaToUploadInputComponent: (
|
|
3
|
+
export declare const stringSchemaToUploadInputComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: StringSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../../components/UploadInputComponent").UploadInputComponent;
|
|
@@ -5,10 +5,11 @@ import type { StepComponent } from '../../../types';
|
|
|
5
5
|
export declare const getMockMapperProps: (mapperProps?: Partial<MapperProps>) => {
|
|
6
6
|
step: Step;
|
|
7
7
|
getErrorMessageFunctions: jest.Mock<any, any, any> | import("../../types").GetErrorMessageFunctions;
|
|
8
|
+
httpClient: typeof fetch | jest.Mock<any, any, any>;
|
|
8
9
|
onAction: jest.Mock<any, any, any> | import("../../../types").OnAction;
|
|
9
10
|
updateComponent: jest.Mock<any, any, any> | import("../../../types").UpdateComponent;
|
|
10
|
-
trackEvent: jest.Mock<any, any, any> | import("../../../events").AnalyticsEventDispatcher;
|
|
11
|
-
logEvent: jest.Mock<any, any, any> | import("../../../events").LoggingEventDispatcher;
|
|
11
|
+
trackEvent: jest.Mock<any, any, any> | import("../../../features/events").AnalyticsEventDispatcher;
|
|
12
|
+
logEvent: jest.Mock<any, any, any> | import("../../../features/events").LoggingEventDispatcher;
|
|
12
13
|
};
|
|
13
14
|
export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperProps: Partial<SchemaMapperProps> & {
|
|
14
15
|
schema: S;
|
|
@@ -19,3 +20,4 @@ export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperPr
|
|
|
19
20
|
validationErrors: import("@wise/dynamic-flow-types/build/next").ValidationError;
|
|
20
21
|
};
|
|
21
22
|
export declare const mockUpdateFunction: <C extends StepComponent>(draftComponent: C) => jest.Mock<any, any, any>;
|
|
23
|
+
export declare const getUpdateFunctionMock: <C extends StepComponent>(getComponent: () => C) => jest.Mock<void, [uid: string, update: (component: StepComponent) => void], any>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Step as DFStep, Model, Schema, ValidationError } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { OnAction, UpdateComponent } from '../../types';
|
|
3
3
|
import type { GetErrorMessageFunctions } from '../types';
|
|
4
|
-
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../events';
|
|
4
|
+
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
|
|
5
|
+
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
5
6
|
export type MapperProps = {
|
|
6
7
|
step: DFStep;
|
|
7
8
|
getErrorMessageFunctions: GetErrorMessageFunctions;
|
|
9
|
+
httpClient: HttpClient;
|
|
8
10
|
onAction: OnAction;
|
|
9
11
|
updateComponent: UpdateComponent;
|
|
10
12
|
trackEvent: AnalyticsEventDispatcher;
|
|
@@ -7,6 +7,8 @@ export type ErrorMessageFunctions = {
|
|
|
7
7
|
minimumDate: (minDate: string) => string;
|
|
8
8
|
maxLength: (maxLength: number) => string;
|
|
9
9
|
minLength: (minLength: number) => string;
|
|
10
|
+
maxItems: (maxItems: number) => string;
|
|
11
|
+
minItems: (minItems: number) => string;
|
|
10
12
|
pattern: () => string;
|
|
11
13
|
required: () => string;
|
|
12
14
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRandomId: () => string;
|