@wise/dynamic-flow-client 2.8.4 → 2.8.6
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 +53 -45
- package/build/main.min.js +1 -1
- package/build/types/common/messages/help.messages.d.ts +8 -0
- package/build/types/legacy/jsonSchemaForm/help/Help.d.ts +1 -1
- package/build/types/legacy/layout/paragraph/DynamicParagraph.d.ts +2 -2
- package/build/types/revamp/domain/components/AlertComponent.d.ts +1 -7
- package/build/types/revamp/domain/components/BoxComponent.d.ts +4 -11
- package/build/types/revamp/domain/components/ButtonComponent.d.ts +4 -13
- package/build/types/revamp/domain/components/ColumnsComponent.d.ts +3 -13
- package/build/types/revamp/domain/components/ContainerComponent.d.ts +11 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +10 -0
- package/build/types/revamp/domain/components/HeadingComponent.d.ts +2 -8
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/ParagraphComponent.d.ts +2 -10
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +9 -0
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -2
- 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/headingLayoutToComponent.d.ts +1 -2
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -2
- package/build/types/revamp/domain/mappers/schema/{objectSchemaToComponent.d.ts → objectSchemaToComponent/objectSchemaToComponent.d.ts} +2 -2
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.d.ts +5 -0
- package/build/types/revamp/domain/types.d.ts +8 -3
- package/build/types/revamp/renderers/CoreContainerRenderer.d.ts +7 -0
- package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/containerComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/dateInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/uploadInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/types.d.ts +26 -8
- package/build/types/revamp/utils/type-utils.d.ts +2 -2
- package/build/types/revamp/wise/renderers/DateInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/UploadInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +10 -0
- package/build/types/revamp/wise/renderers/components/VariableDateInput.d.ts +9 -0
- package/build/types/revamp/wise/renderers/components/VariableTextInput.d.ts +10 -0
- package/build/types/revamp/wise/renderers/hooks/useSnackBarIfAvailable.d.ts +10 -0
- package/build/types/revamp/wise/renderers/utils/input-utils.d.ts +1 -0
- package/build/types/revamp/wise/renderers/utils/value-utils.d.ts +3 -0
- package/build/types/revamp/wise/renderers/validators/type-validators.d.ts +9 -0
- package/package.json +2 -2
- package/build/types/legacy/jsonSchemaForm/help/Help.messages.d.ts +0 -8
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent.d.ts +0 -5
- /package/build/types/{legacy/layout/paragraph/DynamicParagraph.messages.d.ts → common/messages/paragraph.messages.d.ts} +0 -0
- /package/build/types/common/{validationMessages → messages}/validation.messages.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ParagraphLayout } from '@wise/dynamic-flow-types';
|
|
1
|
+
import type { ParagraphLayout } from '@wise/dynamic-flow-types';
|
|
2
2
|
type Props = {
|
|
3
3
|
component: ParagraphLayout;
|
|
4
4
|
};
|
|
5
|
-
declare
|
|
5
|
+
declare function DynamicParagraph({ component }: Props): JSX.Element;
|
|
6
6
|
export default DynamicParagraph;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type { Margin } from '@wise/dynamic-flow-types/build/next';
|
|
2
1
|
import type { Context, LayoutComponent } from '../types';
|
|
3
2
|
export type AlertComponent = LayoutComponent & {
|
|
4
3
|
type: 'alert';
|
|
5
4
|
markdown: string;
|
|
6
5
|
context: Context;
|
|
7
6
|
};
|
|
8
|
-
export declare const createAlertComponent: (alertProps:
|
|
9
|
-
uid: string;
|
|
10
|
-
markdown: string;
|
|
11
|
-
context: Context;
|
|
12
|
-
margin: Margin;
|
|
13
|
-
}) => AlertComponent;
|
|
7
|
+
export declare const createAlertComponent: (alertProps: Pick<AlertComponent, 'uid' | 'context' | 'control' | 'margin' | 'markdown'>) => AlertComponent;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export type BoxComponent =
|
|
1
|
+
import type { Size } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { LayoutComponent, StepComponent } from '../types';
|
|
3
|
+
export type BoxComponent = LayoutComponent & {
|
|
4
4
|
type: 'box';
|
|
5
5
|
border: boolean;
|
|
6
6
|
width: Size;
|
|
7
|
-
margin: Margin;
|
|
8
7
|
components: StepComponent[];
|
|
9
8
|
getChildren: () => StepComponent[];
|
|
10
9
|
};
|
|
11
|
-
export declare const createBoxComponent: (boxProps:
|
|
12
|
-
uid: string;
|
|
13
|
-
border: boolean;
|
|
14
|
-
width: Size;
|
|
15
|
-
margin: Margin;
|
|
16
|
-
components: StepComponent[];
|
|
17
|
-
}) => BoxComponent;
|
|
10
|
+
export declare const createBoxComponent: (boxProps: Pick<BoxComponent, 'uid' | 'border' | 'components' | 'control' | 'margin' | 'width'>) => BoxComponent;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Size } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { LayoutComponent, Context } from '../types';
|
|
3
3
|
export type ButtonComponent = LayoutComponent & {
|
|
4
4
|
type: 'button';
|
|
5
|
-
title: string;
|
|
6
5
|
context: Context;
|
|
7
|
-
control?: string;
|
|
8
6
|
disabled: boolean;
|
|
9
7
|
pinOrder?: number;
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export declare const createButtonComponent: (buttonProps: {
|
|
13
|
-
uid: string;
|
|
8
|
+
size?: Size;
|
|
14
9
|
title: string;
|
|
15
|
-
context: Context;
|
|
16
|
-
control?: string;
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
pinOrder?: number;
|
|
19
|
-
margin: Margin;
|
|
20
10
|
onClick: () => void;
|
|
21
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export declare const createButtonComponent: (buttonProps: Pick<ButtonComponent, 'uid' | 'context' | 'control' | 'disabled' | 'margin' | 'onClick' | 'pinOrder' | 'size' | 'title'>) => ButtonComponent;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type ColumnsComponent = BaseComponent<Model> & {
|
|
1
|
+
import type { Bias, LayoutComponent, StepComponent } from '../types';
|
|
2
|
+
export type ColumnsComponent = LayoutComponent & {
|
|
4
3
|
type: 'columns';
|
|
5
4
|
bias: Bias;
|
|
6
|
-
control?: string;
|
|
7
|
-
margin: Margin;
|
|
8
5
|
startComponents: StepComponent[];
|
|
9
6
|
endComponents: StepComponent[];
|
|
10
7
|
getChildren: () => StepComponent[];
|
|
11
8
|
};
|
|
12
|
-
export declare const createColumnsComponent: (columnsProps:
|
|
13
|
-
uid: string;
|
|
14
|
-
bias: Bias;
|
|
15
|
-
control?: string;
|
|
16
|
-
margin: Margin;
|
|
17
|
-
startComponents: StepComponent[];
|
|
18
|
-
endComponents: StepComponent[];
|
|
19
|
-
}) => ColumnsComponent;
|
|
9
|
+
export declare const createColumnsComponent: (columnsProps: Pick<ColumnsComponent, 'uid' | 'bias' | 'control' | 'margin' | 'startComponents' | 'endComponents'>) => ColumnsComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Model } from '@wise/dynamic-flow-types';
|
|
2
|
+
import type { BaseComponent, StepComponent } from '../types';
|
|
3
|
+
export type ContainerComponent = BaseComponent<Model> & {
|
|
4
|
+
type: 'container';
|
|
5
|
+
components: StepComponent[];
|
|
6
|
+
getChildren: () => StepComponent[];
|
|
7
|
+
};
|
|
8
|
+
export declare const createContainerComponent: (containerProps: {
|
|
9
|
+
uid: string;
|
|
10
|
+
components: StepComponent[];
|
|
11
|
+
}) => ContainerComponent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
|
+
import type { IsInvalidCheck } from '../validation/value-checks';
|
|
3
|
+
export type DateInputComponent = InputComponent<string> & {
|
|
4
|
+
type: 'date';
|
|
5
|
+
minimumDate?: string;
|
|
6
|
+
maximumDate?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "minimumDate" | "maximumDate" | "uid"> & {
|
|
9
|
+
checks: IsInvalidCheck<string | null>[];
|
|
10
|
+
}, updateComponent: UpdateComponent) => DateInputComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Size } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { Align, LayoutComponent } from '../types';
|
|
3
3
|
export type HeadingComponent = LayoutComponent & {
|
|
4
4
|
type: 'heading';
|
|
@@ -6,10 +6,4 @@ export type HeadingComponent = LayoutComponent & {
|
|
|
6
6
|
align: Align;
|
|
7
7
|
size: Size;
|
|
8
8
|
};
|
|
9
|
-
export declare const createHeadingComponent: (headingProps:
|
|
10
|
-
uid: string;
|
|
11
|
-
text: string;
|
|
12
|
-
align: Align;
|
|
13
|
-
margin: Margin;
|
|
14
|
-
size: Size;
|
|
15
|
-
}) => HeadingComponent;
|
|
9
|
+
export declare const createHeadingComponent: (headingProps: Pick<HeadingComponent, 'uid' | 'control' | 'text' | 'align' | 'margin' | 'size'>) => HeadingComponent;
|
|
@@ -3,6 +3,6 @@ import type { IsInvalidCheck } from '../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" | "title" | "placeholder" | "control" | "id" | "errors" | "value" | "autoComplete" | "uid"> & {
|
|
6
|
+
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
7
|
checks: IsInvalidCheck<number | null>[];
|
|
8
8
|
}, updateComponent: UpdateComponent) => IntegerInputComponent;
|
|
@@ -3,6 +3,6 @@ import type { IsInvalidCheck } from '../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" | "title" | "placeholder" | "control" | "id" | "errors" | "value" | "autoComplete" | "uid"> & {
|
|
6
|
+
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
7
|
checks: IsInvalidCheck<number | null>[];
|
|
8
8
|
}, updateComponent: UpdateComponent) => NumberInputComponent;
|
|
@@ -5,6 +5,7 @@ export type ObjectComponent = Omit<BaseComponent<Record<string, Model>>, 'getVal
|
|
|
5
5
|
title?: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
componentMap: Record<string, StepComponent>;
|
|
8
|
+
help?: string;
|
|
8
9
|
getChildren: () => StepComponent[];
|
|
9
10
|
getValue: () => Record<string, Model>;
|
|
10
11
|
};
|
|
@@ -14,4 +15,5 @@ export declare const createObjectComponent: (objectProps: {
|
|
|
14
15
|
description?: string | undefined;
|
|
15
16
|
displayOrder: string[];
|
|
16
17
|
components: Record<string, StepComponent>;
|
|
18
|
+
help?: string | undefined;
|
|
17
19
|
}) => ObjectComponent;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import type { Margin } from '@wise/dynamic-flow-types/build/next';
|
|
2
1
|
import type { Align, LayoutComponent } from '../types';
|
|
3
2
|
export type ParagraphComponent = LayoutComponent & {
|
|
4
3
|
type: 'paragraph';
|
|
5
|
-
text: string;
|
|
6
|
-
control?: string;
|
|
7
4
|
align: Align;
|
|
8
|
-
};
|
|
9
|
-
export declare const createParagraphComponent: (paragraphProps: {
|
|
10
|
-
uid: string;
|
|
11
5
|
text: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
align: Align;
|
|
15
|
-
}) => ParagraphComponent;
|
|
6
|
+
};
|
|
7
|
+
export declare const createParagraphComponent: (paragraphProps: Pick<ParagraphComponent, 'uid' | 'align' | 'control' | 'margin' | 'text'>) => ParagraphComponent;
|
|
@@ -2,7 +2,8 @@ import type { InputComponent, UpdateComponent } from '../types';
|
|
|
2
2
|
import type { IsInvalidCheck } from '../validation/value-checks';
|
|
3
3
|
export type TextInputComponent = InputComponent<string> & {
|
|
4
4
|
type: 'text';
|
|
5
|
+
displayFormat?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "value" | "autoComplete" | "uid"> & {
|
|
7
|
+
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "displayFormat" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
8
|
checks: IsInvalidCheck<string | null>[];
|
|
8
9
|
}, updateComponent: UpdateComponent) => TextInputComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InputComponent, UpdateComponent } from '../types';
|
|
2
|
+
import type { IsInvalidCheck } from '../validation/value-checks';
|
|
3
|
+
export type UploadInputComponent = InputComponent<string> & {
|
|
4
|
+
type: 'upload';
|
|
5
|
+
accepts?: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "accepts" | "autoComplete" | "uid"> & {
|
|
8
|
+
checks: IsInvalidCheck<string | null>[];
|
|
9
|
+
}, updateComponent: UpdateComponent) => UploadInputComponent;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { AlertLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
|
|
3
|
-
export declare const alertLayoutToComponent: (uid: string, { markdown, margin, context }: AlertLayout, mapperProps: MapperProps) => import("../../components/AlertComponent").AlertComponent;
|
|
2
|
+
export declare const alertLayoutToComponent: (uid: string, { 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: (uid: string, { components,
|
|
4
|
+
export declare const boxLayoutToComponent: (uid: string, { 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: (uid: string, {
|
|
3
|
+
export declare const buttonLayoutToComponent: (uid: string, { 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: (uid: string, { left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps) => ColumnsComponent;
|
|
4
|
+
export declare const columnsLayoutToComponent: (uid: string, { control, left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps) => ColumnsComponent;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { HeadingLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
|
|
3
|
-
export declare const headingLayoutToComponent: (uid: string, { text, size, margin, align }: HeadingLayout, mapperProps: MapperProps) => import("../../components/HeadingComponent").HeadingComponent;
|
|
2
|
+
export declare const headingLayoutToComponent: (uid: string, { align, margin, size, control, text }: HeadingLayout) => import("../../components/HeadingComponent").HeadingComponent;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { ParagraphLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
|
|
3
|
-
export declare const paragraphLayoutToComponent: (uid: string, { text, control, align, margin }: ParagraphLayout, mapperProps: MapperProps) => import("../../components/ParagraphComponent").ParagraphComponent;
|
|
2
|
+
export declare const paragraphLayoutToComponent: (uid: string, { align, control, margin, text }: ParagraphLayout) => import("../../components/ParagraphComponent").ParagraphComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObjectSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { MapperProps, SchemaMapperProps } from '
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
3
|
export declare const objectSchemaToComponent: (uid: string, { schema, model, validationErrors }: SchemaMapperProps & {
|
|
4
4
|
schema: ObjectSchema;
|
|
5
|
-
}, mapperProps: MapperProps) => import("
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/ObjectComponent").ObjectComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const stringSchemaToComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: StringSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/DateInputComponent").DateInputComponent | import("../../../components/TextInputComponent").TextInputComponent | import("../../../components/UploadInputComponent").UploadInputComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const stringSchemaToDateInputComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: StringSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/DateInputComponent").DateInputComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const stringSchemaToTextInputComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: StringSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/TextInputComponent").TextInputComponent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
3
|
+
export declare const stringSchemaToUploadInputComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
|
|
4
|
+
schema: StringSchema;
|
|
5
|
+
}, mapperProps: MapperProps) => import("../../../components/UploadInputComponent").UploadInputComponent;
|
|
@@ -9,8 +9,11 @@ import type { TextInputComponent } from './components/TextInputComponent';
|
|
|
9
9
|
import type { ColumnsComponent } from './components/ColumnsComponent';
|
|
10
10
|
import type { NumberInputComponent } from './components/NumberInputComponent';
|
|
11
11
|
import type { IntegerInputComponent } from './components/IntegerInputComponent';
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import type { DateInputComponent } from './components/DateInputComponent';
|
|
13
|
+
import type { UploadInputComponent } from './components/UploadInputComponent';
|
|
14
|
+
import type { ContainerComponent } from './components/ContainerComponent';
|
|
15
|
+
export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | DateInputComponent | ContainerComponent | HeadingComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
|
|
16
|
+
export type HasChildren = ObjectComponent | BoxComponent | ColumnsComponent | ContainerComponent;
|
|
14
17
|
export type BaseComponent<M extends Model> = {
|
|
15
18
|
type: string;
|
|
16
19
|
uid: string;
|
|
@@ -18,8 +21,8 @@ export type BaseComponent<M extends Model> = {
|
|
|
18
21
|
getValue: () => M | null;
|
|
19
22
|
};
|
|
20
23
|
export type LayoutComponent = BaseComponent<Model> & {
|
|
24
|
+
control?: string;
|
|
21
25
|
margin: Margin;
|
|
22
|
-
getValue: () => null;
|
|
23
26
|
};
|
|
24
27
|
export type InputComponent<M extends Model> = BaseComponent<M> & {
|
|
25
28
|
id: string;
|
|
@@ -28,7 +31,9 @@ export type InputComponent<M extends Model> = BaseComponent<M> & {
|
|
|
28
31
|
description?: string;
|
|
29
32
|
disabled: boolean;
|
|
30
33
|
errors: string[];
|
|
34
|
+
help?: string;
|
|
31
35
|
placeholder?: string;
|
|
36
|
+
required: boolean;
|
|
32
37
|
title?: string;
|
|
33
38
|
value: M | null;
|
|
34
39
|
onChange: (value: M | null) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Renderer, RendererProps } from './types';
|
|
3
|
+
export interface CoreContainerRendererProps extends RendererProps {
|
|
4
|
+
type: 'container';
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const CoreContainerRenderer: Renderer<CoreContainerRendererProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AlertComponent } from '../../domain/components/AlertComponent';
|
|
2
2
|
import type { AlertRendererProps } from '../types';
|
|
3
|
-
export declare const alertComponentToProps: ({
|
|
3
|
+
export declare const alertComponentToProps: ({ context, control, margin, markdown, }: AlertComponent) => AlertRendererProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BoxComponent } from '../../domain/components/BoxComponent';
|
|
3
3
|
import type { BoxRendererProps } from '../types';
|
|
4
|
-
export declare const boxComponentToProps: ({ border, width, margin }: BoxComponent, children: ReactNode) => BoxRendererProps;
|
|
4
|
+
export declare const boxComponentToProps: ({ border, control, width, margin }: BoxComponent, children: ReactNode) => BoxRendererProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { HeadingComponent } from '../../domain/components/HeadingComponent';
|
|
2
2
|
import type { HeadingRendererProps } from '../types';
|
|
3
|
-
export declare const headingComponentToProps: ({
|
|
3
|
+
export declare const headingComponentToProps: ({ align, control, margin, size, text, }: HeadingComponent) => HeadingRendererProps;
|
|
@@ -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: ({ title, description }: ObjectComponent, children: ReactNode) => ObjectRendererProps;
|
|
4
|
+
export declare const objectComponentToProps: ({ title, description, help }: ObjectComponent, children: ReactNode) => ObjectRendererProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ParagraphComponent } from '../../domain/components/ParagraphComponent';
|
|
2
2
|
import type { ParagraphRendererProps } from '../types';
|
|
3
|
-
export declare const paragraphComponentToProps: ({
|
|
3
|
+
export declare const paragraphComponentToProps: ({ align, control, margin, text, }: ParagraphComponent) => ParagraphRendererProps;
|
|
@@ -14,16 +14,18 @@ export interface RendererProps {
|
|
|
14
14
|
}
|
|
15
15
|
export interface AlertRendererProps extends RendererProps {
|
|
16
16
|
type: 'alert';
|
|
17
|
-
markdown: string;
|
|
18
17
|
context: Context;
|
|
18
|
+
control?: string;
|
|
19
19
|
margin: Margin;
|
|
20
|
+
markdown: string;
|
|
20
21
|
}
|
|
21
22
|
export interface BoxRendererProps extends RendererProps {
|
|
22
23
|
type: 'box';
|
|
23
24
|
border: boolean;
|
|
24
|
-
width: Size;
|
|
25
|
-
margin: Margin;
|
|
26
25
|
children: ReactNode;
|
|
26
|
+
control?: string;
|
|
27
|
+
margin: Margin;
|
|
28
|
+
width: Size;
|
|
27
29
|
}
|
|
28
30
|
export interface ColumnsRendererProps extends RendererProps {
|
|
29
31
|
type: 'columns';
|
|
@@ -43,15 +45,16 @@ export interface HeadingRendererProps extends RendererProps {
|
|
|
43
45
|
}
|
|
44
46
|
export interface ParagraphRendererProps extends RendererProps {
|
|
45
47
|
type: 'paragraph';
|
|
46
|
-
|
|
48
|
+
align: Align;
|
|
47
49
|
control?: string;
|
|
48
50
|
margin: Margin;
|
|
49
|
-
|
|
51
|
+
text: string;
|
|
50
52
|
}
|
|
51
53
|
export interface ObjectRendererProps extends RendererProps {
|
|
52
54
|
type: 'object';
|
|
53
55
|
title?: string;
|
|
54
56
|
description?: string;
|
|
57
|
+
help?: string;
|
|
55
58
|
children: ReactNode;
|
|
56
59
|
}
|
|
57
60
|
interface BaseInputRendererProps<M extends string | number> extends RendererProps {
|
|
@@ -59,11 +62,14 @@ interface BaseInputRendererProps<M extends string | number> extends RendererProp
|
|
|
59
62
|
autoComplete: string;
|
|
60
63
|
control?: string;
|
|
61
64
|
description?: string;
|
|
65
|
+
disabled: boolean;
|
|
62
66
|
error?: string;
|
|
63
67
|
format?: 'date';
|
|
68
|
+
help?: string;
|
|
64
69
|
label?: string;
|
|
65
70
|
name: string;
|
|
66
71
|
placeholder?: string;
|
|
72
|
+
required: boolean;
|
|
67
73
|
value: M | null;
|
|
68
74
|
onChange: (value: M | null) => void;
|
|
69
75
|
onBlur: () => void;
|
|
@@ -72,7 +78,13 @@ interface BaseInputRendererProps<M extends string | number> extends RendererProp
|
|
|
72
78
|
export interface TextInputRendererProps extends BaseInputRendererProps<string> {
|
|
73
79
|
type: 'input-text';
|
|
74
80
|
control?: string;
|
|
75
|
-
|
|
81
|
+
displayFormat?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface DateInputRendererProps extends BaseInputRendererProps<string> {
|
|
84
|
+
type: 'input-date';
|
|
85
|
+
control?: string;
|
|
86
|
+
minimumDate?: string;
|
|
87
|
+
maximumDate?: string;
|
|
76
88
|
}
|
|
77
89
|
export interface NumberInputRendererProps extends BaseInputRendererProps<number> {
|
|
78
90
|
type: 'input-number';
|
|
@@ -80,13 +92,19 @@ export interface NumberInputRendererProps extends BaseInputRendererProps<number>
|
|
|
80
92
|
export interface IntegerInputRendererProps extends BaseInputRendererProps<number> {
|
|
81
93
|
type: 'input-integer';
|
|
82
94
|
}
|
|
95
|
+
export interface UploadInputRendererProps extends BaseInputRendererProps<string> {
|
|
96
|
+
type: 'input-upload';
|
|
97
|
+
accepts?: string[];
|
|
98
|
+
}
|
|
83
99
|
export interface ButtonRendererProps extends RendererProps {
|
|
84
100
|
type: 'button';
|
|
85
|
-
title: string;
|
|
86
|
-
control?: string;
|
|
87
101
|
context: Context;
|
|
102
|
+
control?: string;
|
|
88
103
|
disabled: boolean;
|
|
89
104
|
margin: Margin;
|
|
105
|
+
pinOrder?: number;
|
|
106
|
+
size?: Size;
|
|
107
|
+
title: string;
|
|
90
108
|
onClick: () => void;
|
|
91
109
|
}
|
|
92
110
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AllOfSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HasChildren, StepComponent } from '../domain/types';
|
|
3
3
|
import type { ColumnsComponent } from '../domain/components/ColumnsComponent';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const hasChildren: (component: StepComponent) => component is HasChildren;
|
|
5
5
|
export declare const isColumnsComponent: (component: StepComponent) => component is ColumnsComponent;
|
|
6
6
|
export declare const isObjectModel: (model: Model) => model is Record<string, Model>;
|
|
7
7
|
export declare const isAllOfSchema: (schema: Schema) => schema is AllOfSchema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type FieldInputProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
description: string | undefined;
|
|
5
|
+
error: string | undefined;
|
|
6
|
+
help: string | undefined;
|
|
7
|
+
label: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare function FieldInput({ children, label, error, description, help }: FieldInputProps): JSX.Element;
|
|
10
|
+
export default FieldInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateInputRendererProps } from '../../../renderers/types';
|
|
2
|
+
type VariableDateInputProps = Omit<DateInputRendererProps, 'control' | 'type' | 'label' | 'description' | 'error'> & {
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
declare function VariableDateInput({ control, inputProps, }: {
|
|
6
|
+
control: string | undefined;
|
|
7
|
+
inputProps: VariableDateInputProps;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
export default VariableDateInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TextInputRendererProps } from '../../../renderers/types';
|
|
2
|
+
type VariableTextInputProps = Omit<TextInputRendererProps, 'control' | 'type' | 'label' | 'description' | 'error'> & {
|
|
3
|
+
type?: HTMLInputElement['type'];
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
declare function VariableTextInput({ control, inputProps, }: {
|
|
7
|
+
control: string | undefined;
|
|
8
|
+
inputProps: VariableTextInputProps;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
export default VariableTextInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const onWheel: (event: React.WheelEvent<HTMLInputElement>) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const isString: (value: unknown) => value is string;
|
|
2
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
3
|
+
export declare const isInteger: (value: unknown) => value is number;
|
|
4
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
5
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
6
|
+
export declare const isArray: (value: unknown) => value is unknown[];
|
|
7
|
+
export declare const isNull: (value: unknown) => value is null;
|
|
8
|
+
export declare const isUndefined: (value: unknown) => value is undefined;
|
|
9
|
+
export declare const isNullish: (v: unknown) => v is null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.6",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"classnames": "2.3.2",
|
|
92
92
|
"react-webcam": "^7.2.0",
|
|
93
93
|
"screenfull": "^5.2.0",
|
|
94
|
-
"@wise/dynamic-flow-types": "2.4.
|
|
94
|
+
"@wise/dynamic-flow-types": "2.4.1"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"dev": "storybook dev -p 3003",
|