swoop-common 1.0.35 → 1.0.36

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.
@@ -30,8 +30,10 @@ interface Props {
30
30
  * The stage at which to render this template
31
31
  */
32
32
  stage: Stage;
33
- jsonSchema?: any;
34
- uiSchema?: any;
33
+ /**
34
+ * Should readonly fields be hidden
35
+ */
36
+ hideReadonlyFields?: boolean;
35
37
  }
36
38
  export declare const StyledFormView: React.FC<Props>;
37
39
  export {};
@@ -5,9 +5,9 @@ import { getComponents } from '../registry/components';
5
5
  import { generateJsonSchema } from '../schema/generate/jsonSchemaGenerate';
6
6
  import { generateUiSchema } from '../schema/generate/uiSchemaGenerate';
7
7
  import { initialisedCheck } from '../../api/init';
8
- export const StyledFormView = ({ initialData, schema, onChange, stage, pool, readonly, jsonSchema, uiSchema }) => {
8
+ export const StyledFormView = ({ initialData, schema, onChange, stage, pool, readonly, hideReadonlyFields }) => {
9
9
  useEffect(initialisedCheck, []);
10
- const json = jsonSchema || generateJsonSchema(schema, stage);
11
- const ui = uiSchema || generateUiSchema(schema, stage);
10
+ const json = generateJsonSchema(schema, stage, hideReadonlyFields);
11
+ const ui = generateUiSchema(schema, stage, hideReadonlyFields);
12
12
  return (React.createElement(JsonForms, { onChange: onChange, data: initialData, schema: json, uischema: ui, renderers: [...materialRenderers, ...getComponents(pool)], readonly: readonly, cells: materialCells }));
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {