@wise/dynamic-flow-client 2.8.10 → 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 +14 -20
- 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/revamp/domain/components/BooleanInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +4 -7
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +7 -9
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +6 -5
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +31 -0
- package/build/types/revamp/domain/features/search/getPerformSearchFunction.d.ts +1 -1
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +32 -0
- package/build/types/revamp/domain/features/validation/spec-utils.d.ts +2 -0
- package/build/types/revamp/domain/features/validation/value-checks.d.ts +3 -1
- 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 +1 -1
- 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 +1 -1
- package/build/types/revamp/domain/mappers/schema/constSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/integerSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/numberSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +1 -1
- 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/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 +13 -5
- package/build/types/revamp/domain/validation/validation-functions.d.ts +8 -0
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +1 -0
- 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 +1 -1
- package/build/types/revamp/renderers/mappers/selectInputComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +19 -0
- package/build/types/revamp/renderers/types.d.ts +29 -5
- 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 +6 -2
- package/build/types/revamp/wise/renderers/RepeatableRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/OptionMedia.d.ts +5 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.d.ts +5 -0
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +2 -1
- package/build/types/revamp/wise/renderers/components/icon/DynamicIcon.d.ts +2 -2
- package/build/types/revamp/wise/renderers/components/icon/NavigationOptionMedia.d.ts +5 -0
- package/package.json +4 -3
- /package/build/types/{legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.messages.d.ts → common/messages/repeatable.messages.d.ts} +0 -0
- /package/build/types/{common → legacy/layout}/icon/FlagIcon.d.ts +0 -0
- /package/build/types/{common → legacy/layout}/icon/NamedIcon.d.ts +0 -0
- /package/build/types/revamp/domain/components/{search → searchComponent}/SearchComponent.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,8 +1,9 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
export type BooleanInputComponent = InputComponent<boolean> & {
|
|
4
4
|
type: 'boolean';
|
|
5
5
|
};
|
|
6
6
|
export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "control" | "id" | "errors" | "required" | "value" | "uid"> & {
|
|
7
7
|
checks: IsInvalidCheck<boolean | null>[];
|
|
8
|
+
summariser: (value: boolean | null) => RepeatableSummary;
|
|
8
9
|
}, updateComponent: UpdateComponent) => BooleanInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
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;
|
|
@@ -7,4 +7,5 @@ export type DateInputComponent = InputComponent<string> & {
|
|
|
7
7
|
};
|
|
8
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,12 +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;
|
|
8
|
-
analyticsId?: string;
|
|
6
|
+
export declare const createHiddenComponent: (hiddenProps: Pick<HiddenComponent, "analyticsId" | "uid"> & {
|
|
9
7
|
value: Model;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export {};
|
|
8
|
+
summary: RepeatableSummary;
|
|
9
|
+
}) => HiddenComponent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
export type IntegerInputComponent = InputComponent<number> & {
|
|
4
4
|
type: 'integer';
|
|
5
5
|
};
|
|
6
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';
|
|
1
|
+
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
3
|
export type NumberInputComponent = InputComponent<number> & {
|
|
4
4
|
type: 'number';
|
|
5
5
|
};
|
|
6
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,20 +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
|
analyticsId?: string | undefined;
|
|
15
|
-
components: Record<string, StepComponent>;
|
|
16
|
-
description?: string | undefined;
|
|
17
16
|
displayOrder: string[];
|
|
18
|
-
|
|
19
|
-
title?: string | undefined;
|
|
17
|
+
summariser: (value: Model | null) => RepeatableSummary;
|
|
20
18
|
}) => ObjectComponent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Icon,
|
|
2
|
-
import type { InputComponent, StepComponent, UpdateComponent } from '../types';
|
|
1
|
+
import type { Icon, Image, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { InputComponent, RepeatableSummary, StepComponent, UpdateComponent } from '../types';
|
|
3
3
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
4
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
5
|
-
export type SelectInputComponent = Omit<InputComponent<Model>, 'onChange'
|
|
5
|
+
export type SelectInputComponent = Omit<InputComponent<Model>, 'onChange'> & {
|
|
6
6
|
type: 'select';
|
|
7
7
|
selectedIndex: number | null;
|
|
8
8
|
options: SelectInputOption[];
|
|
@@ -15,15 +15,16 @@ export type SelectInputOption = {
|
|
|
15
15
|
title: string;
|
|
16
16
|
description?: string;
|
|
17
17
|
icon?: Icon;
|
|
18
|
-
image?:
|
|
18
|
+
image?: Image;
|
|
19
19
|
keywords?: string[];
|
|
20
20
|
disabled: boolean;
|
|
21
21
|
};
|
|
22
|
-
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent,
|
|
22
|
+
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "autoComplete" | "uid"> & {
|
|
23
23
|
initialValue: Model;
|
|
24
24
|
options: (SelectInputOption & {
|
|
25
25
|
component: StepComponent;
|
|
26
26
|
})[];
|
|
27
27
|
checks: IsInvalidCheck<Model>[];
|
|
28
|
+
summariser: (value: Model | null) => RepeatableSummary;
|
|
28
29
|
trackEvent: AnalyticsEventDispatcher;
|
|
29
30
|
}, updateComponent: UpdateComponent) => SelectInputComponent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
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
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 { InputComponent, UpdateComponent } from '../types';
|
|
2
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
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;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SearchConfig, PerformSearch } from '../../components/
|
|
1
|
+
import type { SearchConfig, PerformSearch } from '../../components/searchComponent/SearchComponent';
|
|
2
2
|
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
3
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
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { IntegerSchema, Model, NumberSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
1
|
+
import type { ArrayModel, ArraySchemaList, IntegerSchema, Model, NumberSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
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;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SearchLayout } from '@wise/dynamic-flow-types/build/next/layout/SearchLayout';
|
|
2
2
|
import type { MapperProps } from '../schema/types';
|
|
3
|
-
export declare const searchLayoutToComponent: (
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MapperProps, SchemaMapperProps } from './types';
|
|
2
2
|
import type { BooleanSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
export declare const booleanSchemaToComponent: (
|
|
3
|
+
export declare const booleanSchemaToComponent: (schemaMapperProps: SchemaMapperProps & {
|
|
4
4
|
schema: BooleanSchema;
|
|
5
5
|
}, mapperProps: MapperProps) => import("../../components/BooleanInputComponent").BooleanInputComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaMapperProps } from './types';
|
|
2
2
|
import type { ConstSchema } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
export declare const constSchemaToComponent: (
|
|
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OneOfSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
-
export declare const oneOfSchemaToComponent: (
|
|
3
|
+
export declare const oneOfSchemaToComponent: ({ schema, model, validationErrors: initialError, required, }: SchemaMapperProps & {
|
|
4
4
|
schema: OneOfSchema;
|
|
5
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;
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Action, Margin, Model } from '@wise/dynamic-flow-types/build/next';
|
|
1
|
+
import type { Action, Icon, Image, Margin, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { HiddenComponent } from './components/HiddenComponent';
|
|
3
3
|
import type { AlertComponent } from './components/AlertComponent';
|
|
4
4
|
import type { BooleanInputComponent } from './components/BooleanInputComponent';
|
|
@@ -16,15 +16,17 @@ import type { TextInputComponent } from './components/TextInputComponent';
|
|
|
16
16
|
import type { DateInputComponent } from './components/DateInputComponent';
|
|
17
17
|
import type { UploadInputComponent } from './components/UploadInputComponent';
|
|
18
18
|
import type { FormComponent } from './components/FormComponent';
|
|
19
|
-
import type { SearchComponent } from './components/
|
|
20
|
-
|
|
21
|
-
export type
|
|
19
|
+
import type { SearchComponent } from './components/searchComponent/SearchComponent';
|
|
20
|
+
import type { RepeatableComponent } from './components/repeatableComponent/RepeatableComponent';
|
|
21
|
+
export type StepComponent = AlertComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | FormComponent | HeadingComponent | HiddenComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | SearchComponent | SelectInputComponent | TextInputComponent | UploadInputComponent;
|
|
22
|
+
export type HasChildren = BoxComponent | ColumnsComponent | ContainerComponent | FormComponent | RepeatableComponent | SelectInputComponent | ObjectComponent;
|
|
22
23
|
export type BaseComponent<M extends Model> = {
|
|
23
24
|
type: string;
|
|
24
25
|
uid: string;
|
|
25
26
|
analyticsId?: string;
|
|
26
|
-
validate: () => boolean;
|
|
27
27
|
getValue: () => M | null;
|
|
28
|
+
getSummary: () => RepeatableSummary;
|
|
29
|
+
validate: () => boolean;
|
|
28
30
|
};
|
|
29
31
|
export type LayoutComponent = BaseComponent<Model> & {
|
|
30
32
|
control?: string;
|
|
@@ -52,3 +54,9 @@ export type OnAction = (action: Action) => void;
|
|
|
52
54
|
export type Align = 'start' | 'center' | 'end';
|
|
53
55
|
export type Bias = 'none' | 'start' | 'end';
|
|
54
56
|
export type Context = 'positive' | 'negative' | 'warning' | 'neutral';
|
|
57
|
+
export type RepeatableSummary = {
|
|
58
|
+
title?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
icon?: Icon;
|
|
61
|
+
image?: Image;
|
|
62
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { StepComponent } from '../types';
|
|
3
|
+
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
|
+
export declare const validateComponents: (components: StepComponent[]) => boolean;
|
|
5
|
+
export declare const getModelValidationErrors: <M extends Model>({ checks, model, }: {
|
|
6
|
+
checks: IsInvalidCheck<M>[];
|
|
7
|
+
model: M;
|
|
8
|
+
}) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ObjectComponent } from '../../domain/components/ObjectComponent';
|
|
3
3
|
import type { ObjectRendererProps } from '../types';
|
|
4
|
-
export declare const objectComponentToProps: ({
|
|
4
|
+
export declare const objectComponentToProps: ({ control, description, help, title }: ObjectComponent, children: ReactNode) => ObjectRendererProps;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RepeatableRendererProps } from '../types';
|
|
3
|
+
import type { RepeatableComponent } from '../../domain/components/repeatableComponent/RepeatableComponent';
|
|
4
|
+
export declare const repeatableComponentToProps: (component: RepeatableComponent, editableItemChildren: ReactNode) => RepeatableRendererProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SearchComponent } from '../../domain/components/
|
|
1
|
+
import type { SearchComponent } from '../../domain/components/searchComponent/SearchComponent';
|
|
2
2
|
import type { SearchRendererProps } from '../types';
|
|
3
3
|
export declare const searchComponentToProps: (component: SearchComponent) => SearchRendererProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { SelectInputComponent } from '../../domain/components/SelectInputComponent';
|
|
3
3
|
import type { SelectInputRendererProps } from '../types';
|
|
4
|
-
export declare const selectInputComponentToProps: (
|
|
4
|
+
export declare const selectInputComponentToProps: (component: SelectInputComponent, children: ReactNode[]) => SelectInputRendererProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { InputComponent } from '../../../domain/types';
|
|
3
|
+
export declare const inputComponentToProps: <T extends string, M extends Model>(component: Omit<InputComponent<M>, "onChange">, type: T) => {
|
|
4
|
+
type: T;
|
|
5
|
+
autoComplete: string;
|
|
6
|
+
control: string | undefined;
|
|
7
|
+
description: string | undefined;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
error: string;
|
|
10
|
+
help: string | undefined;
|
|
11
|
+
id: string;
|
|
12
|
+
label: string | undefined;
|
|
13
|
+
name: string;
|
|
14
|
+
placeholder: string | undefined;
|
|
15
|
+
required: boolean;
|
|
16
|
+
value: M | null;
|
|
17
|
+
onBlur: () => void;
|
|
18
|
+
onFocus: () => void;
|
|
19
|
+
};
|