@nolwenture/formik-jsonschema-form 1.2.9 → 1.3.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/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +1 -1
- package/dist/cjs/FormView/components/Field.js +6 -10
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +4 -3
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +1 -1
- package/dist/esm/FormView/components/Field.js +6 -10
- package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +4 -3
- package/package.json +1 -1
package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js
CHANGED
|
@@ -36,6 +36,6 @@ const CollapsibleObjectFieldTemplate = (props) => {
|
|
|
36
36
|
const hide = collapsed;
|
|
37
37
|
return ((0, jsx_runtime_1.jsxs)(Wrapper, { ...mergedWrapperProps, children: [(0, jsx_runtime_1.jsxs)(TitleInfoWrapper, { children: [title && ((0, jsx_runtime_1.jsx)(Toggle, { onClick: () => setCollapsed(!collapsed),
|
|
38
38
|
//ariaExpanded={!hide}
|
|
39
|
-
ariaLabel: ariaLabel ?? name, children: (0, jsx_runtime_1.jsxs)(Title, { ...titleProps, htmlFor: name, children: [title, props?.required && (0, jsx_runtime_1.jsx)(RequiredIndicator, {}), (0, jsx_runtime_1.jsx)(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && (0, jsx_runtime_1.jsx)(Info, { ...info })] }),
|
|
39
|
+
ariaLabel: ariaLabel ?? name, children: (0, jsx_runtime_1.jsxs)(Title, { ...titleProps, htmlFor: name, children: [title, props?.required && (0, jsx_runtime_1.jsx)(RequiredIndicator, {}), (0, jsx_runtime_1.jsx)(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && (0, jsx_runtime_1.jsx)(Info, { ...info })] }), (0, jsx_runtime_1.jsxs)(ChildrenWrapper, { style: hide ? { display: "none" } : undefined, children: [description && ((0, jsx_runtime_1.jsx)(Description, { ...descriptionProps, children: description })), children, help && (0, jsx_runtime_1.jsx)(Help, { ...helpProps, children: help })] })] }));
|
|
40
40
|
};
|
|
41
41
|
exports.CollapsibleObjectFieldTemplate = CollapsibleObjectFieldTemplate;
|
|
@@ -85,18 +85,14 @@ const SelectedBox = styled_components_1.default.div `
|
|
|
85
85
|
justify-content: center;
|
|
86
86
|
align-items: start;
|
|
87
87
|
`;
|
|
88
|
-
const
|
|
89
|
-
color: ${(props) => props.theme.color.text.default};
|
|
88
|
+
const NotSelectedBox = styled_components_1.default.div `
|
|
90
89
|
background: ${(props) => props.theme.color.background.default};
|
|
91
90
|
border: ${(props) => props.theme.strokeWidth.thin} solid
|
|
92
91
|
${(props) => props.theme.color.border.default};
|
|
93
|
-
border-radius: ${(props) => props.theme.borderRadius.
|
|
94
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
95
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
92
|
+
border-radius: ${(props) => props.theme.borderRadius.none};
|
|
96
93
|
display: inline-flex;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
padding: 0 0.1rem;
|
|
94
|
+
width: 0.85rem;
|
|
95
|
+
height: 0.85rem;
|
|
100
96
|
`;
|
|
101
97
|
exports.SelectedIcon = (0, styled_components_1.default)(fa_1.FaCheck) `
|
|
102
98
|
color: ${(props) => props.theme.color.text.default};
|
|
@@ -125,7 +121,7 @@ exports.MultipleChoiceFieldWrapper = styled_components_1.default.div `
|
|
|
125
121
|
break-inside: avoid;
|
|
126
122
|
`;
|
|
127
123
|
const BooleanFieldValue = ({ name, className, value, label, }) => {
|
|
128
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: className, children: value === true ? ((0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(SelectedBox, { children: (0, jsx_runtime_1.jsx)(exports.SelectedIcon, {}) }), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Selected" })] })) : ((0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(
|
|
124
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, children: value === true ? ((0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(SelectedBox, { children: (0, jsx_runtime_1.jsx)(exports.SelectedIcon, {}) }), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Selected" })] })) : ((0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(NotSelectedBox, {}), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Not selected" })] })) }));
|
|
129
125
|
};
|
|
130
126
|
exports.BooleanFieldValue = BooleanFieldValue;
|
|
131
127
|
const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected, notSelected }) => {
|
|
@@ -133,6 +129,6 @@ const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected
|
|
|
133
129
|
selected.length > 0 &&
|
|
134
130
|
selected.map((s) => ((0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldElement, { "data-fjsf-enum-value-view": s.const, children: (0, jsx_runtime_1.jsxs)(Selected, { children: [(0, jsx_runtime_1.jsx)(SelectedBox, { children: (0, jsx_runtime_1.jsx)(exports.SelectedIcon, {}) }), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
135
131
|
notSelected?.length > 0 &&
|
|
136
|
-
notSelected.map((n) => ((0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldElement, { children: (0, jsx_runtime_1.jsxs)(NotSelected, { children: [(0, jsx_runtime_1.jsx)(
|
|
132
|
+
notSelected.map((n) => ((0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldElement, { children: (0, jsx_runtime_1.jsxs)(NotSelected, { children: [(0, jsx_runtime_1.jsx)(NotSelectedBox, {}), (0, jsx_runtime_1.jsx)(styledComponents_1.MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }) }));
|
|
137
133
|
};
|
|
138
134
|
exports.MultipleChoiceFieldValue = MultipleChoiceFieldValue;
|
|
@@ -9,7 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
exports.ObjectFieldTemplateWrapper = styled_components_1.default.div `
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
|
-
gap: ${(props) => props.theme.spacing.
|
|
12
|
+
gap: ${(props) => props.theme.spacing.l};
|
|
13
13
|
`;
|
|
14
14
|
exports.ObjectFieldTemplateTitle = styled_components_1.default.div `
|
|
15
15
|
color: ${(props) => props.theme.color.text.default};
|
|
@@ -28,11 +28,12 @@ exports.ObjectFieldTemplateTitle = styled_components_1.default.div `
|
|
|
28
28
|
font-weight: ${(props) => props.theme.typography.weight.bold};
|
|
29
29
|
}
|
|
30
30
|
${exports.ObjectFieldTemplateWrapper}[data-fjsf-level="1"] > & {
|
|
31
|
-
font-size: ${(props) => props.theme.typography.size.
|
|
31
|
+
font-size: ${(props) => props.theme.typography.size.h3};
|
|
32
32
|
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
33
|
+
margin-top: ${(props) => props.theme.spacing.m};
|
|
33
34
|
}
|
|
34
35
|
${exports.ObjectFieldTemplateWrapper}[data-fjsf-level="2"] > & {
|
|
35
|
-
font-size: ${(props) => props.theme.typography.size.
|
|
36
|
+
font-size: ${(props) => props.theme.typography.size.h4};
|
|
36
37
|
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
37
38
|
}
|
|
38
39
|
`;
|
package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js
CHANGED
|
@@ -33,5 +33,5 @@ export const CollapsibleObjectFieldTemplate = (props) => {
|
|
|
33
33
|
const hide = collapsed;
|
|
34
34
|
return (_jsxs(Wrapper, { ...mergedWrapperProps, children: [_jsxs(TitleInfoWrapper, { children: [title && (_jsx(Toggle, { onClick: () => setCollapsed(!collapsed),
|
|
35
35
|
//ariaExpanded={!hide}
|
|
36
|
-
ariaLabel: ariaLabel ?? name, children: _jsxs(Title, { ...titleProps, htmlFor: name, children: [title, props?.required && _jsx(RequiredIndicator, {}), _jsx(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && _jsx(Info, { ...info })] }),
|
|
36
|
+
ariaLabel: ariaLabel ?? name, children: _jsxs(Title, { ...titleProps, htmlFor: name, children: [title, props?.required && _jsx(RequiredIndicator, {}), _jsx(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && _jsx(Info, { ...info })] }), _jsxs(ChildrenWrapper, { style: hide ? { display: "none" } : undefined, children: [description && (_jsx(Description, { ...descriptionProps, children: description })), children, help && _jsx(Help, { ...helpProps, children: help })] })] }));
|
|
37
37
|
};
|
|
@@ -79,18 +79,14 @@ const SelectedBox = styled.div `
|
|
|
79
79
|
justify-content: center;
|
|
80
80
|
align-items: start;
|
|
81
81
|
`;
|
|
82
|
-
const
|
|
83
|
-
color: ${(props) => props.theme.color.text.default};
|
|
82
|
+
const NotSelectedBox = styled.div `
|
|
84
83
|
background: ${(props) => props.theme.color.background.default};
|
|
85
84
|
border: ${(props) => props.theme.strokeWidth.thin} solid
|
|
86
85
|
${(props) => props.theme.color.border.default};
|
|
87
|
-
border-radius: ${(props) => props.theme.borderRadius.
|
|
88
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
89
|
-
font-size: ${(props) => props.theme.typography.size.small};
|
|
86
|
+
border-radius: ${(props) => props.theme.borderRadius.none};
|
|
90
87
|
display: inline-flex;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
padding: 0 0.1rem;
|
|
88
|
+
width: 0.85rem;
|
|
89
|
+
height: 0.85rem;
|
|
94
90
|
`;
|
|
95
91
|
export const SelectedIcon = styled(FaCheck) `
|
|
96
92
|
color: ${(props) => props.theme.color.text.default};
|
|
@@ -119,12 +115,12 @@ export const MultipleChoiceFieldWrapper = styled.div `
|
|
|
119
115
|
break-inside: avoid;
|
|
120
116
|
`;
|
|
121
117
|
export const BooleanFieldValue = ({ name, className, value, label, }) => {
|
|
122
|
-
return (_jsx("div", { className: className, children: value === true ? (_jsxs(Selected, { children: [_jsx(SelectedBox, { children: _jsx(SelectedIcon, {}) }), _jsx(MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Selected" })] })) : (_jsxs(Selected, { children: [_jsx(
|
|
118
|
+
return (_jsx("div", { className: className, children: value === true ? (_jsxs(Selected, { children: [_jsx(SelectedBox, { children: _jsx(SelectedIcon, {}) }), _jsx(MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Selected" })] })) : (_jsxs(Selected, { children: [_jsx(NotSelectedBox, {}), _jsx(MultipleChoiceFieldLabel, { children: label !== undefined ? label : "Not selected" })] })) }));
|
|
123
119
|
};
|
|
124
120
|
export const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected, notSelected }) => {
|
|
125
121
|
return (_jsx(MultipleChoiceFieldWrapper, { children: _jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: [!selected && !notSelected && _jsx(_Fragment, {}), selected &&
|
|
126
122
|
selected.length > 0 &&
|
|
127
123
|
selected.map((s) => (_jsx(MultipleChoiceFieldElement, { "data-fjsf-enum-value-view": s.const, children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: _jsx(SelectedIcon, {}) }), _jsx(MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
128
124
|
notSelected?.length > 0 &&
|
|
129
|
-
notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(
|
|
125
|
+
notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedBox, {}), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }) }));
|
|
130
126
|
};
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
export const ObjectFieldTemplateWrapper = styled.div `
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
gap: ${(props) => props.theme.spacing.
|
|
5
|
+
gap: ${(props) => props.theme.spacing.l};
|
|
6
6
|
`;
|
|
7
7
|
export const ObjectFieldTemplateTitle = styled.div `
|
|
8
8
|
color: ${(props) => props.theme.color.text.default};
|
|
@@ -21,11 +21,12 @@ export const ObjectFieldTemplateTitle = styled.div `
|
|
|
21
21
|
font-weight: ${(props) => props.theme.typography.weight.bold};
|
|
22
22
|
}
|
|
23
23
|
${ObjectFieldTemplateWrapper}[data-fjsf-level="1"] > & {
|
|
24
|
-
font-size: ${(props) => props.theme.typography.size.
|
|
24
|
+
font-size: ${(props) => props.theme.typography.size.h3};
|
|
25
25
|
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
26
|
+
margin-top: ${(props) => props.theme.spacing.m};
|
|
26
27
|
}
|
|
27
28
|
${ObjectFieldTemplateWrapper}[data-fjsf-level="2"] > & {
|
|
28
|
-
font-size: ${(props) => props.theme.typography.size.
|
|
29
|
+
font-size: ${(props) => props.theme.typography.size.h4};
|
|
29
30
|
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
30
31
|
}
|
|
31
32
|
`;
|