@opengov/form-renderer 0.2.7 → 0.2.8
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/lib.js +1318 -1312
- package/dist/lib.umd.cjs +45 -45
- package/dist/renderer/Field.d.ts +8 -1
- package/dist/renderer/Section.d.ts +8 -2
- package/package.json +1 -1
package/dist/renderer/Field.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
import { FieldTemplate } from '@opengov/form-utils';
|
|
1
3
|
/**
|
|
2
4
|
* Field is a component that renders a field.
|
|
3
5
|
* It takes a fieldId and readonly.
|
|
@@ -8,8 +10,13 @@
|
|
|
8
10
|
* @param readonly - Whether the field is readonly.
|
|
9
11
|
* @returns A Field component.
|
|
10
12
|
*/
|
|
11
|
-
export default function Field({ id, name, readonly }: {
|
|
13
|
+
export default function Field({ id, name, readonly, wrapper, }: {
|
|
12
14
|
id: string;
|
|
13
15
|
name?: string;
|
|
14
16
|
readonly?: boolean;
|
|
17
|
+
wrapper?: React.ComponentType<{
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
field: FieldTemplate;
|
|
20
|
+
sx?: SxProps;
|
|
21
|
+
}>;
|
|
15
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
import { FieldTemplate, SectionTemplate } from '@opengov/form-utils';
|
|
2
3
|
/**
|
|
3
4
|
* Section is a component that renders a section.
|
|
4
5
|
* It takes a section template, a list of fields, and readonly.
|
|
@@ -9,9 +10,14 @@ import { SectionTemplate } from '@opengov/form-utils';
|
|
|
9
10
|
* @param readonly - Whether the section is readonly.
|
|
10
11
|
* @returns A Section component.
|
|
11
12
|
*/
|
|
12
|
-
export default function Section({ section, fields, fieldNames, readonly, }: {
|
|
13
|
+
export default function Section({ section, fields, fieldNames, readonly, fieldWrapper, }: {
|
|
13
14
|
section: SectionTemplate;
|
|
14
15
|
fields: string[];
|
|
15
16
|
fieldNames?: string[];
|
|
16
17
|
readonly?: boolean;
|
|
18
|
+
fieldWrapper?: React.ComponentType<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
field: FieldTemplate;
|
|
21
|
+
sx?: SxProps;
|
|
22
|
+
}>;
|
|
17
23
|
}): import("react/jsx-runtime").JSX.Element;
|