envoc-form 4.0.1-3 → 4.0.1-4

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/es/Form/Form.js CHANGED
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { useContext, useMemo, useState, } from 'react';
25
+ import classNames from 'classnames';
25
26
  import { Form as FormikFormWrapper, Formik, useFormikContext, } from 'formik';
26
27
  import FocusError from './FocusError';
27
28
  import FormBasedPreventNavigation from './FormBasedPreventNavigation';
@@ -51,7 +52,7 @@ export default function Form(_a) {
51
52
  _a)));
52
53
  },
53
54
  }); }, [serverErrors]);
54
- return (_jsx(Formik, __assign({ validateOnChange: false, validateOnBlur: true, validateOnMount: false, initialValues: initialValues || {}, onSubmit: handleSubmit }, props, { children: _jsx(ServerErrorContext.Provider, __assign({ value: serverErrorContextValue }, { children: _jsxs(FormikFormWrapper, __assign({ className: className, style: style }, { children: [_jsx(FocusError, { serverErrors: serverErrorContextValue }), _jsx(FormBasedPreventNavigation, { ignoreLostChanges: ignoreLostChanges }), children({
55
+ return (_jsx(Formik, __assign({ validateOnChange: false, validateOnBlur: true, validateOnMount: false, initialValues: initialValues || {}, onSubmit: handleSubmit }, props, { children: _jsx(ServerErrorContext.Provider, __assign({ value: serverErrorContextValue }, { children: _jsxs(FormikFormWrapper, __assign({ className: classNames(className, 'form'), style: style }, { children: [_jsx(FocusError, { serverErrors: serverErrorContextValue }), _jsx(FormBasedPreventNavigation, { ignoreLostChanges: ignoreLostChanges }), children({
55
56
  // hack for ref forwarding
56
57
  Field: Field,
57
58
  FieldArray: FieldArray,
package/lib/Form/Form.js CHANGED
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var jsx_runtime_1 = require("react/jsx-runtime");
29
29
  var react_1 = require("react");
30
+ var classnames_1 = __importDefault(require("classnames"));
30
31
  var formik_1 = require("formik");
31
32
  var FocusError_1 = __importDefault(require("./FocusError"));
32
33
  var FormBasedPreventNavigation_1 = __importDefault(require("./FormBasedPreventNavigation"));
@@ -56,7 +57,7 @@ function Form(_a) {
56
57
  _a)));
57
58
  },
58
59
  }); }, [serverErrors]);
59
- return ((0, jsx_runtime_1.jsx)(formik_1.Formik, __assign({ validateOnChange: false, validateOnBlur: true, validateOnMount: false, initialValues: initialValues || {}, onSubmit: handleSubmit }, props, { children: (0, jsx_runtime_1.jsx)(ServerErrorContext_1.ServerErrorContext.Provider, __assign({ value: serverErrorContextValue }, { children: (0, jsx_runtime_1.jsxs)(formik_1.Form, __assign({ className: className, style: style }, { children: [(0, jsx_runtime_1.jsx)(FocusError_1.default, { serverErrors: serverErrorContextValue }), (0, jsx_runtime_1.jsx)(FormBasedPreventNavigation_1.default, { ignoreLostChanges: ignoreLostChanges }), children({
60
+ return ((0, jsx_runtime_1.jsx)(formik_1.Formik, __assign({ validateOnChange: false, validateOnBlur: true, validateOnMount: false, initialValues: initialValues || {}, onSubmit: handleSubmit }, props, { children: (0, jsx_runtime_1.jsx)(ServerErrorContext_1.ServerErrorContext.Provider, __assign({ value: serverErrorContextValue }, { children: (0, jsx_runtime_1.jsxs)(formik_1.Form, __assign({ className: (0, classnames_1.default)(className, 'form'), style: style }, { children: [(0, jsx_runtime_1.jsx)(FocusError_1.default, { serverErrors: serverErrorContextValue }), (0, jsx_runtime_1.jsx)(FormBasedPreventNavigation_1.default, { ignoreLostChanges: ignoreLostChanges }), children({
60
61
  // hack for ref forwarding
61
62
  Field: Field_1.default,
62
63
  FieldArray: FieldArray_1.default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envoc-form",
3
- "version": "4.0.1-3",
3
+ "version": "4.0.1-4",
4
4
  "description": "Envoc form components",
5
5
  "keywords": [
6
6
  "react-component",
@@ -37,7 +37,7 @@
37
37
  "axios": "^0.21.1",
38
38
  "classnames": "^2.3.1",
39
39
  "date-fns": "^2.22.1",
40
- "envoc-request": "^4.0.1-3",
40
+ "envoc-request": "^4.0.1-4",
41
41
  "lru-cache": "^6.0.0",
42
42
  "prop-types": "^15.7.2",
43
43
  "react-date-picker": "^8.2.0",
@@ -4,6 +4,7 @@ exports[`AddressInput has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="string-group input-group group"
@@ -4,6 +4,7 @@ exports[`IconInputGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="date-picker group"
@@ -4,6 +4,7 @@ exports[`FileGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="file-group group"
package/src/Form/Form.tsx CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  useMemo,
6
6
  useState,
7
7
  } from 'react';
8
+ import classNames from 'classnames';
8
9
  import {
9
10
  Form as FormikFormWrapper,
10
11
  Formik,
@@ -92,7 +93,9 @@ export default function Form<TForm extends object>({
92
93
  onSubmit={handleSubmit}
93
94
  {...props}>
94
95
  <ServerErrorContext.Provider value={serverErrorContextValue}>
95
- <FormikFormWrapper className={className} style={style}>
96
+ <FormikFormWrapper
97
+ className={classNames(className, 'form')}
98
+ style={style}>
96
99
  <FocusError serverErrors={serverErrorContextValue} />
97
100
  <FormBasedPreventNavigation ignoreLostChanges={ignoreLostChanges} />
98
101
  {children({
@@ -4,6 +4,7 @@ exports[`FormTestBase has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  />
8
9
  </DocumentFragment>
9
10
  `;
@@ -4,6 +4,7 @@ exports[`IconInputGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="icon-input-group input-group group"
@@ -4,6 +4,7 @@ exports[`MoneyInputGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="something-here money-group input-group group"
@@ -4,6 +4,7 @@ exports[`NumberInputGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="number-group input-group group"
@@ -4,6 +4,7 @@ exports[`StringInputGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="string-group input-group group"
@@ -4,6 +4,7 @@ exports[`BooleanSelectGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="select-group group"
@@ -4,6 +4,7 @@ exports[`MultiNumberSelectGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="multiple select-group group"
@@ -102,6 +103,7 @@ exports[`SingleNumberSelectGroup has matching snapshot 1`] = `
102
103
  <DocumentFragment>
103
104
  <form
104
105
  action="#"
106
+ class="form"
105
107
  >
106
108
  <div
107
109
  class="select-group group"
@@ -4,6 +4,7 @@ exports[`MultiStringSelectGroup has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <div
9
10
  class="multiple select-group group"
@@ -102,6 +103,7 @@ exports[`SingleStringSelectGroup has matching snapshot 1`] = `
102
103
  <DocumentFragment>
103
104
  <form
104
105
  action="#"
106
+ class="form"
105
107
  >
106
108
  <div
107
109
  class="select-group group"
@@ -4,6 +4,7 @@ exports[`StandardFormActions has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <button
9
10
  class="submit-form-button"
@@ -4,6 +4,7 @@ exports[`SubmitFormButton has matching snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <form
6
6
  action="#"
7
+ class="form"
7
8
  >
8
9
  <button
9
10
  class="submit-form-button"