@react-magma/schema-renderer 11.0.0-next.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BasicTemplate/index.d.ts +2 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Combobox/index.d.ts +1 -1
- package/dist/components/Custom/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/FieldArray/FieldArray.d.ts +2 -1
- package/dist/components/FieldArray/FieldArrayItem.d.ts +2 -1
- package/dist/components/FormGroup/index.d.ts +1 -1
- package/dist/components/FormTemplate/index.d.ts +2 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts +1 -1
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/SchemaRenderer/SchemaRenderer.d.ts +2 -1
- package/dist/components/SchemaRenderer/SchemaRenderer.stories.d.ts +2 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Spy/index.d.ts +2 -1
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/TimePicker/index.d.ts +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/schema-renderer.cjs.development.js +28 -35
- package/dist/schema-renderer.cjs.development.js.map +1 -1
- package/dist/schema-renderer.cjs.production.min.js +1 -1
- package/dist/schema-renderer.cjs.production.min.js.map +1 -1
- package/dist/schema-renderer.esm.js +28 -35
- package/dist/schema-renderer.esm.js.map +1 -1
- package/package.json +23 -23
- package/src/components/BasicTemplate/index.tsx +2 -8
- package/src/components/Checkbox/index.tsx +2 -1
- package/src/components/Combobox/index.tsx +2 -1
- package/src/components/ComponentMapper/index.ts +9 -10
- package/src/components/Custom/index.tsx +1 -0
- package/src/components/DatePicker/index.tsx +2 -1
- package/src/components/FieldArray/FieldArray.tsx +3 -7
- package/src/components/FieldArray/FieldArrayItem.tsx +2 -1
- package/src/components/FormGroup/index.tsx +1 -0
- package/src/components/FormTemplate/index.tsx +2 -2
- package/src/components/Input/index.tsx +2 -1
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/PasswordInput/index.tsx +2 -1
- package/src/components/Radio/index.tsx +2 -1
- package/src/components/SchemaRenderer/SchemaRenderer.stories.tsx +5 -6
- package/src/components/SchemaRenderer/SchemaRenderer.test.tsx +2 -0
- package/src/components/SchemaRenderer/SchemaRenderer.tsx +1 -0
- package/src/components/Select/index.tsx +2 -1
- package/src/components/Spy/index.tsx +1 -0
- package/src/components/TemplateMapper/index.ts +3 -1
- package/src/components/Textarea/index.tsx +2 -1
- package/src/components/TimePicker/index.tsx +2 -1
- package/src/components/Toggle/index.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-magma/schema-renderer",
|
|
3
|
-
"version": "11.0.0
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
3
|
+
"version": "11.0.0",
|
|
7
4
|
"license": "MIT",
|
|
8
5
|
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/react-magma-schema-renderer.esm.js",
|
|
9
7
|
"typings": "dist/index.d.ts",
|
|
10
8
|
"files": [
|
|
11
9
|
"dist",
|
|
12
10
|
"src"
|
|
13
11
|
],
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=10"
|
|
16
|
-
},
|
|
17
12
|
"scripts": {
|
|
18
13
|
"build": "tsdx build",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
14
|
+
"lint": "eslint ./src",
|
|
15
|
+
"test": "jest"
|
|
21
16
|
},
|
|
22
|
-
"
|
|
17
|
+
"dependencies": {},
|
|
18
|
+
"devDependencies": {
|
|
23
19
|
"@data-driven-forms/react-form-renderer": "^3.6.0",
|
|
24
20
|
"@emotion/react": "^11.13.0",
|
|
25
21
|
"@emotion/styled": "^11.13.0",
|
|
26
|
-
"date-fns": "^2.
|
|
22
|
+
"date-fns": "^2.16.1",
|
|
27
23
|
"downshift": "^5.4.5",
|
|
28
24
|
"react": "^17.0.2",
|
|
29
25
|
"react-dom": "^17.0.2",
|
|
30
|
-
"react-
|
|
31
|
-
"react-magma-
|
|
32
|
-
"
|
|
26
|
+
"react-dropzone": "11.3.2",
|
|
27
|
+
"react-magma-dom": "^4.9.0",
|
|
28
|
+
"react-magma-icons": "^3.1.0",
|
|
29
|
+
"tsdx": "^0.14.1",
|
|
30
|
+
"uuid": "^11.1.0"
|
|
33
31
|
},
|
|
34
|
-
"
|
|
35
|
-
"devDependencies": {
|
|
32
|
+
"peerDependencies": {
|
|
36
33
|
"@data-driven-forms/react-form-renderer": "^3.6.0",
|
|
37
34
|
"@emotion/react": "^11.13.0",
|
|
38
35
|
"@emotion/styled": "^11.13.0",
|
|
39
|
-
"date-fns": "^2.
|
|
36
|
+
"date-fns": "^2.12.0",
|
|
40
37
|
"downshift": "^5.4.5",
|
|
41
38
|
"react": "^17.0.2",
|
|
42
39
|
"react-dom": "^17.0.2",
|
|
43
|
-
"react-
|
|
44
|
-
"react-magma-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
"react-magma-dom": "^4.9.0-next.27",
|
|
41
|
+
"react-magma-icons": "^3.1.0",
|
|
42
|
+
"uuid": "^8.3.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=10"
|
|
48
46
|
},
|
|
49
|
-
"
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
}
|
|
50
50
|
}
|
|
@@ -2,12 +2,6 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { FormTemplateRenderProps } from '@data-driven-forms/react-form-renderer';
|
|
4
4
|
|
|
5
|
-
export const BasicTemplate = ({
|
|
6
|
-
formFields
|
|
7
|
-
}: FormTemplateRenderProps) => {
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
{formFields}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
5
|
+
export const BasicTemplate = ({ formFields }: FormTemplateRenderProps) => {
|
|
6
|
+
return <div>{formFields}</div>;
|
|
13
7
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
Checkbox as MagmaCheckbox,
|
|
7
7
|
CheckboxProps as MagmaCheckboxProps,
|
|
8
8
|
FormGroup,
|
|
9
9
|
FormGroupProps as MagmaFormGroupProps,
|
|
10
10
|
} from 'react-magma-dom';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
|
|
12
13
|
interface MagmaMultiCheckboxProps extends MagmaFormGroupProps {
|
|
13
14
|
options: MagmaCheckboxProps[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import { Combobox as MagmaCombobox } from 'react-magma-dom';
|
|
6
6
|
import { XORComboboxProps as MagmaComboboxProps } from 'react-magma-dom/dist/components/Combobox';
|
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
7
8
|
|
|
8
9
|
export type ComboboxProps = MagmaComboboxProps<ComboOption> & UseFieldApiConfig;
|
|
9
10
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { ComponentMapper } from '@data-driven-forms/react-form-renderer';
|
|
2
|
+
import {
|
|
3
|
+
Alert,
|
|
4
|
+
Banner,
|
|
5
|
+
Heading,
|
|
6
|
+
Hyperlink,
|
|
7
|
+
Toast,
|
|
8
|
+
Paragraph,
|
|
9
|
+
} from 'react-magma-dom';
|
|
2
10
|
|
|
3
11
|
import { Checkbox } from '../Checkbox';
|
|
4
12
|
import { Combobox } from '../Combobox';
|
|
@@ -10,21 +18,12 @@ import { Input } from '../Input';
|
|
|
10
18
|
import { Modal } from '../Modal';
|
|
11
19
|
import { PasswordInput } from '../PasswordInput';
|
|
12
20
|
import { Radio } from '../Radio';
|
|
13
|
-
import { Spy } from '../Spy';
|
|
14
21
|
import { Select } from '../Select';
|
|
22
|
+
import { Spy } from '../Spy';
|
|
15
23
|
import { Textarea } from '../Textarea';
|
|
16
24
|
import { TimePicker } from '../TimePicker';
|
|
17
25
|
import { Toggle } from '../Toggle';
|
|
18
26
|
|
|
19
|
-
import {
|
|
20
|
-
Alert,
|
|
21
|
-
Banner,
|
|
22
|
-
Heading,
|
|
23
|
-
Hyperlink,
|
|
24
|
-
Toast,
|
|
25
|
-
Paragraph,
|
|
26
|
-
} from 'react-magma-dom';
|
|
27
|
-
|
|
28
27
|
export enum componentTypes {
|
|
29
28
|
ALERT = 'ALERT',
|
|
30
29
|
BANNER = 'BANNER',
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
DatePicker as MagmaDatePicker,
|
|
7
7
|
DatePickerProps as MagmaDatePickerProps,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
11
|
export type DatePickerProps = MagmaDatePickerProps & UseFieldApiConfig;
|
|
11
12
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { FieldArray as FieldArrayBase } from '@data-driven-forms/react-form-renderer';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
ButtonColor,
|
|
7
|
-
ButtonType,
|
|
8
|
-
Paragraph,
|
|
9
|
-
} from 'react-magma-dom';
|
|
4
|
+
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
5
|
+
import { Button, ButtonColor, ButtonType, Paragraph } from 'react-magma-dom';
|
|
10
6
|
|
|
11
7
|
import { FieldArrayItem } from './FieldArrayItem';
|
|
12
8
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
import { IconButton, ButtonVariant, ThemeContext } from 'react-magma-dom';
|
|
5
5
|
import { DeleteIcon } from 'react-magma-icons';
|
|
6
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
|
|
7
8
|
export const FieldArrayItem = ({
|
|
8
9
|
fields,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
|
2
4
|
import {
|
|
3
5
|
Button,
|
|
4
6
|
ButtonColor,
|
|
@@ -8,8 +10,6 @@ import {
|
|
|
8
10
|
ButtonGroup,
|
|
9
11
|
} from 'react-magma-dom';
|
|
10
12
|
|
|
11
|
-
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
|
12
|
-
|
|
13
13
|
export interface FormTemplateProps {
|
|
14
14
|
formFields: any;
|
|
15
15
|
schema: any;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
Input as MagmaInput,
|
|
7
7
|
InputType,
|
|
8
8
|
InputProps as MagmaInputProps,
|
|
9
9
|
} from 'react-magma-dom';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
|
|
11
12
|
export type InputProps = MagmaInputProps & UseFieldApiConfig;
|
|
12
13
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
PasswordInput as MagmaPasswordInput,
|
|
7
7
|
PasswordInputProps as MagmaPasswordInputProps,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
11
|
export type PasswordInputProps = MagmaPasswordInputProps & UseFieldApiConfig;
|
|
11
12
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
Radio as MagmaRadio,
|
|
7
7
|
RadioProps,
|
|
8
8
|
RadioGroup,
|
|
9
9
|
RadioGroupProps as MagmaRadioGroupProps,
|
|
10
10
|
} from 'react-magma-dom';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
|
|
12
13
|
type RadioGroupProps = MagmaRadioGroupProps & UseFieldApiConfig;
|
|
13
14
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Schema, SchemaRenderer, SchemaRendererProps } from './SchemaRenderer';
|
|
3
|
-
|
|
4
|
-
import { componentTypes } from '../ComponentMapper';
|
|
5
2
|
|
|
6
3
|
import { action } from '@storybook/addon-actions';
|
|
7
4
|
import { Story, Meta } from '@storybook/react/types-6-0';
|
|
8
|
-
import { templateTypes } from '../TemplateMapper';
|
|
9
|
-
|
|
10
5
|
import { Hyperlink, InputType } from 'react-magma-dom';
|
|
11
6
|
|
|
7
|
+
import { Schema, SchemaRenderer, SchemaRendererProps } from './SchemaRenderer';
|
|
8
|
+
import { componentTypes } from '../ComponentMapper';
|
|
9
|
+
import { templateTypes } from '../TemplateMapper';
|
|
10
|
+
|
|
12
11
|
const baseSchema: Schema = {
|
|
13
12
|
title: 'Form Header',
|
|
14
13
|
description: 'Some description for a form.',
|
|
@@ -44,7 +43,7 @@ Form.args = {
|
|
|
44
43
|
component: componentTypes.PASSWORD_INPUT,
|
|
45
44
|
name: 'password',
|
|
46
45
|
labelText: 'Password',
|
|
47
|
-
type: InputType.password
|
|
46
|
+
type: InputType.password,
|
|
48
47
|
},
|
|
49
48
|
{
|
|
50
49
|
component: componentTypes.COMBOBOX,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { render, fireEvent, cleanup, act } from '@testing-library/react';
|
|
3
4
|
import userEvent from '@testing-library/user-event';
|
|
5
|
+
|
|
4
6
|
import { SchemaRenderer, Schema } from './SchemaRenderer';
|
|
5
7
|
import { componentTypes } from '../ComponentMapper';
|
|
6
8
|
import { templateTypes } from '../TemplateMapper';
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
FormRendererProps,
|
|
7
7
|
Schema as DataDrivenFormSchema,
|
|
8
8
|
} from '@data-driven-forms/react-form-renderer';
|
|
9
|
+
|
|
9
10
|
import { componentMapper, ComponentMapper } from '../ComponentMapper';
|
|
10
11
|
import { templateMapper } from '../TemplateMapper';
|
|
11
12
|
import { ValidatorMapper } from '../ValidatorMapper';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
import { Select as MagmaSelect } from 'react-magma-dom';
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
5
6
|
|
|
6
7
|
interface SelectOption {
|
|
7
8
|
label: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { FormTemplateRenderProps } from '@data-driven-forms/react-form-renderer';
|
|
4
|
+
|
|
2
5
|
import { BasicTemplate } from '../BasicTemplate';
|
|
3
6
|
import { FormTemplate } from '../FormTemplate';
|
|
4
7
|
|
|
5
|
-
import { FormTemplateRenderProps } from '@data-driven-forms/react-form-renderer';
|
|
6
8
|
export interface TemplateMapper {
|
|
7
9
|
[key: string]: (props: FormTemplateRenderProps) => React.ReactElement;
|
|
8
10
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
Textarea as MagmaTextarea,
|
|
7
7
|
TextareaProps as MagmaTextareaProps,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
11
|
export type TextareaProps = MagmaTextareaProps & UseFieldApiConfig;
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
TimePicker as MagmaTimePicker,
|
|
7
7
|
TimePickerProps as MagmaTimePickerProps,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
11
|
export type TimePickerProps = MagmaTimePickerProps & UseFieldApiConfig;
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import { UseFieldApiConfig } from '@data-driven-forms/react-form-renderer';
|
|
3
4
|
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import {
|
|
6
6
|
Toggle as MagmaToggle,
|
|
7
7
|
ToggleProps as MagmaToggleProps,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
11
|
export type ToggleProps = MagmaToggleProps & UseFieldApiConfig;
|
|
11
12
|
|