@nolwenture/formik-jsonschema-form 0.23.2 → 0.23.3

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 CHANGED
@@ -1009,5 +1009,6 @@ Wildcard `"*"` and `hidden fields` cannot be combined.
1009
1009
  components={components} // Override form components (e.g. wrappers) with custom ones
1010
1010
  formContext={formContext} // Form context
1011
1011
  useItemsAsAdditionalItems={true} // Allow "items" to be used as "additionalItems" in array fields that are missing "additionalItems", false by default
1012
+ hideSubmit={true} // hides submit-button of the form
1012
1013
  />
1013
1014
  ```
package/dist/Form.js CHANGED
@@ -30,7 +30,7 @@ export const Form = (props) => {
30
30
  "hideUnmarkedAdditionalProperties",
31
31
  ]);
32
32
  const { isSubmitting } = useFormikContext();
33
- const { schema, uiSchema = {}, className, children, fields = {}, templates = {}, components = {}, formContext = {}, useItemsAsAdditionalItems = false, hideUnmarkedAdditionalProperties = false, } = props;
33
+ const { schema, uiSchema = {}, className, children, fields = {}, templates = {}, components = {}, formContext = {}, useItemsAsAdditionalItems = false, hideUnmarkedAdditionalProperties = false, hideSubmit = false, } = props;
34
34
  const schemaDefinitions = schema.definitions;
35
35
  const uiSchemaDefinitions = uiSchema.definitions;
36
36
  const registry = {
@@ -45,5 +45,5 @@ export const Form = (props) => {
45
45
  };
46
46
  const { Form: FormEl, FormButton, FormButtonWrapper } = registry.components;
47
47
  const SchemaField = registry.fields.SchemaField;
48
- return (_jsx(FormRegistry.Provider, { value: registry, children: _jsxs(FormEl, { className: className, children: [_jsx(SchemaField, { name: "", schema: schema, uiSchema: uiSchema }), children ? (children) : (_jsx(FormButtonWrapper, { children: _jsx(FormButton, { type: "submit", disabled: isSubmitting, children: "Send" }) }))] }) }));
48
+ return (_jsx(FormRegistry.Provider, { value: registry, children: _jsxs(FormEl, { className: className, children: [_jsx(SchemaField, { name: "", schema: schema, uiSchema: uiSchema }), children ? (children) : (_jsx(FormButtonWrapper, { children: !hideSubmit && (_jsx(FormButton, { type: "submit", disabled: isSubmitting, children: "Send" })) }))] }) }));
49
49
  };
@@ -15,3 +15,4 @@ export declare const WithRefAndDefinitions: Story;
15
15
  export declare const MultipleChoice: Story;
16
16
  export declare const Collapsible: Story;
17
17
  export declare const FileUploadForm: Story;
18
+ export declare const HideSubmitButton: Story;
@@ -232,3 +232,10 @@ export const FileUploadForm = {
232
232
  uiSchema: fileUploadUiSchema,
233
233
  },
234
234
  };
235
+ export const HideSubmitButton = {
236
+ args: {
237
+ schema: simpleSchema,
238
+ uiSchema: simpleUiSchema,
239
+ hideSubmit: true,
240
+ },
241
+ };
package/dist/types.d.ts CHANGED
@@ -27,6 +27,7 @@ export type FormProps<T> = React.PropsWithChildren<{
27
27
  * @default false
28
28
  */
29
29
  noHtml5Validate?: boolean | undefined;
30
+ hideSubmit?: boolean | undefined;
30
31
  }>;
31
32
  export type Schema = JSONSchema7;
32
33
  export type UiSchema = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolwenture/formik-jsonschema-form",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Formik form generation from json schema",
5
5
  "author": "Antti Vikman <antti.vikman@nolwenture.com>",
6
6
  "contributors": [