@nolwenture/formik-jsonschema-form 1.0.0-beta.2 → 1.0.0-beta.21
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/README.md +25 -3
- package/dist/cjs/Form/components/Clickable.js +0 -7
- package/dist/cjs/Form/components/ErrorMessage.js +17 -7
- package/dist/cjs/Form/components/FieldInfo.js +26 -22
- package/dist/cjs/Form/components/FieldInput.js +38 -23
- package/dist/cjs/Form/components/Form.js +25 -15
- package/dist/cjs/Form/components/index.js +17 -7
- package/dist/cjs/Form/fields/AnyField/index.js +17 -7
- package/dist/cjs/Form/fields/ArrayField/ArrayField.js +20 -8
- package/dist/cjs/Form/fields/ArrayField/index.js +17 -7
- package/dist/cjs/Form/fields/BooleanField/BooleanField.js +1 -1
- package/dist/cjs/Form/fields/BooleanField/index.js +17 -7
- package/dist/cjs/Form/fields/BooleanField/styledComponents.js +5 -1
- package/dist/cjs/Form/fields/DateField/DateField.js +1 -1
- package/dist/cjs/Form/fields/DateField/index.js +17 -7
- package/dist/cjs/Form/fields/FileUploadField/index.js +17 -7
- package/dist/cjs/Form/fields/FileUploadField/styledComponents.js +6 -6
- package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceField.js +1 -1
- package/dist/cjs/Form/fields/MultipleChoiceField/index.js +17 -7
- package/dist/cjs/Form/fields/MultipleChoiceField/styledComponents.js +2 -0
- package/dist/cjs/Form/fields/NullField/index.js +17 -7
- package/dist/cjs/Form/fields/NumberField/index.js +17 -7
- package/dist/cjs/Form/fields/ObjectField/ObjectField.js +32 -13
- package/dist/cjs/Form/fields/ObjectField/index.js +17 -7
- package/dist/cjs/Form/fields/ObjectField/styledComponents.js +5 -5
- package/dist/cjs/Form/fields/RadioField/RadioField.js +1 -1
- package/dist/cjs/Form/fields/RadioField/index.js +17 -7
- package/dist/cjs/Form/fields/RadioField/styledComponents.js +5 -1
- package/dist/cjs/Form/fields/SchemaField/index.js +17 -7
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/index.js +17 -7
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/styledComponents.js +8 -8
- package/dist/cjs/Form/fields/SearchableSelectField/index.js +17 -7
- package/dist/cjs/Form/fields/SearchableSelectField/styledComponents.js +11 -8
- package/dist/cjs/Form/fields/StringField/StringField.js +4 -2
- package/dist/cjs/Form/fields/StringField/index.js +17 -7
- package/dist/cjs/Form/fields/TextAreaField/TextAreaField.js +1 -1
- package/dist/cjs/Form/fields/TextAreaField/index.js +17 -7
- package/dist/cjs/Form/fields/TextAreaField/styledComponents.js +5 -4
- package/dist/cjs/Form/fields/ToggleField/ToggleField.js +1 -1
- package/dist/cjs/Form/fields/ToggleField/index.js +17 -7
- package/dist/cjs/Form/fields/ToggleField/styledComponents.js +8 -4
- package/dist/cjs/Form/fields/index.js +17 -7
- package/dist/cjs/Form/index.js +1 -0
- package/dist/cjs/Form/styles/common.js +50 -32
- package/dist/cjs/Form/templates/ArrayFieldTemplate/index.js +17 -7
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +2 -2
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/index.js +17 -7
- package/dist/cjs/Form/templates/FieldTemplate/index.js +17 -7
- package/dist/cjs/Form/templates/ObjectFieldTemplate/index.js +17 -7
- package/dist/cjs/Form/templates/ObjectFieldTemplate/styledComponents.js +2 -2
- package/dist/cjs/Form/templates/index.js +17 -7
- package/dist/cjs/FormView/FormView.js +11 -4
- package/dist/cjs/FormView/components/Field.js +115 -9
- package/dist/cjs/FormView/components/index.js +17 -9
- package/dist/cjs/FormView/fields/ObjectField/ObjectField.js +1 -1
- package/dist/cjs/FormView/fields/ObjectField/index.js +17 -7
- package/dist/cjs/FormView/fields/index.js +17 -7
- package/dist/cjs/FormView/index.js +12 -2
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/index.js +17 -7
- package/dist/cjs/FormView/templates/CollapsibleObjectFieldTemplate/index.js +17 -7
- package/dist/cjs/FormView/templates/FieldTemplate/index.js +17 -7
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/index.js +17 -7
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +8 -1
- package/dist/cjs/FormView/templates/index.js +17 -7
- package/dist/cjs/FormView/types/index.js +2 -0
- package/dist/cjs/index.js +1 -14
- package/dist/cjs/styles/types.js +2 -0
- package/dist/cjs/utils/createValidationSchema.js +17 -7
- package/dist/cjs/utils/getTitleAndDescription.js +6 -5
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/orderAdditionalProperties.js +46 -0
- package/dist/esm/Form/components/Clickable.js +0 -7
- package/dist/esm/Form/components/FieldInfo.js +26 -22
- package/dist/esm/Form/components/FieldInput.js +20 -15
- package/dist/esm/Form/components/Form.js +8 -8
- package/dist/esm/Form/fields/ArrayField/ArrayField.js +20 -8
- package/dist/esm/Form/fields/BooleanField/BooleanField.js +1 -1
- package/dist/esm/Form/fields/BooleanField/styledComponents.js +5 -1
- package/dist/esm/Form/fields/DateField/DateField.js +1 -1
- package/dist/esm/Form/fields/FileUploadField/styledComponents.js +6 -6
- package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceField.js +1 -1
- package/dist/esm/Form/fields/MultipleChoiceField/styledComponents.js +2 -0
- package/dist/esm/Form/fields/ObjectField/ObjectField.js +33 -14
- package/dist/esm/Form/fields/ObjectField/styledComponents.js +5 -5
- package/dist/esm/Form/fields/RadioField/RadioField.js +1 -1
- package/dist/esm/Form/fields/RadioField/styledComponents.js +5 -1
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/styledComponents.js +8 -8
- package/dist/esm/Form/fields/SearchableSelectField/styledComponents.js +11 -8
- package/dist/esm/Form/fields/StringField/StringField.js +4 -2
- package/dist/esm/Form/fields/TextAreaField/TextAreaField.js +1 -1
- package/dist/esm/Form/fields/TextAreaField/styledComponents.js +5 -4
- package/dist/esm/Form/fields/ToggleField/ToggleField.js +1 -1
- package/dist/esm/Form/fields/ToggleField/styledComponents.js +8 -4
- package/dist/esm/Form/index.js +1 -0
- package/dist/esm/Form/styles/common.js +50 -32
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +2 -2
- package/dist/esm/Form/templates/ObjectFieldTemplate/styledComponents.js +2 -2
- package/dist/esm/FormView/FormView.js +7 -3
- package/dist/esm/FormView/components/Field.js +108 -7
- package/dist/esm/FormView/components/index.js +0 -2
- package/dist/esm/FormView/fields/ObjectField/ObjectField.js +1 -1
- package/dist/esm/FormView/index.js +9 -2
- package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +8 -1
- package/dist/esm/FormView/types/index.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/styles/types.js +1 -0
- package/dist/esm/utils/getTitleAndDescription.js +6 -5
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/orderAdditionalProperties.js +43 -0
- package/dist/types/Form/components/FieldInput.d.ts +5 -0
- package/dist/types/Form/components/index.d.ts +5 -0
- package/dist/types/Form/index.d.ts +1 -0
- package/dist/types/Form/templates/ArrayFieldTemplate/types.d.ts +0 -4
- package/dist/types/Form/templates/FieldTemplate/types.d.ts +0 -4
- package/dist/types/FormView/FormView.d.ts +3 -3
- package/dist/types/FormView/components/Field.d.ts +36 -3
- package/dist/types/FormView/components/index.d.ts +15 -14
- package/dist/types/FormView/index.d.ts +10 -2
- package/dist/types/FormView/templates/ArrayFieldTemplate/types.d.ts +0 -4
- package/dist/types/FormView/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.d.ts +1 -1
- package/dist/types/FormView/templates/FieldTemplate/types.d.ts +0 -4
- package/dist/types/FormView/templates/index.d.ts +1 -1
- package/dist/types/FormView/types/index.d.ts +1 -0
- package/dist/types/common/types/Field.d.ts +0 -3
- package/dist/types/common/types/Schemas.d.ts +11 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/styles/types.d.ts +216 -0
- package/dist/types/utils/getTitleAndDescription.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/orderAdditionalProperties.d.ts +1 -0
- package/package.json +23 -14
- package/dist/cjs/FormView/components/old_styledComponents.js +0 -65
- package/dist/esm/FormView/components/old_styledComponents.js +0 -57
- package/dist/types/FormView/components/old_styledComponents.d.ts +0 -32
|
@@ -8,25 +8,12 @@ export declare const components: {
|
|
|
8
8
|
FieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
9
|
FieldTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
10
10
|
FieldDescription: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
-
getComponents(components: ComponentsType): {
|
|
12
|
-
Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
-
Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
|
-
Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
-
};
|
|
16
|
-
ObjectFieldTemplateWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
17
|
-
ObjectFieldTemplateTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
-
ObjectFieldTemplateDescription: typeof Field.FieldDescription | undefined;
|
|
19
|
-
ArrayFieldTemplateWrapper: typeof import("../templates/ObjectFieldTemplate/styledComponents").ObjectFieldTemplateWrapper | undefined;
|
|
20
|
-
ArrayFieldTemplateTitle: typeof import("../templates/ObjectFieldTemplate/styledComponents").ObjectFieldTemplateTitle | undefined;
|
|
21
|
-
ArrayFieldTemplateDescription: typeof Field.FieldDescription | undefined;
|
|
22
|
-
ObjectFieldSection: import("react").FC<import("../fields/ObjectField").ObjectFieldSectionProps>;
|
|
23
|
-
ObjectFieldSectionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
|
|
24
|
-
ObjectFieldSectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, never>> & string;
|
|
25
11
|
StringFieldValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
12
|
TextAreaValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
27
13
|
ArrayFieldItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
28
14
|
EJSFieldValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
29
15
|
BooleanFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
16
|
+
MultipleChoiceFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
17
|
BooleanFieldValue: React.FC<{
|
|
31
18
|
name: string;
|
|
32
19
|
className?: string;
|
|
@@ -49,5 +36,19 @@ export declare const components: {
|
|
|
49
36
|
value?: string | number;
|
|
50
37
|
form?: import("formik").FormikContextType<unknown>;
|
|
51
38
|
}>;
|
|
39
|
+
getComponents(components: ComponentsType): {
|
|
40
|
+
Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
41
|
+
Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
42
|
+
Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
43
|
+
};
|
|
44
|
+
ObjectFieldTemplateWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
45
|
+
ObjectFieldTemplateTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
46
|
+
ObjectFieldTemplateDescription: typeof Field.FieldDescription | undefined;
|
|
47
|
+
ArrayFieldTemplateWrapper: typeof import("../templates/ObjectFieldTemplate/styledComponents").ObjectFieldTemplateWrapper | undefined;
|
|
48
|
+
ArrayFieldTemplateTitle: typeof import("../templates/ObjectFieldTemplate/styledComponents").ObjectFieldTemplateTitle | undefined;
|
|
49
|
+
ArrayFieldTemplateDescription: typeof Field.FieldDescription | undefined;
|
|
50
|
+
ObjectFieldSection: import("react").FC<import("../fields/ObjectField").ObjectFieldSectionProps>;
|
|
51
|
+
ObjectFieldSectionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
|
|
52
|
+
ObjectFieldSectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, never>> & string;
|
|
52
53
|
};
|
|
53
54
|
export type ComponentsType = typeof components;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
1
|
+
export * from "../utils";
|
|
2
|
+
export * from "../common/types";
|
|
3
|
+
export * from "../common/constants";
|
|
4
|
+
export * from "../common/FileUploadContext";
|
|
5
|
+
import { fields as FormViewFields } from "./fields";
|
|
6
|
+
import { components as FormViewComponents } from "./components";
|
|
7
|
+
import { templates as FormViewTemplates } from "./templates";
|
|
3
8
|
export * from "./FormView";
|
|
9
|
+
export * from "./FormViewRegistry";
|
|
10
|
+
export { FormViewComponents, FormViewFields, FormViewTemplates };
|
|
11
|
+
export type * from "./types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CollapsibleObjectFieldTemplate: import("
|
|
1
|
+
export declare const CollapsibleObjectFieldTemplate: import("../..").Field;
|
|
@@ -13,7 +13,7 @@ export declare const templateComponents: {
|
|
|
13
13
|
ArrayFieldTemplateDescription: typeof import("../components").FieldDescription | undefined;
|
|
14
14
|
};
|
|
15
15
|
export declare const templates: {
|
|
16
|
-
CollapsibleObjectFieldTemplate: import("
|
|
16
|
+
CollapsibleObjectFieldTemplate: import("..").Field;
|
|
17
17
|
ObjectFieldTemplate: React.FC<import("./ObjectFieldTemplate/types").ObjectFieldTemplateProps>;
|
|
18
18
|
FieldTemplate: React.FC<import("./FieldTemplate/types").FieldTemplateProps>;
|
|
19
19
|
ArrayFieldTemplate: React.FC<import("./ArrayFieldTemplate/types").ArrayFieldTemplateProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "./FormViewRegistryContext";
|
|
@@ -8,6 +8,9 @@ export type UiSchemaUiOrderType = string | {
|
|
|
8
8
|
collapsible?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export type UiSchema = {
|
|
11
|
+
definitions?: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
11
14
|
"ui:title"?: React.ReactNode | string;
|
|
12
15
|
"ui:description"?: React.ReactNode | string;
|
|
13
16
|
"ui:help"?: React.ReactNode | string;
|
|
@@ -19,15 +22,7 @@ export type UiSchema = {
|
|
|
19
22
|
"ui:props"?: {
|
|
20
23
|
[key: string]: any;
|
|
21
24
|
};
|
|
22
|
-
"ui:placeholderOptionOptions"?: {
|
|
23
|
-
props: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
25
|
"ui:order"?: UiSchemaUiOrderType[];
|
|
28
|
-
definitions?: {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
26
|
"ui:label"?: string | {
|
|
32
27
|
true: string;
|
|
33
28
|
false: string;
|
|
@@ -38,6 +33,14 @@ export type UiSchema = {
|
|
|
38
33
|
props?: {
|
|
39
34
|
[key: string]: any;
|
|
40
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Will be moved to "ui:options"
|
|
38
|
+
*/
|
|
39
|
+
"ui:placeholderOptionOptions"?: {
|
|
40
|
+
props: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
41
44
|
/**
|
|
42
45
|
* @deprecated Will be moved to "ui:options"
|
|
43
46
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./Form";
|
|
2
|
-
export *
|
|
2
|
+
export * from "./FormView";
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export type ThemeType = {
|
|
2
|
+
color: {
|
|
3
|
+
palette: {
|
|
4
|
+
primary: {
|
|
5
|
+
900: string;
|
|
6
|
+
800: string;
|
|
7
|
+
700: string;
|
|
8
|
+
600: string;
|
|
9
|
+
500: string;
|
|
10
|
+
400: string;
|
|
11
|
+
300: string;
|
|
12
|
+
200: string;
|
|
13
|
+
100: string;
|
|
14
|
+
};
|
|
15
|
+
secondary: {
|
|
16
|
+
900: string;
|
|
17
|
+
800: string;
|
|
18
|
+
700: string;
|
|
19
|
+
600: string;
|
|
20
|
+
500: string;
|
|
21
|
+
400: string;
|
|
22
|
+
300: string;
|
|
23
|
+
200: string;
|
|
24
|
+
100: string;
|
|
25
|
+
};
|
|
26
|
+
success: {
|
|
27
|
+
900: string;
|
|
28
|
+
800: string;
|
|
29
|
+
700: string;
|
|
30
|
+
600: string;
|
|
31
|
+
500: string;
|
|
32
|
+
400: string;
|
|
33
|
+
300: string;
|
|
34
|
+
200: string;
|
|
35
|
+
100: string;
|
|
36
|
+
};
|
|
37
|
+
warning: {
|
|
38
|
+
900: string;
|
|
39
|
+
800: string;
|
|
40
|
+
700: string;
|
|
41
|
+
600: string;
|
|
42
|
+
500: string;
|
|
43
|
+
400: string;
|
|
44
|
+
300: string;
|
|
45
|
+
200: string;
|
|
46
|
+
100: string;
|
|
47
|
+
};
|
|
48
|
+
danger: {
|
|
49
|
+
900: string;
|
|
50
|
+
800: string;
|
|
51
|
+
700: string;
|
|
52
|
+
600: string;
|
|
53
|
+
500: string;
|
|
54
|
+
400: string;
|
|
55
|
+
300: string;
|
|
56
|
+
200: string;
|
|
57
|
+
100: string;
|
|
58
|
+
};
|
|
59
|
+
neutral: {
|
|
60
|
+
900: string;
|
|
61
|
+
800: string;
|
|
62
|
+
700: string;
|
|
63
|
+
600: string;
|
|
64
|
+
500: string;
|
|
65
|
+
400: string;
|
|
66
|
+
300: string;
|
|
67
|
+
200: string;
|
|
68
|
+
100: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
background: {
|
|
72
|
+
default: string;
|
|
73
|
+
input: string;
|
|
74
|
+
};
|
|
75
|
+
border: {
|
|
76
|
+
default: string;
|
|
77
|
+
muted: string;
|
|
78
|
+
};
|
|
79
|
+
text: {
|
|
80
|
+
muted: string;
|
|
81
|
+
default: string;
|
|
82
|
+
dark: string;
|
|
83
|
+
secondary: string;
|
|
84
|
+
selected: string;
|
|
85
|
+
success: string;
|
|
86
|
+
info: string;
|
|
87
|
+
warning: string;
|
|
88
|
+
danger: string;
|
|
89
|
+
};
|
|
90
|
+
intent: {
|
|
91
|
+
default: {
|
|
92
|
+
none: string;
|
|
93
|
+
primary: string;
|
|
94
|
+
link: string;
|
|
95
|
+
info: string;
|
|
96
|
+
secondary: string;
|
|
97
|
+
tertiary: string;
|
|
98
|
+
success: string;
|
|
99
|
+
warning: string;
|
|
100
|
+
danger: string;
|
|
101
|
+
};
|
|
102
|
+
raised: {
|
|
103
|
+
none: string;
|
|
104
|
+
primary: string;
|
|
105
|
+
link: string;
|
|
106
|
+
info: string;
|
|
107
|
+
secondary: string;
|
|
108
|
+
tertiary: string;
|
|
109
|
+
success: string;
|
|
110
|
+
warning: string;
|
|
111
|
+
danger: string;
|
|
112
|
+
};
|
|
113
|
+
overlay: {
|
|
114
|
+
none: string;
|
|
115
|
+
primary: string;
|
|
116
|
+
link: string;
|
|
117
|
+
info: string;
|
|
118
|
+
secondary: string;
|
|
119
|
+
tertiary: string;
|
|
120
|
+
success: string;
|
|
121
|
+
warning: string;
|
|
122
|
+
danger: string;
|
|
123
|
+
};
|
|
124
|
+
sunken: {
|
|
125
|
+
none: string;
|
|
126
|
+
primary: string;
|
|
127
|
+
link: string;
|
|
128
|
+
info: string;
|
|
129
|
+
secondary: string;
|
|
130
|
+
tertiary: string;
|
|
131
|
+
success: string;
|
|
132
|
+
warning: string;
|
|
133
|
+
danger: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
overlay: {
|
|
137
|
+
10: string;
|
|
138
|
+
20: string;
|
|
139
|
+
30: string;
|
|
140
|
+
40: string;
|
|
141
|
+
50: string;
|
|
142
|
+
60: string;
|
|
143
|
+
70: string;
|
|
144
|
+
80: string;
|
|
145
|
+
90: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
elevation: {
|
|
149
|
+
default: string;
|
|
150
|
+
raised: string;
|
|
151
|
+
overlay: string;
|
|
152
|
+
sunken: string;
|
|
153
|
+
};
|
|
154
|
+
focus: {
|
|
155
|
+
default: string;
|
|
156
|
+
danger: string;
|
|
157
|
+
};
|
|
158
|
+
spacing: {
|
|
159
|
+
none: string;
|
|
160
|
+
xxs: string;
|
|
161
|
+
xs: string;
|
|
162
|
+
s: string;
|
|
163
|
+
m: string;
|
|
164
|
+
l: string;
|
|
165
|
+
xl: string;
|
|
166
|
+
xxl: string;
|
|
167
|
+
xxxl: string;
|
|
168
|
+
xxxxl: string;
|
|
169
|
+
xxxxxl: string;
|
|
170
|
+
};
|
|
171
|
+
borderRadius: {
|
|
172
|
+
none: string;
|
|
173
|
+
s: string;
|
|
174
|
+
m: string;
|
|
175
|
+
l: string;
|
|
176
|
+
xl: string;
|
|
177
|
+
circle: string;
|
|
178
|
+
};
|
|
179
|
+
strokeWidth: {
|
|
180
|
+
thin: string;
|
|
181
|
+
thick: string;
|
|
182
|
+
thicker: string;
|
|
183
|
+
thickest: string;
|
|
184
|
+
};
|
|
185
|
+
typography: {
|
|
186
|
+
fontFamily: {
|
|
187
|
+
base: string;
|
|
188
|
+
heading: string;
|
|
189
|
+
monospace: string;
|
|
190
|
+
};
|
|
191
|
+
weight: {
|
|
192
|
+
normal: string;
|
|
193
|
+
medium: string;
|
|
194
|
+
bold: string;
|
|
195
|
+
extrabold: string;
|
|
196
|
+
};
|
|
197
|
+
size: {
|
|
198
|
+
small: string;
|
|
199
|
+
base: string;
|
|
200
|
+
large: string;
|
|
201
|
+
h1: string;
|
|
202
|
+
h2: string;
|
|
203
|
+
h3: string;
|
|
204
|
+
h4: string;
|
|
205
|
+
};
|
|
206
|
+
lineHeight: {
|
|
207
|
+
small: string;
|
|
208
|
+
base: string;
|
|
209
|
+
large: string;
|
|
210
|
+
h1: string;
|
|
211
|
+
h2: string;
|
|
212
|
+
h3: string;
|
|
213
|
+
h4: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
@@ -4,7 +4,7 @@ export declare const getTitle: ({ title, uiSchema, schema, name, }: {
|
|
|
4
4
|
uiSchema?: UiSchema;
|
|
5
5
|
schema?: Schema;
|
|
6
6
|
name?: string;
|
|
7
|
-
}) => string | number | true |
|
|
7
|
+
}) => string | number | true | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | undefined;
|
|
8
8
|
export declare const getDescription: ({ description, uiSchema, schema, }: {
|
|
9
9
|
description?: string;
|
|
10
10
|
uiSchema?: UiSchema;
|
|
@@ -9,4 +9,5 @@ export * from "./solveReferences";
|
|
|
9
9
|
export * from "./createInitialValues";
|
|
10
10
|
export * from "./createValidationSchema";
|
|
11
11
|
export * from "./orderByUiSchema";
|
|
12
|
+
export * from "./orderAdditionalProperties";
|
|
12
13
|
export declare const warnFromUnsupportedKeys: (componentName: string, data: Record<string, any>, supportedKeys: string[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function orderAdditionalProperties(uiOrderArray: string[], valuesArray: string[]): string[];
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolwenture/formik-jsonschema-form",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.21",
|
|
4
4
|
"description": "Formik form generation from json schema",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "anttivikman <antti.vikman@nolwenture.com>",
|
|
6
6
|
"contributors": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"NoNasanen <nona.nasanen@nolwenture.com",
|
|
8
|
+
"anttivikman <antti.vikman@nolwenture.com>",
|
|
9
|
+
"nikolintunen-nolwenture <niko.lintunen@nolwenture.com>",
|
|
10
|
+
"tuunjuuso <juuso.tuunanen@nolwenture.com",
|
|
11
|
+
"anttischroderus <antti.schroderus@nolwenture.com>",
|
|
12
|
+
"samulinolw <samuli.vayrynen@nolwenture.com>",
|
|
13
|
+
"nolwram <rammohan.balasubramanian@nolwenture.com>"
|
|
9
14
|
],
|
|
10
15
|
"license": "MIT",
|
|
11
16
|
"types": "./dist/types/index.d.ts",
|
|
@@ -68,15 +73,15 @@
|
|
|
68
73
|
"@babel/preset-env": "^7.25.4",
|
|
69
74
|
"@babel/preset-react": "^7.24.1",
|
|
70
75
|
"@babel/preset-typescript": "^7.24.1",
|
|
71
|
-
"@nolwenture/component-library": "^1.0
|
|
72
|
-
"@storybook/addon-essentials": "^8.0
|
|
73
|
-
"@storybook/addon-interactions": "^8.0
|
|
74
|
-
"@storybook/addon-links": "^8.0
|
|
75
|
-
"@storybook/addon-webpack5-compiler-babel": "^3.0.
|
|
76
|
-
"@storybook/react": "^8.0
|
|
77
|
-
"@storybook/react-webpack5": "^8.0
|
|
78
|
-
"@storybook/test": "^8.0
|
|
79
|
-
"@storybook/test-runner": "^0.
|
|
76
|
+
"@nolwenture/component-library": "^1.1.0",
|
|
77
|
+
"@storybook/addon-essentials": "^8.5.0",
|
|
78
|
+
"@storybook/addon-interactions": "^8.5.0",
|
|
79
|
+
"@storybook/addon-links": "^8.5.0",
|
|
80
|
+
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
|
81
|
+
"@storybook/react": "^8.5.0",
|
|
82
|
+
"@storybook/react-webpack5": "^8.5.0",
|
|
83
|
+
"@storybook/test": "^8.5.0",
|
|
84
|
+
"@storybook/test-runner": "^0.21.0",
|
|
80
85
|
"@testing-library/jest-dom": "^6.4.2",
|
|
81
86
|
"@testing-library/react": "^14.2.2",
|
|
82
87
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -91,8 +96,12 @@
|
|
|
91
96
|
"jest": "^29.7.0",
|
|
92
97
|
"jest-environment-jsdom": "^29.7.0",
|
|
93
98
|
"react": "^18.2.0",
|
|
99
|
+
"react-dom": "^18.2.0",
|
|
100
|
+
"react-redux": "^9.2.0",
|
|
101
|
+
"react-router": "^7.0.1",
|
|
102
|
+
"react-router-dom": "^7.0.1",
|
|
94
103
|
"rimraf": "^6.0.1",
|
|
95
|
-
"storybook": "^8.0
|
|
104
|
+
"storybook": "^8.5.0",
|
|
96
105
|
"styled-components": "^6.1.8",
|
|
97
106
|
"ts-jest": "^29.1.2",
|
|
98
107
|
"webpack": "^5.91.0",
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MultipleChoiceFieldValue = exports.BooleanFieldValue = exports.BooleanFieldWrapper = exports.EJSFieldValue = exports.ArrayFieldItem = exports.TextAreaValue = exports.StringFieldValue = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const styledComponents_1 = require("../../Form/fields/MultipleChoiceField/styledComponents");
|
|
10
|
-
const getStyle_1 = require("../../utils/getStyle");
|
|
11
|
-
exports.StringFieldValue = styled_components_1.default.div `
|
|
12
|
-
white-space: pre-line;
|
|
13
|
-
`;
|
|
14
|
-
exports.TextAreaValue = styled_components_1.default.div `
|
|
15
|
-
white-space: pre-line;
|
|
16
|
-
`;
|
|
17
|
-
exports.ArrayFieldItem = styled_components_1.default.div ``;
|
|
18
|
-
exports.EJSFieldValue = styled_components_1.default.div `
|
|
19
|
-
width: 100%;
|
|
20
|
-
`;
|
|
21
|
-
exports.BooleanFieldWrapper = styled_components_1.default.div ``;
|
|
22
|
-
const BooleanFieldValue = ({ name, className, value, label, }) => {
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: className, children: value === true ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2713" }), (0, jsx_runtime_1.jsx)("span", { children: label !== undefined ? label : "Selected" })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2716" }), (0, jsx_runtime_1.jsx)("span", { children: label !== undefined ? label : "Not selected" })] })) }));
|
|
24
|
-
};
|
|
25
|
-
exports.BooleanFieldValue = BooleanFieldValue;
|
|
26
|
-
const NotSelected = styled_components_1.default.div `
|
|
27
|
-
opacity: 0.3;
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
`;
|
|
31
|
-
const Selected = styled_components_1.default.div `
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
`;
|
|
35
|
-
const SelectedBox = styled_components_1.default.span `
|
|
36
|
-
color: ${(props) => props.theme.background.default};
|
|
37
|
-
background: ${(props) => props.theme.text.default};
|
|
38
|
-
padding: ${(props) => `0 ${props.theme.spacing.xs}`};
|
|
39
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
40
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
41
|
-
display: inline-flex;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
align-items: center;
|
|
44
|
-
`;
|
|
45
|
-
const NotSelectedCircle = styled_components_1.default.span `
|
|
46
|
-
color: ${(props) => props.theme.background.default};
|
|
47
|
-
background: ${(props) => props.theme.text.default};
|
|
48
|
-
padding: ${(props) => props.theme.spacing.xxs};
|
|
49
|
-
border-radius: ${(props) => props.theme.borderRadius.circle};
|
|
50
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
51
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
52
|
-
line-height: 1.1;
|
|
53
|
-
display: inline-flex;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
align-items: center;
|
|
56
|
-
flex: 0 0 1rem;
|
|
57
|
-
`;
|
|
58
|
-
const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected, notSelected }) => {
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(styledComponents_1.MultipleChoiceFieldContainer, { className: className, style: (0, getStyle_1.getStyle)(style ?? ""), children: [!selected && !notSelected && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Nothing was selected" }), selected &&
|
|
60
|
-
selected.length > 0 &&
|
|
61
|
-
selected.map((s) => ((0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldElement, { children: (0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(SelectedBox, { children: "\u2713" }), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
62
|
-
notSelected?.length > 0 &&
|
|
63
|
-
notSelected.map((n) => ((0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldElement, { children: (0, jsx_runtime_1.jsxs)(NotSelected, { children: [(0, jsx_runtime_1.jsx)(NotSelectedCircle, { children: "\u2715" }), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }));
|
|
64
|
-
};
|
|
65
|
-
exports.MultipleChoiceFieldValue = MultipleChoiceFieldValue;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { MultipleChoiceFieldContainer, MultipleChoiceFieldElement, MultipleChoiceFieldLabel, } from "../../Form/fields/MultipleChoiceField/styledComponents";
|
|
4
|
-
import { getStyle } from "../../utils/getStyle";
|
|
5
|
-
export const StringFieldValue = styled.div `
|
|
6
|
-
white-space: pre-line;
|
|
7
|
-
`;
|
|
8
|
-
export const TextAreaValue = styled.div `
|
|
9
|
-
white-space: pre-line;
|
|
10
|
-
`;
|
|
11
|
-
export const ArrayFieldItem = styled.div ``;
|
|
12
|
-
export const EJSFieldValue = styled.div `
|
|
13
|
-
width: 100%;
|
|
14
|
-
`;
|
|
15
|
-
export const BooleanFieldWrapper = styled.div ``;
|
|
16
|
-
export const BooleanFieldValue = ({ name, className, value, label, }) => {
|
|
17
|
-
return (_jsx("div", { className: className, children: value === true ? (_jsxs("div", { children: [_jsx("span", { children: "\u2713" }), _jsx("span", { children: label !== undefined ? label : "Selected" })] })) : (_jsxs("div", { children: [_jsx("span", { children: "\u2716" }), _jsx("span", { children: label !== undefined ? label : "Not selected" })] })) }));
|
|
18
|
-
};
|
|
19
|
-
const NotSelected = styled.div `
|
|
20
|
-
opacity: 0.3;
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
`;
|
|
24
|
-
const Selected = styled.div `
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
`;
|
|
28
|
-
const SelectedBox = styled.span `
|
|
29
|
-
color: ${(props) => props.theme.background.default};
|
|
30
|
-
background: ${(props) => props.theme.text.default};
|
|
31
|
-
padding: ${(props) => `0 ${props.theme.spacing.xs}`};
|
|
32
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
33
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
34
|
-
display: inline-flex;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
align-items: center;
|
|
37
|
-
`;
|
|
38
|
-
const NotSelectedCircle = styled.span `
|
|
39
|
-
color: ${(props) => props.theme.background.default};
|
|
40
|
-
background: ${(props) => props.theme.text.default};
|
|
41
|
-
padding: ${(props) => props.theme.spacing.xxs};
|
|
42
|
-
border-radius: ${(props) => props.theme.borderRadius.circle};
|
|
43
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
44
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
45
|
-
line-height: 1.1;
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
align-items: center;
|
|
49
|
-
flex: 0 0 1rem;
|
|
50
|
-
`;
|
|
51
|
-
export const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected, notSelected }) => {
|
|
52
|
-
return (_jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: [!selected && !notSelected && _jsx(_Fragment, { children: "Nothing was selected" }), selected &&
|
|
53
|
-
selected.length > 0 &&
|
|
54
|
-
selected.map((s) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: "\u2713" }), _jsx(MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
55
|
-
notSelected?.length > 0 &&
|
|
56
|
-
notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedCircle, { children: "\u2715" }), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }));
|
|
57
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as formik from "formik";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export declare const StringFieldValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
-
export declare const TextAreaValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
-
export declare const ArrayFieldItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
-
export declare const EJSFieldValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
-
type BooleanValueFieldProps = {
|
|
8
|
-
name: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
value: boolean;
|
|
11
|
-
label?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const BooleanFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
|
-
export declare const BooleanFieldValue: React.FC<BooleanValueFieldProps>;
|
|
15
|
-
type MultipleChoiceFieldValueProps = {
|
|
16
|
-
selected: {
|
|
17
|
-
const: string | number;
|
|
18
|
-
title: string;
|
|
19
|
-
}[] | undefined;
|
|
20
|
-
notSelected: {
|
|
21
|
-
const: string | number;
|
|
22
|
-
title: string;
|
|
23
|
-
}[] | undefined;
|
|
24
|
-
inputProps?: any;
|
|
25
|
-
name?: React.ReactNode;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: string;
|
|
28
|
-
value?: string | number;
|
|
29
|
-
form?: formik.FormikContextType<unknown>;
|
|
30
|
-
};
|
|
31
|
-
export declare const MultipleChoiceFieldValue: React.FC<MultipleChoiceFieldValueProps>;
|
|
32
|
-
export {};
|