@wise/dynamic-flow-client 2.8.6 → 2.8.7

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.
@@ -1,4 +1,4 @@
1
- import { Icon, Image, Schema } from '@wise/dynamic-flow-types';
1
+ import type { Icon, Image, Schema } from '@wise/dynamic-flow-types';
2
2
  declare const mapConstSchemaToOption: <ControlType extends string>(schema: Schema, controlType?: ControlType | undefined) => ControlType extends "select" ? SelectOption : RadioOption;
3
3
  type RadioOption = {
4
4
  disabled?: boolean | undefined;
@@ -0,0 +1,7 @@
1
+ import type { LayoutComponent, StepComponent } from '../types';
2
+ export type FormComponent = LayoutComponent & {
3
+ type: 'form';
4
+ components: StepComponent[];
5
+ getChildren: () => StepComponent[];
6
+ };
7
+ export declare const createFormComponent: (formProps: Pick<FormComponent, 'uid' | 'components' | 'control' | 'margin'>) => FormComponent;
@@ -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: (uid: string, { schemaId }: FormLayout, mapperProps: MapperProps) => StepComponent;
4
+ export declare const formLayoutToComponent: (uid: string, { schemaId, control, margin }: FormLayout, mapperProps: MapperProps) => StepComponent;
@@ -12,8 +12,9 @@ import type { IntegerInputComponent } from './components/IntegerInputComponent';
12
12
  import type { DateInputComponent } from './components/DateInputComponent';
13
13
  import type { UploadInputComponent } from './components/UploadInputComponent';
14
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;
15
+ import type { FormComponent } from './components/FormComponent';
16
+ export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | FormComponent | HeadingComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
17
+ export type HasChildren = BoxComponent | ColumnsComponent | ContainerComponent | FormComponent | ObjectComponent;
17
18
  export type BaseComponent<M extends Model> = {
18
19
  type: string;
19
20
  uid: string;
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FormComponent } from '../../domain/components/FormComponent';
3
+ import type { FormRendererProps } from '../types';
4
+ export declare const formComponentToProps: ({ control, margin }: FormComponent, children: ReactNode) => FormRendererProps;
@@ -35,6 +35,12 @@ export interface ColumnsRendererProps extends RendererProps {
35
35
  startChildren: ReactNode;
36
36
  endChildren: ReactNode;
37
37
  }
38
+ export interface FormRendererProps extends RendererProps {
39
+ type: 'form';
40
+ children: ReactNode;
41
+ control?: string;
42
+ margin: Margin;
43
+ }
38
44
  export interface HeadingRendererProps extends RendererProps {
39
45
  type: 'heading';
40
46
  text: string;
@@ -0,0 +1,3 @@
1
+ import type { FormRendererProps, Renderer } from '../../renderers/types';
2
+ declare const FormRenderer: Renderer<FormRendererProps>;
3
+ export default FormRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.8.6",
3
+ "version": "2.8.7",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",